From fbf42d895a7904780fbc59457aba8882bf40c037 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Fri, 8 Mar 2024 13:12:32 -0500 Subject: [PATCH 01/90] Add dotnet-api product slug to sample metadata script (#39138) Co-authored-by: Anne Thompson --- eng/common/scripts/Test-SampleMetadata.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/common/scripts/Test-SampleMetadata.ps1 b/eng/common/scripts/Test-SampleMetadata.ps1 index 4a0000220fde5..9e50fa1dce03a 100644 --- a/eng/common/scripts/Test-SampleMetadata.ps1 +++ b/eng/common/scripts/Test-SampleMetadata.ps1 @@ -330,6 +330,7 @@ begin { "blazor-webassembly", "common-data-service", "customer-voice", + "dotnet-api", "dotnet-core", "dotnet-standard", "document-intelligence", From 0952442932cb4c33b193bdf0b0914fd2f912ae6a Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Fri, 8 Mar 2024 14:06:47 -0500 Subject: [PATCH 02/90] Sync .github/workflows directory with azure-sdk-tools for PR 7845 (#39140) * Create a separate job for events requiring Az CLI * Update .github/workflows/event-processor.yml Co-authored-by: Wes Haggard --------- Co-authored-by: James Suplizio Co-authored-by: Wes Haggard --- .github/workflows/event-processor.yml | 68 +++++++++++++++++++++++++-- 1 file changed, 63 insertions(+), 5 deletions(-) diff --git a/.github/workflows/event-processor.yml b/.github/workflows/event-processor.yml index 649b211e92547..66442232c93b3 100644 --- a/.github/workflows/event-processor.yml +++ b/.github/workflows/event-processor.yml @@ -17,26 +17,29 @@ on: permissions: {} jobs: - event-handler: + # This event requires the Azure CLI to get the LABEL_SERVICE_API_KEY from the vault. + # Because the azure/login step adds time costly pre/post Az CLI commands to any every job + # it's used in, split this into its own job so only the event that needs the Az CLI pays + # the cost. + event-handler-with-azure: permissions: issues: write pull-requests: write # For OIDC auth id-token: write contents: read - name: Handle ${{ github.event_name }} ${{ github.event.action }} event + name: Handle ${{ github.event_name }} ${{ github.event.action }} event with azure login runs-on: ubuntu-latest + if: ${{ github.event_name == 'issues' && github.event.action == 'opened' }} steps: - name: 'Az CLI login' - if: ${{ github.event_name == 'issues' && github.event.action == 'opened' }} - uses: azure/login@v1.5.1 + uses: azure/login@v1 with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - name: 'Run Azure CLI commands' - if: ${{ github.event_name == 'issues' && github.event.action == 'opened' }} run: | LABEL_SERVICE_API_KEY=$(az keyvault secret show \ --vault-name issue-labeler \ @@ -94,3 +97,58 @@ jobs: # https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} LABEL_SERVICE_API_KEY: ${{ env.LABEL_SERVICE_API_KEY }} + + event-handler: + permissions: + issues: write + pull-requests: write + name: Handle ${{ github.event_name }} ${{ github.event.action }} event + runs-on: ubuntu-latest + if: ${{ github.event_name != 'issues' || github.event.action != 'opened' }} + steps: + # To run github-event-processor built from source, for testing purposes, uncomment everything + # in between the Start/End-Build From Source comments and comment everything in between the + # Start/End-Install comments + # Start-Install + - name: Install GitHub Event Processor + run: > + dotnet tool install + Azure.Sdk.Tools.GitHubEventProcessor + --version 1.0.0-dev.20240229.2 + --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json + --global + shell: bash + # End-Install + + # Testing checkout of sources from the Azure/azure-sdk-tools repository + # The ref: is the SHA from the pull request in that repository or the + # refs/pull//merge for the latest on any given PR. If the repository + # is a fork eg. /azure-sdk-tools then the repository down below will + # need to point to that fork + # Start-Build + # - name: Checkout tools repo for GitHub Event Processor sources + # uses: actions/checkout@v3 + # with: + # repository: Azure/azure-sdk-tools + # path: azure-sdk-tools + # ref: /merge> or + + # - name: Build and install GitHubEventProcessor from sources + # run: | + # dotnet pack + # dotnet tool install --global --prerelease --add-source ../../../artifacts/packages/Debug Azure.Sdk.Tools.GitHubEventProcessor + # shell: bash + # working-directory: azure-sdk-tools/tools/github-event-processor/Azure.Sdk.Tools.GitHubEventProcessor + # End-Build + + - name: Process Action Event + run: | + cat > payload.json << 'EOF' + ${{ toJson(github.event) }} + EOF + github-event-processor ${{ github.event_name }} payload.json + shell: bash + env: + # This is a temporary secret generated by github + # https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 5cfa419435bcddd05318bebeee7155b8cf8e5d15 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Fri, 8 Mar 2024 14:07:50 -0500 Subject: [PATCH 03/90] Update Prepare-Release.ps1 to handle only one previous release (#39139) In the case there is exactly one previous release PS will return the single object and thus the Count property will not exist. Instead this change ensures that we always have a list. Co-authored-by: Wes Haggard --- eng/common/scripts/Prepare-Release.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/scripts/Prepare-Release.ps1 b/eng/common/scripts/Prepare-Release.ps1 index 269fd113fd69c..e82c5982ac967 100644 --- a/eng/common/scripts/Prepare-Release.ps1 +++ b/eng/common/scripts/Prepare-Release.ps1 @@ -116,7 +116,7 @@ $month = $ParsedReleaseDate.ToString("MMMM") Write-Host "Assuming release is in $month with release date $releaseDateString" -ForegroundColor Green if (Test-Path "Function:GetExistingPackageVersions") { - $releasedVersions = GetExistingPackageVersions -PackageName $packageProperties.Name -GroupId $packageProperties.Group + $releasedVersions = @(GetExistingPackageVersions -PackageName $packageProperties.Name -GroupId $packageProperties.Group) if ($null -ne $releasedVersions -and $releasedVersions.Count -gt 0) { $latestReleasedVersion = $releasedVersions[$releasedVersions.Count - 1] From 17370af5c22281977b39a814995259f351acb00f Mon Sep 17 00:00:00 2001 From: Shawn Fang <45607042+mssfang@users.noreply.github.com> Date: Fri, 8 Mar 2024 15:00:43 -0800 Subject: [PATCH 04/90] [OpenAI] Ennhance Streaming ChatCompletion documentations and samples. (#39078) --- .vscode/cspell.json | 3 + eng/versioning/external_dependencies.txt | 1 + sdk/openai/azure-ai-openai/README.md | 4 +- sdk/openai/azure-ai-openai/pom.xml | 7 ++ .../azure/ai/openai/OpenAIAsyncClient.java | 25 +++++++ .../com/azure/ai/openai/OpenAIClient.java | 27 +++++++- .../azure/ai/openai/StreamingChatSample.java | 61 ++++++++++++----- .../OpenAIAsyncClientJavaDocCodeSnippets.java | 66 +++++++++++++++++++ .../impl/OpenAIClientJavaDocCodeSnippets.java | 66 +++++++++++++++++++ 9 files changed, 240 insertions(+), 20 deletions(-) create mode 100644 sdk/openai/azure-ai-openai/src/samples/java/com/azure/ai/openai/impl/OpenAIAsyncClientJavaDocCodeSnippets.java create mode 100644 sdk/openai/azure-ai-openai/src/samples/java/com/azure/ai/openai/impl/OpenAIClientJavaDocCodeSnippets.java diff --git a/.vscode/cspell.json b/.vscode/cspell.json index fd2ad906829fe..0bd6a639cdd46 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -306,6 +306,7 @@ "hudha", "hvac", "hybridkubernetes", + "hyunwoongko", "insights", "intellij", "Intellij", @@ -320,8 +321,10 @@ "JSESSIONID", "junitxml", "jtoken", + "jtokkit", "keyvault", "kasobol", + "knuddelsgmbh", "kube", "kubeconfig", "kubeconfigs", diff --git a/eng/versioning/external_dependencies.txt b/eng/versioning/external_dependencies.txt index 95218f5104320..7d36b82ed9289 100644 --- a/eng/versioning/external_dependencies.txt +++ b/eng/versioning/external_dependencies.txt @@ -26,6 +26,7 @@ com.google.code.gson:gson;2.10 com.google.guava:guava;33.0.0-jre com.h2database:h2;2.2.220 com.h3xstream.findsecbugs:findsecbugs-plugin;1.9.0 +com.knuddels:jtokkit;1.0.0 com.microsoft.azure:applicationinsights-core;3.4.1 com.microsoft.azure:azure-annotations;1.7.0 com.microsoft.azure:azure-arm-client-runtime;1.7.14 diff --git a/sdk/openai/azure-ai-openai/README.md b/sdk/openai/azure-ai-openai/README.md index af2beb119d4d4..65db7a74cb05b 100644 --- a/sdk/openai/azure-ai-openai/README.md +++ b/sdk/openai/azure-ai-openai/README.md @@ -253,7 +253,8 @@ chatCompletionsStream } }); ``` -For a complete sample example, see sample [Streaming Chat Completions][sample_get_chat_completions_streaming]. + +To compute tokens in streaming chat completions, see sample [Streaming Chat Completions][sample_get_chat_completions_streaming]. ### Text embeddings @@ -459,6 +460,7 @@ For details on contributing to this repository, see the [contributing guide](htt [azure_subscription]: https://azure.microsoft.com/free/ [docs]: https://azure.github.io/azure-sdk-for-java/ [jdk]: https://docs.microsoft.com/java/azure/jdk/ +[jtokkit]: https://github.com/knuddelsgmbh/jtokkit [logLevels]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core/src/main/java/com/azure/core/util/logging/ClientLogger.java [microsoft_docs_openai_completion]: https://learn.microsoft.com/azure/cognitive-services/openai/how-to/completions [microsoft_docs_openai_embedding]: https://learn.microsoft.com/azure/cognitive-services/openai/concepts/understand-embeddings diff --git a/sdk/openai/azure-ai-openai/pom.xml b/sdk/openai/azure-ai-openai/pom.xml index 50a8d2afe795a..fbe634fdbd1d2 100644 --- a/sdk/openai/azure-ai-openai/pom.xml +++ b/sdk/openai/azure-ai-openai/pom.xml @@ -103,6 +103,13 @@ test + + com.knuddels + jtokkit + 1.0.0 + test + + org.junit.jupiter diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIAsyncClient.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIAsyncClient.java index c899364fe114a..e64a406382b43 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIAsyncClient.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIAsyncClient.java @@ -639,6 +639,31 @@ public Mono getCompletions(String deploymentOrModelName, String pro * Gets completions as a stream for the provided input prompts. Completions support a wide variety of tasks and * generate text that continues from or "completes" provided prompt data. * + *

+ * Code Samples + *

+ * + *
+     * openAIAsyncClient
+     *         .getChatCompletionsStream(deploymentOrModelId, new ChatCompletionsOptions(chatMessages))
+     *         .toStream()
+     *         // Remove .skip(1) when using Non-Azure OpenAI API
+     *         // Note: the first chat completions can be ignored when using Azure OpenAI service which is a known service bug.
+     *         // TODO: remove .skip(1) after service fixes the issue.
+     *         .skip(1)
+     *         .forEach(chatCompletions -> {
+     *             ChatResponseMessage delta = chatCompletions.getChoices().get(0).getDelta();
+     *             if (delta.getRole() != null) {
+     *                 System.out.println("Role = " + delta.getRole());
+     *             }
+     *             if (delta.getContent() != null) {
+     *                 String content = delta.getContent();
+     *                 System.out.print(content);
+     *             }
+     *         });
+     * 
+ * + * * @param deploymentOrModelName Specifies either the model deployment name (when using Azure OpenAI) or model name * (when using non-Azure OpenAI) to use for this request. * @param completionsOptions The configuration information for a completions request. Completions support a wide diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIClient.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIClient.java index beb2fc0b8f0ef..4505e47d41368 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIClient.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIClient.java @@ -681,8 +681,31 @@ public ChatCompletions getChatCompletions(String deploymentOrModelName, } /** - * Gets chat completions for the provided chat messages. Chat completions support a wide variety of tasks and - * generate text that continues from or "completes" provided prompt data. + * Gets chat completions for the provided chat messages in streaming mode. Chat completions support a wide variety + * of tasks and generate text that continues from or "completes" provided prompt data. + *

+ * Code Samples + *

+ * + *
+     * openAIClient.getChatCompletionsStream(deploymentOrModelId, new ChatCompletionsOptions(chatMessages))
+     *         .stream()
+     *         // Remove .skip(1) when using Non-Azure OpenAI API
+     *         // Note: the first chat completions can be ignored when using Azure OpenAI service which is a known service bug.
+     *         // TODO: remove .skip(1) after service fixes the issue.
+     *         .skip(1)
+     *         .forEach(chatCompletions -> {
+     *             ChatResponseMessage delta = chatCompletions.getChoices().get(0).getDelta();
+     *             if (delta.getRole() != null) {
+     *                 System.out.println("Role = " + delta.getRole());
+     *             }
+     *             if (delta.getContent() != null) {
+     *                 String content = delta.getContent();
+     *                 System.out.print(content);
+     *             }
+     *         });
+     * 
+ * * * @param deploymentOrModelName Specifies either the model deployment name (when using Azure OpenAI) or model name * (when using non-Azure OpenAI) to use for this request. diff --git a/sdk/openai/azure-ai-openai/src/samples/java/com/azure/ai/openai/StreamingChatSample.java b/sdk/openai/azure-ai-openai/src/samples/java/com/azure/ai/openai/StreamingChatSample.java index 322776edb0985..b9f1ea4bef4cb 100644 --- a/sdk/openai/azure-ai-openai/src/samples/java/com/azure/ai/openai/StreamingChatSample.java +++ b/sdk/openai/azure-ai-openai/src/samples/java/com/azure/ai/openai/StreamingChatSample.java @@ -11,10 +11,16 @@ import com.azure.ai.openai.models.ChatRequestUserMessage; import com.azure.ai.openai.models.ChatResponseMessage; import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.util.Configuration; import com.azure.core.util.IterableStream; +import com.knuddels.jtokkit.Encodings; +import com.knuddels.jtokkit.api.Encoding; +import com.knuddels.jtokkit.api.EncodingRegistry; +import com.knuddels.jtokkit.api.EncodingType; import java.util.ArrayList; import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; /** * Demonstrates how to get chat completions for the provided chat messages. @@ -31,9 +37,9 @@ public class StreamingChatSample { * @param args Unused. Arguments to the program. */ public static void main(String[] args) { - String azureOpenaiKey = "{azure-open-ai-key}"; - String endpoint = "{azure-open-ai-endpoint}"; - String deploymentOrModelId = "{azure-open-ai-deployment-model-id}"; + String azureOpenaiKey = Configuration.getGlobalConfiguration().get("AZURE_OPENAI_KEY"); + String endpoint = Configuration.getGlobalConfiguration().get("AZURE_OPENAI_ENDPOINT"); + String deploymentOrModelId = Configuration.getGlobalConfiguration().get("OPENAI_DEPLOYMENT_OR_MODEL_ID"); OpenAIClient client = new OpenAIClientBuilder() .endpoint(endpoint) @@ -49,6 +55,8 @@ public static void main(String[] args) { IterableStream chatCompletionsStream = client.getChatCompletionsStream(deploymentOrModelId, new ChatCompletionsOptions(chatMessages)); + AtomicInteger tokenCount = new AtomicInteger(); + // The delta is the message content for a streaming response. // Subsequence of streaming delta will be like: // "delta": { @@ -64,19 +72,38 @@ public static void main(String[] args) { // "content": "'t" // } chatCompletionsStream - .stream() - // Remove .skip(1) when using Non-Azure OpenAI API - // Note: the first chat completions can be ignored when using Azure OpenAI service which is a known service bug. - // TODO: remove .skip(1) when service fix the issue. - .skip(1) - .forEach(chatCompletions -> { - ChatResponseMessage delta = chatCompletions.getChoices().get(0).getDelta(); - if (delta.getRole() != null) { - System.out.println("Role = " + delta.getRole()); - } - if (delta.getContent() != null) { - System.out.print(delta.getContent()); - } - }); + .stream() + // Remove .skip(1) when using Non-Azure OpenAI API + // Note: the first chat completions can be ignored when using Azure OpenAI service which is a known service bug. + // TODO: remove .skip(1) after service fixes the issue. + .skip(1) + .forEach(chatCompletions -> { + ChatResponseMessage delta = chatCompletions.getChoices().get(0).getDelta(); + + if (delta.getRole() != null) { + System.out.println("Role = " + delta.getRole()); + } + + if (delta.getContent() != null) { + String content = delta.getContent(); + System.out.print(content); + tokenCount.addAndGet(computeToken(content)); + } + }); + + // Use https://platform.openai.com/tokenizer to verify the token count + System.out.println("\nTotal token count: " + tokenCount.get()); + } + + // Compute the token count for the given input. + // For cl100k_base and p50k_base encodings, use 'jtokkit' library to compute the token count. https://github.com/knuddelsgmbh/jtokkit + // For r50k_base (gpt2) encodings, use 'gpt2-tokenizer-java' library to compute the token count. https://github.com/hyunwoongko/gpt2-tokenizer-java + // We use 'jtokkit' library to compute the token count for this sample. + private static int computeToken(String input) { + EncodingRegistry registry = Encodings.newDefaultEncodingRegistry(); + Encoding enc = registry.getEncoding(EncodingType.CL100K_BASE); + // Or get the tokenizer corresponding to a specific OpenAI model + // enc = registry.getEncodingForModel(ModelType.GPT_4); + return enc.countTokens(input); } } diff --git a/sdk/openai/azure-ai-openai/src/samples/java/com/azure/ai/openai/impl/OpenAIAsyncClientJavaDocCodeSnippets.java b/sdk/openai/azure-ai-openai/src/samples/java/com/azure/ai/openai/impl/OpenAIAsyncClientJavaDocCodeSnippets.java new file mode 100644 index 0000000000000..3a93b4d470b48 --- /dev/null +++ b/sdk/openai/azure-ai-openai/src/samples/java/com/azure/ai/openai/impl/OpenAIAsyncClientJavaDocCodeSnippets.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.openai.impl; + +import com.azure.ai.openai.OpenAIAsyncClient; +import com.azure.ai.openai.OpenAIClient; +import com.azure.ai.openai.OpenAIClientBuilder; +import com.azure.ai.openai.models.ChatCompletionsOptions; +import com.azure.ai.openai.models.ChatRequestAssistantMessage; +import com.azure.ai.openai.models.ChatRequestMessage; +import com.azure.ai.openai.models.ChatRequestSystemMessage; +import com.azure.ai.openai.models.ChatRequestUserMessage; +import com.azure.ai.openai.models.ChatResponseMessage; +import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.util.Configuration; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.List; + +/** + * Code snippets for {@link OpenAIAsyncClient} + */ +public class OpenAIAsyncClientJavaDocCodeSnippets { + private OpenAIAsyncClient openAIAsyncClient = getOpenAIAsyncClient(); + + /** + * Code snippets for {@link OpenAIClient#getChatCompletionsStream(String, ChatCompletionsOptions)} + */ + @Test + public void getChatCompletionsStream() { + String deploymentOrModelId = "gpt-4-1106-preview"; + List chatMessages = new ArrayList<>(); + chatMessages.add(new ChatRequestSystemMessage("You are a helpful assistant. You will talk like a pirate.")); + chatMessages.add(new ChatRequestUserMessage("Can you help me?")); + chatMessages.add(new ChatRequestAssistantMessage("Of course, me hearty! What can I do for ye?")); + chatMessages.add(new ChatRequestUserMessage("What's the best way to train a parrot?")); + // BEGIN: com.azure.ai.openai.OpenAIAsyncClient.getChatCompletionsStream#String-ChatCompletionsOptions + openAIAsyncClient + .getChatCompletionsStream(deploymentOrModelId, new ChatCompletionsOptions(chatMessages)) + .toStream() + // Remove .skip(1) when using Non-Azure OpenAI API + // Note: the first chat completions can be ignored when using Azure OpenAI service which is a known service bug. + // TODO: remove .skip(1) after service fixes the issue. + .skip(1) + .forEach(chatCompletions -> { + ChatResponseMessage delta = chatCompletions.getChoices().get(0).getDelta(); + if (delta.getRole() != null) { + System.out.println("Role = " + delta.getRole()); + } + if (delta.getContent() != null) { + String content = delta.getContent(); + System.out.print(content); + } + }); + // END: com.azure.ai.openai.OpenAIAsyncClient.getChatCompletionsStream#String-ChatCompletionsOptions + } + + private OpenAIAsyncClient getOpenAIAsyncClient() { + return new OpenAIClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("AZURE_OPENAI_ENDPOINT")) + .credential(new AzureKeyCredential(Configuration.getGlobalConfiguration().get("AZURE_OPENAI_KEY"))) + .buildAsyncClient(); + } +} diff --git a/sdk/openai/azure-ai-openai/src/samples/java/com/azure/ai/openai/impl/OpenAIClientJavaDocCodeSnippets.java b/sdk/openai/azure-ai-openai/src/samples/java/com/azure/ai/openai/impl/OpenAIClientJavaDocCodeSnippets.java new file mode 100644 index 0000000000000..4c0edc428a0a9 --- /dev/null +++ b/sdk/openai/azure-ai-openai/src/samples/java/com/azure/ai/openai/impl/OpenAIClientJavaDocCodeSnippets.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.openai.impl; + +import com.azure.ai.openai.OpenAIClient; +import com.azure.ai.openai.OpenAIClientBuilder; +import com.azure.ai.openai.models.ChatCompletionsOptions; +import com.azure.ai.openai.models.ChatRequestAssistantMessage; +import com.azure.ai.openai.models.ChatRequestMessage; +import com.azure.ai.openai.models.ChatRequestSystemMessage; +import com.azure.ai.openai.models.ChatRequestUserMessage; +import com.azure.ai.openai.models.ChatResponseMessage; +import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.util.Configuration; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.List; + +/** + * Code snippets for {@link OpenAIClient} + */ +public class OpenAIClientJavaDocCodeSnippets { + + private OpenAIClient openAIClient = getOpenAIClient(); + + /** + * Code snippets for {@link OpenAIClient#getChatCompletionsStream(String, ChatCompletionsOptions)} + */ + @Test + public void getChatCompletionsStream() { + String deploymentOrModelId = "gpt-4-1106-preview"; + List chatMessages = new ArrayList<>(); + chatMessages.add(new ChatRequestSystemMessage("You are a helpful assistant. You will talk like a pirate.")); + chatMessages.add(new ChatRequestUserMessage("Can you help me?")); + chatMessages.add(new ChatRequestAssistantMessage("Of course, me hearty! What can I do for ye?")); + chatMessages.add(new ChatRequestUserMessage("What's the best way to train a parrot?")); + + // BEGIN: com.azure.ai.openai.OpenAIClient.getChatCompletionsStream#String-ChatCompletionsOptions + openAIClient.getChatCompletionsStream(deploymentOrModelId, new ChatCompletionsOptions(chatMessages)) + .stream() + // Remove .skip(1) when using Non-Azure OpenAI API + // Note: the first chat completions can be ignored when using Azure OpenAI service which is a known service bug. + // TODO: remove .skip(1) after service fixes the issue. + .skip(1) + .forEach(chatCompletions -> { + ChatResponseMessage delta = chatCompletions.getChoices().get(0).getDelta(); + if (delta.getRole() != null) { + System.out.println("Role = " + delta.getRole()); + } + if (delta.getContent() != null) { + String content = delta.getContent(); + System.out.print(content); + } + }); + // END: com.azure.ai.openai.OpenAIClient.getChatCompletionsStream#String-ChatCompletionsOptions + } + + private OpenAIClient getOpenAIClient() { + return new OpenAIClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("AZURE_OPENAI_ENDPOINT")) + .credential(new AzureKeyCredential(Configuration.getGlobalConfiguration().get("AZURE_OPENAI_KEY"))) + .buildClient(); + } +} From 08f340852170afb6a9e50268f1730f81164c8f4a Mon Sep 17 00:00:00 2001 From: Annie Liang <64233642+xinlian12@users.noreply.github.com> Date: Fri, 8 Mar 2024 15:18:03 -0800 Subject: [PATCH 05/90] add 4.53.3-hotfix changelog (#39142) Co-authored-by: annie-mac --- sdk/cosmos/azure-cosmos/CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sdk/cosmos/azure-cosmos/CHANGELOG.md b/sdk/cosmos/azure-cosmos/CHANGELOG.md index e29083fab1933..b8fe36014940e 100644 --- a/sdk/cosmos/azure-cosmos/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos/CHANGELOG.md @@ -12,6 +12,14 @@ #### Other Changes * Only call System.exit in `DiagnosticsProvider` for `Error` scenario. Also add `System.err` for `Error` cases. - See [PR 39077](https://github.com/Azure/azure-sdk-for-java/pull/39077) +### 4.53.3-hotfix (2024-03-07) + +#### Bugs Fixed +* Suppress exceptions when calling diagnostics handlers. - See [PR 39121](https://github.com/Azure/azure-sdk-for-java/pull/39121) + +#### Other Changes +* Only call System.exit in DiagnosticsProvider for Error scenario. Also add System.err for Error cases. - - See [PR 39121](https://github.com/Azure/azure-sdk-for-java/pull/39121) + ### 4.56.0 (2024-02-20) #### Features Added From 886a986ddd9209a710fc578110ea0ee887d2d44e Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Mon, 11 Mar 2024 11:22:44 -0400 Subject: [PATCH 06/90] Update github-event-processor version (#39153) Co-authored-by: James Suplizio --- .github/workflows/event-processor.yml | 4 ++-- .github/workflows/scheduled-event-processor.yml | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/event-processor.yml b/.github/workflows/event-processor.yml index 66442232c93b3..27c7433294ace 100644 --- a/.github/workflows/event-processor.yml +++ b/.github/workflows/event-processor.yml @@ -58,7 +58,7 @@ jobs: run: > dotnet tool install Azure.Sdk.Tools.GitHubEventProcessor - --version 1.0.0-dev.20240229.2 + --version 1.0.0-dev.20240308.3 --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json --global shell: bash @@ -114,7 +114,7 @@ jobs: run: > dotnet tool install Azure.Sdk.Tools.GitHubEventProcessor - --version 1.0.0-dev.20240229.2 + --version 1.0.0-dev.20240308.3 --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json --global shell: bash diff --git a/.github/workflows/scheduled-event-processor.yml b/.github/workflows/scheduled-event-processor.yml index 361c959bc82d4..0829800a37297 100644 --- a/.github/workflows/scheduled-event-processor.yml +++ b/.github/workflows/scheduled-event-processor.yml @@ -2,6 +2,7 @@ name: GitHub Scheduled Event Processor on: schedule: + # These are generated/confirmed using https://crontab.cronhub.io/ # Close stale issues, runs every day at 1am - CloseStaleIssues - cron: '0 1 * * *' # Identify stale pull requests, every Friday at 5am - IdentifyStalePullRequests @@ -14,9 +15,10 @@ on: - cron: '30 4,10,16,22 * * *' # Lock closed issues, every 6 hours at 05:30 AM, 11:30 AM, 05:30 PM and 11:30 PM - LockClosedIssues - cron: '30 5,11,17,23 * * *' - # Enforce max life of issues, every Monday at 10:00 AM - EnforceMaxLifeOfIssues + # Enforce max life of issues, every M,W,F at 10:00 AM PST - EnforceMaxLifeOfIssues # Note: GitHub uses UTC, to run at 10am PST, the cron task needs to be 6pm (1800 hours) UTC - - cron: '0 18 * * MON' + # When scheduling for multiple days the numeric days 0-6 (0=Sunday) must be used. + - cron: '0 18 * * 1,3,5' # This removes all unnecessary permissions, the ones needed will be set below. # https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token permissions: {} @@ -37,7 +39,7 @@ jobs: run: > dotnet tool install Azure.Sdk.Tools.GitHubEventProcessor - --version 1.0.0-dev.20240229.2 + --version 1.0.0-dev.20240308.3 --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json --global shell: bash @@ -131,7 +133,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Enforce Max Life of Issues Scheduled Event - if: github.event.schedule == '0 18 * * MON' + if: github.event.schedule == '0 18 * * 1,3,5' run: | cat > payload.json << 'EOF' ${{ toJson(github.event) }} From 83e99117d77999b849e5277ab102df1738c78a46 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Mon, 11 Mar 2024 13:51:50 -0400 Subject: [PATCH 07/90] Update GitHubEventProcessor to 20240311.2 (#39156) Co-authored-by: James Suplizio --- .github/workflows/event-processor.yml | 4 ++-- .github/workflows/scheduled-event-processor.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/event-processor.yml b/.github/workflows/event-processor.yml index 27c7433294ace..c913b90cca8ab 100644 --- a/.github/workflows/event-processor.yml +++ b/.github/workflows/event-processor.yml @@ -58,7 +58,7 @@ jobs: run: > dotnet tool install Azure.Sdk.Tools.GitHubEventProcessor - --version 1.0.0-dev.20240308.3 + --version 1.0.0-dev.20240311.2 --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json --global shell: bash @@ -114,7 +114,7 @@ jobs: run: > dotnet tool install Azure.Sdk.Tools.GitHubEventProcessor - --version 1.0.0-dev.20240308.3 + --version 1.0.0-dev.20240311.2 --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json --global shell: bash diff --git a/.github/workflows/scheduled-event-processor.yml b/.github/workflows/scheduled-event-processor.yml index 0829800a37297..120531ac3d5b3 100644 --- a/.github/workflows/scheduled-event-processor.yml +++ b/.github/workflows/scheduled-event-processor.yml @@ -39,7 +39,7 @@ jobs: run: > dotnet tool install Azure.Sdk.Tools.GitHubEventProcessor - --version 1.0.0-dev.20240308.3 + --version 1.0.0-dev.20240311.2 --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json --global shell: bash From 7dc175d4e633d5e417820196a3bd7e634e8fddb2 Mon Sep 17 00:00:00 2001 From: Jesse Squire Date: Mon, 11 Mar 2024 11:32:47 -0700 Subject: [PATCH 08/90] [CODEOWNERS] Fix duplicate entries for messaging (#39155) The focus of these changes is to fix service label duplication that would cause inappropriate matches for the messaging services. ### Important context: - The `Service Attention` label is ignored during match logic. - Service label matches follow the same rules as paths for pull requests. This means that ordering of rules is important; scanning starts at the bottom of the file and progresses towards the top. Once the first match is found, it is used and scanning stops. This means that the `//` section at the bottom of this file will be the first matches found for most service tags, causing automated triage to consider these tags to be service-owned and assigned. --- .github/CODEOWNERS | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 90c9f92f47fe6..d25b5d5f1826c 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -122,12 +122,16 @@ /sdk/modelsrepository/ @drwill-ms @timtay-microsoft @abhipsaMisra @digimaun @andyk-ms @brycewang-microsoft @tmahmood-microsoft @ngastelum-ms # AzureSdkOwners: @billwert +# ServiceOwners: @jfggdl # ServiceLabel: %Event Grid + # PRLabel: %Event Grid /sdk/eventgrid/ @billwert @mssfang @srnagar @lmolkova # AzureSdkOwners: @conniey @anuchandy @lmolkova +# ServiceOwners: @serkantkaraca @sjkwak # ServiceLabel: %Event Hubs + # PRLabel: %Event Hubs /sdk/eventhubs/ @conniey @anuchandy @lmolkova @@ -196,9 +200,11 @@ /sdk/remoterendering/ @MichaelZp0 @ChristopherManthei # AzureSdkOwners: @conniey +# ServiceOwners: @hmlam # ServiceLabel: %Schema Registry + # PRLabel: %Schema Registry -/sdk/schemaregistry/ @conniey @sjkwak @srnagar +/sdk/schemaregistry/ @conniey @srnagar # AzureSdkOwners: @alzimmermsft @jairmyree # ServiceLabel: %Search @@ -211,11 +217,13 @@ /sdk/serialization/ @alzimmermsft @srnagar # AzureSdkOwners: @anuchandy +# ServiceOwners: @EldertGrootenboer # ServiceLabel: %Service Bus + # PRLabel: %Service Bus /sdk/servicebus/ @anuchandy @conniey @lmolkova -# ServiceLabel: %Service Bus %Service Attention %Track 1 +# ServiceLabel: %Service Bus %Track 1 # PRLabel: %Service Bus /sdk/servicebus/microsoft-azure-servicebus/ @shankarsama @yvgopal @@ -533,12 +541,6 @@ # ServiceLabel: %Digital Twins %Service Attention #// @@drwill-ms @@timtay-microsoft @@abhipsaMisra @@vinagesh @@azabbasi @@barustum @@jamdavi -# ServiceLabel: %Event Grid %Service Attention -#// @jfggdl - -# ServiceLabel: %Event Hubs %Service Attention -#// @kasun04 - # ServiceLabel: %Functions %Service Attention #// @ahmedelnably @fabiocav @@ -701,15 +703,9 @@ # ServiceLabel: %Security %Service Attention #// @chlahav -# ServiceLabel: %Service Attention %Service Bus -#// @EldertGrootenboer - # ServiceLabel: %Service Attention %Service Fabric #// @QingChenmsft @vaishnavk @juhacket -# ServiceLabel: %Schema Registry %Service Attention -#// @arerlend @alzimmermsft - # ServiceLabel: %Service Attention %SignalR #// @sffamily @chenkennt From b283386c087f28d4a1510da85da1816e2f7e7691 Mon Sep 17 00:00:00 2001 From: Jair Myree Date: Mon, 11 Mar 2024 11:38:18 -0700 Subject: [PATCH 09/90] Search March 2024 Preview (#38998) * March Preview Regen * Regenerating swagger * Adding `stored` SearchField annotation to FieldBuilder * Include suppression files * Updating Service Version Preview and test re-recordings * Adding Support for Int16 and SByte * Updating FieldBuilderTests and re-recording tests * re-recording tests * re-recording tests * re-recording tests and fixing test failure * re-recording tests * updating code coverage requirements --- sdk/search/azure-search-documents/assets.json | 2 +- sdk/search/azure-search-documents/pom.xml | 2 +- .../spotbugs-exclude.xml | 8 +- .../documents/SearchServiceVersion.java | 6 +- .../implementation/DocumentsImpl.java | 98 ++++----- .../models/ErrorAdditionalInfo.java | 88 ++++++++ .../implementation/models/ErrorDetail.java | 140 +++++++++++++ .../implementation/models/ErrorResponse.java | 87 ++++++++ .../models/ErrorResponseException.java | 44 ++++ .../implementation/util/FieldBuilder.java | 13 +- .../documents/indexes/SearchableField.java | 8 + .../search/documents/indexes/SimpleField.java | 7 + .../indexes/implementation/AliasesImpl.java | 86 ++++---- .../implementation/DataSourcesImpl.java | 82 ++++---- .../indexes/implementation/IndexersImpl.java | 146 +++++++------- .../indexes/implementation/IndexesImpl.java | 118 +++++------ .../SearchServiceClientImpl.java | 18 +- .../indexes/implementation/SkillsetsImpl.java | 98 ++++----- .../implementation/SynonymMapsImpl.java | 82 ++++---- .../models/ErrorAdditionalInfo.java | 88 ++++++++ .../implementation/models/ErrorDetail.java | 140 +++++++++++++ .../implementation/models/ErrorResponse.java | 87 ++++++++ .../models/ErrorResponseException.java | 44 ++++ ...rQuantizationCompressionConfiguration.java | 141 +++++++++++++ .../models/ScalarQuantizationParameters.java | 87 ++++++++ .../models/CustomWebApiParameters.java | 32 +-- .../documents/indexes/models/SearchField.java | 48 +++++ .../indexes/models/SearchFieldDataType.java | 16 ++ .../models/SearchResourceEncryptionKey.java | 24 +-- .../indexes/models/VectorSearch.java | 32 +++ .../VectorSearchCompressionConfiguration.java | 188 ++++++++++++++++++ .../models/VectorSearchCompressionKind.java | 50 +++++ ...VectorSearchCompressionTargetDataType.java | 49 +++++ .../indexes/models/VectorSearchProfile.java | 32 +++ .../documents/indexes/models/WebApiSkill.java | 40 ++-- .../search/documents/models/VectorQuery.java | 34 ++++ .../models/VectorizableTextQuery.java | 14 ++ .../documents/models/VectorizedQuery.java | 14 ++ .../search/documents/VectorSearchTests.java | 2 + .../documents/indexes/FieldBuilderTests.java | 40 +++- .../azure-search-documents/swagger/README.md | 8 +- .../main/java/SearchIndexCustomizations.java | 2 +- .../java/SearchServiceCustomizations.java | 2 +- 43 files changed, 1905 insertions(+), 442 deletions(-) create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ErrorAdditionalInfo.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ErrorDetail.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ErrorResponse.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ErrorResponseException.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/models/ErrorAdditionalInfo.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/models/ErrorDetail.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/models/ErrorResponse.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/models/ErrorResponseException.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/models/ScalarQuantizationCompressionConfiguration.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/models/ScalarQuantizationParameters.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchCompressionConfiguration.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchCompressionKind.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchCompressionTargetDataType.java diff --git a/sdk/search/azure-search-documents/assets.json b/sdk/search/azure-search-documents/assets.json index 9ffc44946d929..4626025686cc7 100644 --- a/sdk/search/azure-search-documents/assets.json +++ b/sdk/search/azure-search-documents/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/search/azure-search-documents", - "Tag": "java/search/azure-search-documents_134672a8ec" + "Tag": "java/search/azure-search-documents_68da41c6ed" } diff --git a/sdk/search/azure-search-documents/pom.xml b/sdk/search/azure-search-documents/pom.xml index a89b4ea82bc8a..2e6c2fa5460d1 100644 --- a/sdk/search/azure-search-documents/pom.xml +++ b/sdk/search/azure-search-documents/pom.xml @@ -24,7 +24,7 @@ UTF-8 - 0.59 + 0.56 0.47 diff --git a/sdk/search/azure-search-documents/spotbugs-exclude.xml b/sdk/search/azure-search-documents/spotbugs-exclude.xml index 4cba0c88e87ed..7a714099e3579 100644 --- a/sdk/search/azure-search-documents/spotbugs-exclude.xml +++ b/sdk/search/azure-search-documents/spotbugs-exclude.xml @@ -21,6 +21,7 @@ + @@ -36,6 +37,7 @@ + @@ -130,8 +132,8 @@ - + @@ -243,10 +245,6 @@ - - - - diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchServiceVersion.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchServiceVersion.java index 9fe4e4fd6daa4..223f96b9cba87 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchServiceVersion.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchServiceVersion.java @@ -20,9 +20,9 @@ public enum SearchServiceVersion implements ServiceVersion { V2023_11_01("2023-11-01"), /** - * {@code 2023-10-01-preview} service version. + * {@code 2024-03-01-preview} service version. */ - V2023_10_01_PREVIEW("2023-10-01-preview"); + V2024_03_01_PREVIEW("2024-03-01-preview"); private final String version; @@ -44,6 +44,6 @@ public String getVersion() { * @return The latest version supported by this client library. */ public static SearchServiceVersion getLatest() { - return V2023_10_01_PREVIEW; + return V2024_03_01_PREVIEW; } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/DocumentsImpl.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/DocumentsImpl.java index 874857c19a694..5c09e8cf9b731 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/DocumentsImpl.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/DocumentsImpl.java @@ -23,10 +23,10 @@ import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.search.documents.implementation.models.AutocompleteRequest; +import com.azure.search.documents.implementation.models.ErrorResponseException; import com.azure.search.documents.implementation.models.IndexBatch; import com.azure.search.documents.implementation.models.RequestOptions; import com.azure.search.documents.implementation.models.SearchDocumentsResult; -import com.azure.search.documents.implementation.models.SearchErrorException; import com.azure.search.documents.implementation.models.SearchRequest; import com.azure.search.documents.implementation.models.SuggestDocumentsResult; import com.azure.search.documents.implementation.models.SuggestRequest; @@ -75,21 +75,21 @@ public interface DocumentsService { @Get("/docs/$count") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> count(@HostParam("endpoint") String endpoint, @HostParam("indexName") String indexName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Get("/docs/$count") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response countSync(@HostParam("endpoint") String endpoint, @HostParam("indexName") String indexName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Post("/docs/search.post.search") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> searchPost(@HostParam("endpoint") String endpoint, @HostParam("indexName") String indexName, @QueryParam("api-version") String apiVersion, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("Accept") String accept, @@ -97,7 +97,7 @@ Mono> searchPost(@HostParam("endpoint") String e @Post("/docs/search.post.search") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response searchPostSync(@HostParam("endpoint") String endpoint, @HostParam("indexName") String indexName, @QueryParam("api-version") String apiVersion, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("Accept") String accept, @@ -105,7 +105,7 @@ Response searchPostSync(@HostParam("endpoint") String end @Get("/docs('{key}')") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono>> get(@HostParam("endpoint") String endpoint, @HostParam("indexName") String indexName, @PathParam("key") String key, @QueryParam("$select") String selectedFields, @QueryParam("api-version") String apiVersion, @@ -114,7 +114,7 @@ Mono>> get(@HostParam("endpoint") String endpoint, @Get("/docs('{key}')") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response> getSync(@HostParam("endpoint") String endpoint, @HostParam("indexName") String indexName, @PathParam("key") String key, @QueryParam("$select") String selectedFields, @QueryParam("api-version") String apiVersion, @@ -123,7 +123,7 @@ Response> getSync(@HostParam("endpoint") String endpoint, @Post("/docs/search.post.suggest") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> suggestPost(@HostParam("endpoint") String endpoint, @HostParam("indexName") String indexName, @QueryParam("api-version") String apiVersion, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("Accept") String accept, @@ -131,7 +131,7 @@ Mono> suggestPost(@HostParam("endpoint") String @Post("/docs/search.post.suggest") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response suggestPostSync(@HostParam("endpoint") String endpoint, @HostParam("indexName") String indexName, @QueryParam("api-version") String apiVersion, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("Accept") String accept, @@ -139,7 +139,7 @@ Response suggestPostSync(@HostParam("endpoint") String e @Post("/docs/search.index") @ExpectedResponses({ 200, 207 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> index(@HostParam("endpoint") String endpoint, @HostParam("indexName") String indexName, @QueryParam("api-version") String apiVersion, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("Accept") String accept, @@ -147,7 +147,7 @@ Mono> index(@HostParam("endpoint") String endpoin @Post("/docs/search.index") @ExpectedResponses({ 200, 207 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response indexSync(@HostParam("endpoint") String endpoint, @HostParam("indexName") String indexName, @QueryParam("api-version") String apiVersion, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("Accept") String accept, @@ -155,7 +155,7 @@ Response indexSync(@HostParam("endpoint") String endpoint, @Post("/docs/search.post.autocomplete") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> autocompletePost(@HostParam("endpoint") String endpoint, @HostParam("indexName") String indexName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -163,7 +163,7 @@ Mono> autocompletePost(@HostParam("endpoint") Strin @Post("/docs/search.post.autocomplete") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response autocompletePostSync(@HostParam("endpoint") String endpoint, @HostParam("indexName") String indexName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -175,7 +175,7 @@ Response autocompletePostSync(@HostParam("endpoint") String * * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown 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}. */ @@ -197,7 +197,7 @@ public Mono> countWithResponseAsync(RequestOptions requestOptions * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown 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}. */ @@ -218,7 +218,7 @@ public Mono> countWithResponseAsync(RequestOptions requestOptions * * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown 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}. */ @@ -233,7 +233,7 @@ public Mono countAsync(RequestOptions requestOptions) { * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown 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}. */ @@ -248,7 +248,7 @@ public Mono countAsync(RequestOptions requestOptions, Context context) { * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown 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}. */ @@ -269,7 +269,7 @@ public Response countWithResponse(RequestOptions requestOptions, Context c * * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ @@ -284,7 +284,7 @@ public long count(RequestOptions requestOptions) { * @param searchRequest The definition of the Search request. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response containing search results from an index along with {@link Response} on successful completion of * {@link Mono}. @@ -309,7 +309,7 @@ public Mono> searchPostWithResponseAsync(SearchR * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response containing search results from an index along with {@link Response} on successful completion of * {@link Mono}. @@ -333,7 +333,7 @@ public Mono> searchPostWithResponseAsync(SearchR * @param searchRequest The definition of the Search request. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response containing search results from an index on successful completion of {@link Mono}. */ @@ -350,7 +350,7 @@ public Mono searchPostAsync(SearchRequest searchRequest, * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response containing search results from an index on successful completion of {@link Mono}. */ @@ -368,7 +368,7 @@ public Mono searchPostAsync(SearchRequest searchRequest, * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response containing search results from an index along with {@link Response}. */ @@ -391,7 +391,7 @@ public Response searchPostWithResponse(SearchRequest sear * @param searchRequest The definition of the Search request. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response containing search results from an index. */ @@ -408,7 +408,7 @@ public SearchDocumentsResult searchPost(SearchRequest searchRequest, RequestOpti * from the returned document. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a document retrieved via a document lookup operation along with {@link Response} on successful completion * of {@link Mono}. @@ -437,7 +437,7 @@ public Mono>> getWithResponseAsync(String key, List * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a document retrieved via a document lookup operation along with {@link Response} on successful completion * of {@link Mono}. @@ -465,7 +465,7 @@ public Mono>> getWithResponseAsync(String key, List * from the returned document. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a document retrieved via a document lookup operation on successful completion of {@link Mono}. */ @@ -484,7 +484,7 @@ public Mono> getAsync(String key, List selectedField * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a document retrieved via a document lookup operation on successful completion of {@link Mono}. */ @@ -504,7 +504,7 @@ public Mono> getAsync(String key, List selectedField * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a document retrieved via a document lookup operation along with {@link Response}. */ @@ -531,7 +531,7 @@ public Response> getWithResponse(String key, List se * from the returned document. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a document retrieved via a document lookup operation. */ @@ -546,7 +546,7 @@ public Map get(String key, List selectedFields, RequestO * @param suggestRequest The Suggest request. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response containing suggestion query results from an index along with {@link Response} on successful * completion of {@link Mono}. @@ -572,7 +572,7 @@ public Mono> suggestPostWithResponseAsync(Sugge * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response containing suggestion query results from an index along with {@link Response} on successful * completion of {@link Mono}. @@ -596,7 +596,7 @@ public Mono> suggestPostWithResponseAsync(Sugge * @param suggestRequest The Suggest request. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response containing suggestion query results from an index on successful completion of {@link Mono}. */ @@ -613,7 +613,7 @@ public Mono suggestPostAsync(SuggestRequest suggestReque * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response containing suggestion query results from an index on successful completion of {@link Mono}. */ @@ -631,7 +631,7 @@ public Mono suggestPostAsync(SuggestRequest suggestReque * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response containing suggestion query results from an index along with {@link Response}. */ @@ -654,7 +654,7 @@ public Response suggestPostWithResponse(SuggestRequest s * @param suggestRequest The Suggest request. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response containing suggestion query results from an index. */ @@ -669,7 +669,7 @@ public SuggestDocumentsResult suggestPost(SuggestRequest suggestRequest, Request * @param batch The batch of index actions. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response containing the status of operations for all documents in the indexing request along with * {@link Response} on successful completion of {@link Mono}. @@ -694,7 +694,7 @@ public Mono> indexWithResponseAsync(IndexBatch ba * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response containing the status of operations for all documents in the indexing request along with * {@link Response} on successful completion of {@link Mono}. @@ -718,7 +718,7 @@ public Mono> indexWithResponseAsync(IndexBatch ba * @param batch The batch of index actions. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response containing the status of operations for all documents in the indexing request on successful * completion of {@link Mono}. @@ -735,7 +735,7 @@ public Mono indexAsync(IndexBatch batch, RequestOptions re * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response containing the status of operations for all documents in the indexing request on successful * completion of {@link Mono}. @@ -752,7 +752,7 @@ public Mono indexAsync(IndexBatch batch, RequestOptions re * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response containing the status of operations for all documents in the indexing request along with * {@link Response}. @@ -776,7 +776,7 @@ public Response indexWithResponse(IndexBatch batch, Reques * @param batch The batch of index actions. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response containing the status of operations for all documents in the indexing request. */ @@ -791,7 +791,7 @@ public IndexDocumentsResult index(IndexBatch batch, RequestOptions requestOption * @param autocompleteRequest The definition of the Autocomplete request. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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 Autocomplete query along with {@link Response} on successful completion of {@link Mono}. */ @@ -816,7 +816,7 @@ public Mono> autocompletePostWithResponseAsync(Auto * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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 Autocomplete query along with {@link Response} on successful completion of {@link Mono}. */ @@ -839,7 +839,7 @@ public Mono> autocompletePostWithResponseAsync(Auto * @param autocompleteRequest The definition of the Autocomplete request. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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 Autocomplete query on successful completion of {@link Mono}. */ @@ -857,7 +857,7 @@ public Mono autocompletePostAsync(AutocompleteRequest autoco * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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 Autocomplete query on successful completion of {@link Mono}. */ @@ -875,7 +875,7 @@ public Mono autocompletePostAsync(AutocompleteRequest autoco * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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 Autocomplete query along with {@link Response}. */ @@ -898,7 +898,7 @@ public Response autocompletePostWithResponse(AutocompleteReq * @param autocompleteRequest The definition of the Autocomplete request. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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 Autocomplete query. */ diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ErrorAdditionalInfo.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ErrorAdditionalInfo.java new file mode 100644 index 0000000000000..0dd66904dadfd --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ErrorAdditionalInfo.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package com.azure.search.documents.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 java.io.IOException; + +/** + * The resource management error additional info. + */ +@Immutable +public final class ErrorAdditionalInfo implements JsonSerializable { + /* + * The additional info type. + */ + private String type; + + /* + * The additional info. + */ + private Object info; + + /** + * Creates an instance of ErrorAdditionalInfo class. + */ + public ErrorAdditionalInfo() { + } + + /** + * Get the type property: The additional info type. + * + * @return the type value. + */ + public String getType() { + return this.type; + } + + /** + * Get the info property: The additional info. + * + * @return the info value. + */ + public Object getInfo() { + return this.info; + } + + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ErrorAdditionalInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ErrorAdditionalInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ErrorAdditionalInfo. + */ + public static ErrorAdditionalInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ErrorAdditionalInfo deserializedErrorAdditionalInfo = new ErrorAdditionalInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedErrorAdditionalInfo.type = reader.getString(); + } else if ("info".equals(fieldName)) { + deserializedErrorAdditionalInfo.info = reader.readUntyped(); + } else { + reader.skipChildren(); + } + } + + return deserializedErrorAdditionalInfo; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ErrorDetail.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ErrorDetail.java new file mode 100644 index 0000000000000..988a092e38849 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ErrorDetail.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package com.azure.search.documents.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 java.io.IOException; +import java.util.List; + +/** + * The error detail. + */ +@Immutable +public final class ErrorDetail implements JsonSerializable { + /* + * The error code. + */ + private String code; + + /* + * The error message. + */ + private String message; + + /* + * The error target. + */ + private String target; + + /* + * The error details. + */ + private List details; + + /* + * The error additional info. + */ + private List additionalInfo; + + /** + * Creates an instance of ErrorDetail class. + */ + public ErrorDetail() { + } + + /** + * Get the code property: The error code. + * + * @return the code value. + */ + public String getCode() { + return this.code; + } + + /** + * Get the message property: The error message. + * + * @return the message value. + */ + public String getMessage() { + return this.message; + } + + /** + * Get the target property: The error target. + * + * @return the target value. + */ + public String getTarget() { + return this.target; + } + + /** + * Get the details property: The error details. + * + * @return the details value. + */ + public List getDetails() { + return this.details; + } + + /** + * Get the additionalInfo property: The error additional info. + * + * @return the additionalInfo value. + */ + public List getAdditionalInfo() { + return this.additionalInfo; + } + + @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 ("target".equals(fieldName)) { + deserializedErrorDetail.target = reader.getString(); + } else if ("details".equals(fieldName)) { + List details = reader.readArray(reader1 -> ErrorDetail.fromJson(reader1)); + deserializedErrorDetail.details = details; + } else if ("additionalInfo".equals(fieldName)) { + List additionalInfo + = reader.readArray(reader1 -> ErrorAdditionalInfo.fromJson(reader1)); + deserializedErrorDetail.additionalInfo = additionalInfo; + } else { + reader.skipChildren(); + } + } + + return deserializedErrorDetail; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ErrorResponse.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ErrorResponse.java new file mode 100644 index 0000000000000..b4efd478f1ec3 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ErrorResponse.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.annotation.Fluent; +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 response + * + * Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also + * follows the OData error response format.). + */ +@Fluent +public final class ErrorResponse implements JsonSerializable { + /* + * The error object. + */ + private ErrorDetail error; + + /** + * Creates an instance of ErrorResponse class. + */ + public ErrorResponse() { + } + + /** + * Get the error property: The error object. + * + * @return the error value. + */ + public ErrorDetail getError() { + return this.error; + } + + /** + * Set the error property: The error object. + * + * @param error the error value to set. + * @return the ErrorResponse object itself. + */ + public ErrorResponse setError(ErrorDetail error) { + this.error = error; + return this; + } + + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("error", this.error); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ErrorResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ErrorResponse if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ErrorResponse. + */ + public static ErrorResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ErrorResponse deserializedErrorResponse = new ErrorResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("error".equals(fieldName)) { + deserializedErrorResponse.error = ErrorDetail.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedErrorResponse; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ErrorResponseException.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ErrorResponseException.java new file mode 100644 index 0000000000000..82ec56074f723 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/ErrorResponseException.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package com.azure.search.documents.implementation.models; + +import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.HttpResponse; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public final class ErrorResponseException extends HttpResponseException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available. + * @param response the HTTP response. + */ + public ErrorResponseException(String message, HttpResponse response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException 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 ErrorResponseException(String message, HttpResponse response, ErrorResponse value) { + super(message, response, value); + } + + /** + * {@inheritDoc} + */ + @Override + public ErrorResponse getValue() { + return (ErrorResponse) super.getValue(); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/FieldBuilder.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/FieldBuilder.java index ddef45c2622e6..62040f0d53c96 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/FieldBuilder.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/FieldBuilder.java @@ -78,10 +78,10 @@ public final class FieldBuilder { SUPPORTED_NONE_PARAMETERIZED_TYPE.put(GeoPoint.class, SearchFieldDataType.GEOGRAPHY_POINT); SUPPORTED_NONE_PARAMETERIZED_TYPE.put(Float.class, SearchFieldDataType.SINGLE); SUPPORTED_NONE_PARAMETERIZED_TYPE.put(float.class, SearchFieldDataType.SINGLE); - UNSUPPORTED_TYPES.add(byte.class); - UNSUPPORTED_TYPES.add(Byte.class); - UNSUPPORTED_TYPES.add(short.class); - UNSUPPORTED_TYPES.add(Short.class); + SUPPORTED_NONE_PARAMETERIZED_TYPE.put(byte.class, SearchFieldDataType.SBYTE); + SUPPORTED_NONE_PARAMETERIZED_TYPE.put(Byte.class, SearchFieldDataType.SBYTE); + SUPPORTED_NONE_PARAMETERIZED_TYPE.put(short.class, SearchFieldDataType.INT16); + SUPPORTED_NONE_PARAMETERIZED_TYPE.put(Short.class, SearchFieldDataType.INT16); } /** @@ -270,7 +270,7 @@ private static SearchField enrichWithAnnotation(SearchField searchField, Member return searchField; } - boolean key, hidden, filterable, sortable, facetable; + boolean key, hidden, filterable, sortable, facetable, stored; boolean searchable = searchableField != null; String analyzerName = null; String searchAnalyzerName = null; @@ -283,6 +283,7 @@ private static SearchField enrichWithAnnotation(SearchField searchField, Member if (simpleField != null) { key = simpleField.isKey(); hidden = simpleField.isHidden(); + stored = simpleField.isStored(); filterable = simpleField.isFilterable(); sortable = simpleField.isSortable(); facetable = simpleField.isFacetable(); @@ -290,6 +291,7 @@ private static SearchField enrichWithAnnotation(SearchField searchField, Member } else { key = searchableField.isKey(); hidden = searchableField.isHidden(); + stored = searchableField.isStored(); filterable = searchableField.isFilterable(); sortable = searchableField.isSortable(); facetable = searchableField.isFacetable(); @@ -354,6 +356,7 @@ private static SearchField enrichWithAnnotation(SearchField searchField, Member .setFilterable(filterable) .setSortable(sortable) .setFacetable(facetable) + .setStored(stored) .setVectorSearchDimensions(vectorSearchDimensions) .setVectorSearchProfileName(vectorSearchProfileName); diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchableField.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchableField.java index b163b112686b8..5b6c7ce6b7f1b 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchableField.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchableField.java @@ -49,6 +49,13 @@ */ boolean isSortable() default false; + /** + * Indicates if whether the field will be persisted separately on disk to be returned in a search result. + * + * @return A flag indicating if the field or method should generate as a stored {@link SearchField field}. + */ + boolean isStored() default true; + /** * Indicates if the field or method should generate as a filterable {@link SearchField field}. * @@ -118,4 +125,5 @@ * {@link SearchField field}. */ String vectorSearchProfileName() default ""; + } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SimpleField.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SimpleField.java index aa2f43edf7f0c..6464d03d74155 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SimpleField.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SimpleField.java @@ -47,6 +47,13 @@ */ boolean isSortable() default false; + /** + * Indicates if whether the field will be persisted separately on disk to be returned in a search result. + * + * @return A flag indicating if the field or method should generate as a stored {@link SearchField field}. + */ + boolean isStored() default true; + /** * Indicates if the field or method should generate as a filterable {@link SearchField field}. * diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/AliasesImpl.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/AliasesImpl.java index 3352b4fd93c6a..3289bb43155b8 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/AliasesImpl.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/AliasesImpl.java @@ -29,9 +29,9 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.search.documents.indexes.implementation.models.ErrorResponseException; import com.azure.search.documents.indexes.implementation.models.ListAliasesResult; import com.azure.search.documents.indexes.implementation.models.RequestOptions; -import com.azure.search.documents.indexes.implementation.models.SearchErrorException; import com.azure.search.documents.indexes.models.SearchAlias; import java.util.UUID; import reactor.core.publisher.Mono; @@ -69,7 +69,7 @@ public final class AliasesImpl { public interface AliasesService { @Post("/aliases") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> create(@HostParam("endpoint") String endpoint, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -77,7 +77,7 @@ Mono> create(@HostParam("endpoint") String endpoint, @Post("/aliases") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response createSync(@HostParam("endpoint") String endpoint, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -85,21 +85,21 @@ Response createSync(@HostParam("endpoint") String endpoint, @Get("/aliases") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> list(@HostParam("endpoint") String endpoint, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Get("/aliases") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response listSync(@HostParam("endpoint") String endpoint, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Put("/aliases('{aliasName}')") @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> createOrUpdate(@HostParam("endpoint") String endpoint, @PathParam("aliasName") String aliasName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @@ -108,7 +108,7 @@ Mono> createOrUpdate(@HostParam("endpoint") String endpoin @Put("/aliases('{aliasName}')") @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response createOrUpdateSync(@HostParam("endpoint") String endpoint, @PathParam("aliasName") String aliasName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @@ -117,7 +117,7 @@ Response createOrUpdateSync(@HostParam("endpoint") String endpoint, @Delete("/aliases('{aliasName}')") @ExpectedResponses({ 204, 404 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("aliasName") String aliasName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @QueryParam("api-version") String apiVersion, @@ -125,7 +125,7 @@ Mono> delete(@HostParam("endpoint") String endpoint, @PathParam(" @Delete("/aliases('{aliasName}')") @ExpectedResponses({ 204, 404 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response deleteSync(@HostParam("endpoint") String endpoint, @PathParam("aliasName") String aliasName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @QueryParam("api-version") String apiVersion, @@ -133,14 +133,14 @@ Response deleteSync(@HostParam("endpoint") String endpoint, @PathParam("al @Get("/aliases('{aliasName}')") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> get(@HostParam("endpoint") String endpoint, @PathParam("aliasName") String aliasName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Get("/aliases('{aliasName}')") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response getSync(@HostParam("endpoint") String endpoint, @PathParam("aliasName") String aliasName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -152,7 +152,7 @@ Response getSync(@HostParam("endpoint") String endpoint, @PathParam * @param alias The definition of the alias to create. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an index alias, which describes a mapping from the alias name to an index along with * {@link Response} on successful completion of {@link Mono}. @@ -176,7 +176,7 @@ public Mono> createWithResponseAsync(SearchAlias alias, Re * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an index alias, which describes a mapping from the alias name to an index along with * {@link Response} on successful completion of {@link Mono}. @@ -200,7 +200,7 @@ public Mono> createWithResponseAsync(SearchAlias alias, Re * @param alias The definition of the alias to create. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an index alias, which describes a mapping from the alias name to an index on successful * completion of {@link Mono}. @@ -217,7 +217,7 @@ public Mono createAsync(SearchAlias alias, RequestOptions requestOp * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an index alias, which describes a mapping from the alias name to an index on successful * completion of {@link Mono}. @@ -234,7 +234,7 @@ public Mono createAsync(SearchAlias alias, RequestOptions requestOp * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an index alias, which describes a mapping from the alias name to an index along with * {@link Response}. @@ -257,7 +257,7 @@ public Response createWithResponse(SearchAlias alias, RequestOption * @param alias The definition of the alias to create. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an index alias, which describes a mapping from the alias name to an index. */ @@ -271,7 +271,7 @@ public SearchAlias create(SearchAlias alias, RequestOptions requestOptions) { * * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List Aliases request along with {@link PagedResponse} on successful completion of * {@link Mono}. @@ -297,7 +297,7 @@ public Mono> listSinglePageAsync(RequestOptions reque * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List Aliases request along with {@link PagedResponse} on successful completion of * {@link Mono}. @@ -320,7 +320,7 @@ public Mono> listSinglePageAsync(RequestOptions reque * * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List Aliases request as paginated response with {@link PagedFlux}. */ @@ -335,7 +335,7 @@ public PagedFlux listAsync(RequestOptions requestOptions) { * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List Aliases request as paginated response with {@link PagedFlux}. */ @@ -349,7 +349,7 @@ public PagedFlux listAsync(RequestOptions requestOptions, Context c * * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List Aliases request along with {@link PagedResponse}. */ @@ -373,7 +373,7 @@ public PagedResponse listSinglePage(RequestOptions requestOptions) * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List Aliases request along with {@link PagedResponse}. */ @@ -396,7 +396,7 @@ public PagedResponse listSinglePage(RequestOptions requestOptions, * * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List Aliases request as paginated response with {@link PagedIterable}. */ @@ -411,7 +411,7 @@ public PagedIterable list(RequestOptions requestOptions) { * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List Aliases request as paginated response with {@link PagedIterable}. */ @@ -431,7 +431,7 @@ public PagedIterable list(RequestOptions requestOptions, Context co * server does not match this value. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an index alias, which describes a mapping from the alias name to an index along with * {@link Response} on successful completion of {@link Mono}. @@ -462,7 +462,7 @@ public Mono> createOrUpdateWithResponseAsync(String aliasN * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an index alias, which describes a mapping from the alias name to an index along with * {@link Response} on successful completion of {@link Mono}. @@ -492,7 +492,7 @@ public Mono> createOrUpdateWithResponseAsync(String aliasN * server does not match this value. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an index alias, which describes a mapping from the alias name to an index on successful * completion of {@link Mono}. @@ -516,7 +516,7 @@ public Mono createOrUpdateAsync(String aliasName, SearchAlias alias * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an index alias, which describes a mapping from the alias name to an index on successful * completion of {@link Mono}. @@ -540,7 +540,7 @@ public Mono createOrUpdateAsync(String aliasName, SearchAlias alias * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an index alias, which describes a mapping from the alias name to an index along with * {@link Response}. @@ -570,7 +570,7 @@ public Response createOrUpdateWithResponse(String aliasName, Search * server does not match this value. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an index alias, which describes a mapping from the alias name to an index. */ @@ -592,7 +592,7 @@ public SearchAlias createOrUpdate(String aliasName, SearchAlias alias, String if * server does not match this value. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if 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}. */ @@ -621,7 +621,7 @@ public Mono> deleteWithResponseAsync(String aliasName, String ifM * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if 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}. */ @@ -649,7 +649,7 @@ public Mono> deleteWithResponseAsync(String aliasName, String ifM * server does not match this value. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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. */ @@ -671,7 +671,7 @@ public Mono deleteAsync(String aliasName, String ifMatch, String ifNoneMat * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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. */ @@ -694,7 +694,7 @@ public Mono deleteAsync(String aliasName, String ifMatch, String ifNoneMat * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @@ -722,7 +722,7 @@ public Response deleteWithResponse(String aliasName, String ifMatch, Strin * server does not match this value. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -736,7 +736,7 @@ public void delete(String aliasName, String ifMatch, String ifNoneMatch, Request * @param aliasName The name of the alias to retrieve. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an index alias, which describes a mapping from the alias name to an index along with * {@link Response} on successful completion of {@link Mono}. @@ -760,7 +760,7 @@ public Mono> getWithResponseAsync(String aliasName, Reques * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an index alias, which describes a mapping from the alias name to an index along with * {@link Response} on successful completion of {@link Mono}. @@ -784,7 +784,7 @@ public Mono> getWithResponseAsync(String aliasName, Reques * @param aliasName The name of the alias to retrieve. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an index alias, which describes a mapping from the alias name to an index on successful * completion of {@link Mono}. @@ -801,7 +801,7 @@ public Mono getAsync(String aliasName, RequestOptions requestOption * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an index alias, which describes a mapping from the alias name to an index on successful * completion of {@link Mono}. @@ -819,7 +819,7 @@ public Mono getAsync(String aliasName, RequestOptions requestOption * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an index alias, which describes a mapping from the alias name to an index along with * {@link Response}. @@ -842,7 +842,7 @@ public Response getWithResponse(String aliasName, RequestOptions re * @param aliasName The name of the alias to retrieve. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an index alias, which describes a mapping from the alias name to an index. */ diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/DataSourcesImpl.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/DataSourcesImpl.java index a2b5fac53fb51..a15d54c173f08 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/DataSourcesImpl.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/DataSourcesImpl.java @@ -25,9 +25,9 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.search.documents.indexes.implementation.models.ErrorResponseException; import com.azure.search.documents.indexes.implementation.models.ListDataSourcesResult; import com.azure.search.documents.indexes.implementation.models.RequestOptions; -import com.azure.search.documents.indexes.implementation.models.SearchErrorException; import com.azure.search.documents.indexes.models.SearchIndexerDataSourceConnection; import java.util.UUID; import reactor.core.publisher.Mono; @@ -66,7 +66,7 @@ public final class DataSourcesImpl { public interface DataSourcesService { @Put("/datasources('{dataSourceName}')") @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> createOrUpdate(@HostParam("endpoint") String endpoint, @PathParam("dataSourceName") String dataSourceName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("If-Match") String ifMatch, @@ -78,7 +78,7 @@ Mono> createOrUpdate(@HostParam("end @Put("/datasources('{dataSourceName}')") @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response createOrUpdateSync(@HostParam("endpoint") String endpoint, @PathParam("dataSourceName") String dataSourceName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("If-Match") String ifMatch, @@ -90,7 +90,7 @@ Response createOrUpdateSync(@HostParam("endpo @Delete("/datasources('{dataSourceName}')") @ExpectedResponses({ 204, 404 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("dataSourceName") String dataSourceName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("If-Match") String ifMatch, @@ -99,7 +99,7 @@ Mono> delete(@HostParam("endpoint") String endpoint, @Delete("/datasources('{dataSourceName}')") @ExpectedResponses({ 204, 404 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response deleteSync(@HostParam("endpoint") String endpoint, @PathParam("dataSourceName") String dataSourceName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("If-Match") String ifMatch, @@ -108,7 +108,7 @@ Response deleteSync(@HostParam("endpoint") String endpoint, @Get("/datasources('{dataSourceName}')") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> get(@HostParam("endpoint") String endpoint, @PathParam("dataSourceName") String dataSourceName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @@ -116,7 +116,7 @@ Mono> get(@HostParam("endpoint") Str @Get("/datasources('{dataSourceName}')") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response getSync(@HostParam("endpoint") String endpoint, @PathParam("dataSourceName") String dataSourceName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @@ -124,21 +124,21 @@ Response getSync(@HostParam("endpoint") Strin @Get("/datasources") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("$select") String select, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Get("/datasources") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("$select") String select, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Post("/datasources") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> create(@HostParam("endpoint") String endpoint, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -146,7 +146,7 @@ Mono> create(@HostParam("endpoint") @Post("/datasources") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response createSync(@HostParam("endpoint") String endpoint, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -165,7 +165,7 @@ Response createSync(@HostParam("endpoint") St * @param skipIndexerResetRequirementForCache Ignores cache reset requirements. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a datasource definition, which can be used to configure an indexer along with {@link Response} * on successful completion of {@link Mono}. @@ -199,7 +199,7 @@ public Mono> createOrUpdateWithRespo * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a datasource definition, which can be used to configure an indexer along with {@link Response} * on successful completion of {@link Mono}. @@ -232,7 +232,7 @@ public Mono> createOrUpdateWithRespo * @param skipIndexerResetRequirementForCache Ignores cache reset requirements. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a datasource definition, which can be used to configure an indexer on successful completion of * {@link Mono}. @@ -258,7 +258,7 @@ public Mono createOrUpdateAsync(String dataSo * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a datasource definition, which can be used to configure an indexer on successful completion of * {@link Mono}. @@ -285,7 +285,7 @@ public Mono createOrUpdateAsync(String dataSo * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a datasource definition, which can be used to configure an indexer along with * {@link Response}. @@ -318,7 +318,7 @@ public Response createOrUpdateWithResponse(St * @param skipIndexerResetRequirementForCache Ignores cache reset requirements. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a datasource definition, which can be used to configure an indexer. */ @@ -340,7 +340,7 @@ public SearchIndexerDataSourceConnection createOrUpdate(String dataSourceName, * server does not match this value. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if 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}. */ @@ -368,7 +368,7 @@ public Mono> deleteWithResponseAsync(String dataSourceName, Strin * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if 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}. */ @@ -395,7 +395,7 @@ public Mono> deleteWithResponseAsync(String dataSourceName, Strin * server does not match this value. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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. */ @@ -417,7 +417,7 @@ public Mono deleteAsync(String dataSourceName, String ifMatch, String ifNo * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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. */ @@ -439,7 +439,7 @@ public Mono deleteAsync(String dataSourceName, String ifMatch, String ifNo * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @@ -466,7 +466,7 @@ public Response deleteWithResponse(String dataSourceName, String ifMatch, * server does not match this value. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -480,7 +480,7 @@ public void delete(String dataSourceName, String ifMatch, String ifNoneMatch, Re * @param dataSourceName The name of the datasource to retrieve. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a datasource definition, which can be used to configure an indexer along with {@link Response} * on successful completion of {@link Mono}. @@ -505,7 +505,7 @@ public Mono> getWithResponseAsync(St * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a datasource definition, which can be used to configure an indexer along with {@link Response} * on successful completion of {@link Mono}. @@ -529,7 +529,7 @@ public Mono> getWithResponseAsync(St * @param dataSourceName The name of the datasource to retrieve. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a datasource definition, which can be used to configure an indexer on successful completion of * {@link Mono}. @@ -546,7 +546,7 @@ public Mono getAsync(String dataSourceName, R * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a datasource definition, which can be used to configure an indexer on successful completion of * {@link Mono}. @@ -565,7 +565,7 @@ public Mono getAsync(String dataSourceName, R * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a datasource definition, which can be used to configure an indexer along with * {@link Response}. @@ -589,7 +589,7 @@ public Response getWithResponse(String dataSo * @param dataSourceName The name of the datasource to retrieve. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a datasource definition, which can be used to configure an indexer. */ @@ -605,7 +605,7 @@ public SearchIndexerDataSourceConnection get(String dataSourceName, RequestOptio * list of JSON property names, or '*' for all properties. The default is all properties. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List Datasources request along with {@link Response} on successful completion of * {@link Mono}. @@ -630,7 +630,7 @@ public Mono> listWithResponseAsync(String select * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List Datasources request along with {@link Response} on successful completion of * {@link Mono}. @@ -655,7 +655,7 @@ public Mono> listWithResponseAsync(String select * list of JSON property names, or '*' for all properties. The default is all properties. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List Datasources request on successful completion of {@link Mono}. */ @@ -672,7 +672,7 @@ public Mono listAsync(String select, RequestOptions reque * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List Datasources request on successful completion of {@link Mono}. */ @@ -689,7 +689,7 @@ public Mono listAsync(String select, RequestOptions reque * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List Datasources request along with {@link Response}. */ @@ -713,7 +713,7 @@ public Response listWithResponse(String select, RequestOp * list of JSON property names, or '*' for all properties. The default is all properties. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List Datasources request. */ @@ -728,7 +728,7 @@ public ListDataSourcesResult list(String select, RequestOptions requestOptions) * @param dataSource The definition of the datasource to create. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a datasource definition, which can be used to configure an indexer along with {@link Response} * on successful completion of {@link Mono}. @@ -753,7 +753,7 @@ public ListDataSourcesResult list(String select, RequestOptions requestOptions) * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a datasource definition, which can be used to configure an indexer along with {@link Response} * on successful completion of {@link Mono}. @@ -777,7 +777,7 @@ public Mono> createWithResponseAsync * @param dataSource The definition of the datasource to create. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a datasource definition, which can be used to configure an indexer on successful completion of * {@link Mono}. @@ -795,7 +795,7 @@ public Mono createAsync(SearchIndexerDataSour * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a datasource definition, which can be used to configure an indexer on successful completion of * {@link Mono}. @@ -814,7 +814,7 @@ public Mono createAsync(SearchIndexerDataSour * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a datasource definition, which can be used to configure an indexer along with * {@link Response}. @@ -838,7 +838,7 @@ public Response createWithResponse(SearchInde * @param dataSource The definition of the datasource to create. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a datasource definition, which can be used to configure an indexer. */ diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/IndexersImpl.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/IndexersImpl.java index 235ed5da24fa9..2d4689f40c745 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/IndexersImpl.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/IndexersImpl.java @@ -26,9 +26,9 @@ import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.search.documents.indexes.implementation.models.DocumentKeysOrIds; +import com.azure.search.documents.indexes.implementation.models.ErrorResponseException; import com.azure.search.documents.indexes.implementation.models.ListIndexersResult; import com.azure.search.documents.indexes.implementation.models.RequestOptions; -import com.azure.search.documents.indexes.implementation.models.SearchErrorException; import com.azure.search.documents.indexes.models.SearchIndexer; import com.azure.search.documents.indexes.models.SearchIndexerStatus; import java.util.UUID; @@ -67,21 +67,21 @@ public final class IndexersImpl { public interface IndexersService { @Post("/indexers('{indexerName}')/search.reset") @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> reset(@HostParam("endpoint") String endpoint, @PathParam("indexerName") String indexerName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Post("/indexers('{indexerName}')/search.reset") @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response resetSync(@HostParam("endpoint") String endpoint, @PathParam("indexerName") String indexerName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Post("/indexers('{indexerName}')/search.resetdocs") @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> resetDocs(@HostParam("endpoint") String endpoint, @PathParam("indexerName") String indexerName, @QueryParam("overwrite") Boolean overwrite, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @@ -90,7 +90,7 @@ Mono> resetDocs(@HostParam("endpoint") String endpoint, @Post("/indexers('{indexerName}')/search.resetdocs") @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response resetDocsSync(@HostParam("endpoint") String endpoint, @PathParam("indexerName") String indexerName, @QueryParam("overwrite") Boolean overwrite, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @@ -99,21 +99,21 @@ Response resetDocsSync(@HostParam("endpoint") String endpoint, @Post("/indexers('{indexerName}')/search.run") @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> run(@HostParam("endpoint") String endpoint, @PathParam("indexerName") String indexerName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Post("/indexers('{indexerName}')/search.run") @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response runSync(@HostParam("endpoint") String endpoint, @PathParam("indexerName") String indexerName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Put("/indexers('{indexerName}')") @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> createOrUpdate(@HostParam("endpoint") String endpoint, @PathParam("indexerName") String indexerName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("If-Match") String ifMatch, @@ -126,7 +126,7 @@ Mono> createOrUpdate(@HostParam("endpoint") String endpo @Put("/indexers('{indexerName}')") @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response createOrUpdateSync(@HostParam("endpoint") String endpoint, @PathParam("indexerName") String indexerName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("If-Match") String ifMatch, @@ -139,7 +139,7 @@ Response createOrUpdateSync(@HostParam("endpoint") String endpoin @Delete("/indexers('{indexerName}')") @ExpectedResponses({ 204, 404 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("indexerName") String indexerName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("If-Match") String ifMatch, @@ -148,7 +148,7 @@ Mono> delete(@HostParam("endpoint") String endpoint, @Delete("/indexers('{indexerName}')") @ExpectedResponses({ 204, 404 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response deleteSync(@HostParam("endpoint") String endpoint, @PathParam("indexerName") String indexerName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @QueryParam("api-version") String apiVersion, @@ -156,7 +156,7 @@ Response deleteSync(@HostParam("endpoint") String endpoint, @PathParam("in @Get("/indexers('{indexerName}')") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> get(@HostParam("endpoint") String endpoint, @PathParam("indexerName") String indexerName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @@ -164,7 +164,7 @@ Mono> get(@HostParam("endpoint") String endpoint, @Get("/indexers('{indexerName}')") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response getSync(@HostParam("endpoint") String endpoint, @PathParam("indexerName") String indexerName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @@ -172,21 +172,21 @@ Response getSync(@HostParam("endpoint") String endpoint, @Get("/indexers") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("$select") String select, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Get("/indexers") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("$select") String select, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Post("/indexers") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> create(@HostParam("endpoint") String endpoint, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -194,7 +194,7 @@ Mono> create(@HostParam("endpoint") String endpoint, @Post("/indexers") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response createSync(@HostParam("endpoint") String endpoint, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -202,7 +202,7 @@ Response createSync(@HostParam("endpoint") String endpoint, @Get("/indexers('{indexerName}')/search.status") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> getStatus(@HostParam("endpoint") String endpoint, @PathParam("indexerName") String indexerName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @@ -210,7 +210,7 @@ Mono> getStatus(@HostParam("endpoint") String endp @Get("/indexers('{indexerName}')/search.status") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response getStatusSync(@HostParam("endpoint") String endpoint, @PathParam("indexerName") String indexerName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @@ -223,7 +223,7 @@ Response getStatusSync(@HostParam("endpoint") String endpoi * @param indexerName The name of the indexer to reset. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if 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}. */ @@ -246,7 +246,7 @@ public Mono> resetWithResponseAsync(String indexerName, RequestOp * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if 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}. */ @@ -269,7 +269,7 @@ public Mono> resetWithResponseAsync(String indexerName, RequestOp * @param indexerName The name of the indexer to reset. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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. */ @@ -285,7 +285,7 @@ public Mono resetAsync(String indexerName, RequestOptions requestOptions) * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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. */ @@ -301,7 +301,7 @@ public Mono resetAsync(String indexerName, RequestOptions requestOptions, * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @@ -323,7 +323,7 @@ public Response resetWithResponse(String indexerName, RequestOptions reque * @param indexerName The name of the indexer to reset. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -340,7 +340,7 @@ public void reset(String indexerName, RequestOptions requestOptions) { * @param keysOrIds The keysOrIds parameter. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if 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}. */ @@ -367,7 +367,7 @@ public Mono> resetDocsWithResponseAsync(String indexerName, Boole * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if 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}. */ @@ -393,7 +393,7 @@ public Mono> resetDocsWithResponseAsync(String indexerName, Boole * @param keysOrIds The keysOrIds parameter. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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. */ @@ -414,7 +414,7 @@ public Mono resetDocsAsync(String indexerName, Boolean overwrite, Document * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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. */ @@ -435,7 +435,7 @@ public Mono resetDocsAsync(String indexerName, Boolean overwrite, Document * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @@ -461,7 +461,7 @@ public Response resetDocsWithResponse(String indexerName, Boolean overwrit * @param keysOrIds The keysOrIds parameter. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -476,7 +476,7 @@ public void resetDocs(String indexerName, Boolean overwrite, DocumentKeysOrIds k * @param indexerName The name of the indexer to run. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if 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}. */ @@ -499,7 +499,7 @@ public Mono> runWithResponseAsync(String indexerName, RequestOpti * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if 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}. */ @@ -522,7 +522,7 @@ public Mono> runWithResponseAsync(String indexerName, RequestOpti * @param indexerName The name of the indexer to run. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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. */ @@ -538,7 +538,7 @@ public Mono runAsync(String indexerName, RequestOptions requestOptions) { * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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. */ @@ -554,7 +554,7 @@ public Mono runAsync(String indexerName, RequestOptions requestOptions, Co * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @@ -576,7 +576,7 @@ public Response runWithResponse(String indexerName, RequestOptions request * @param indexerName The name of the indexer to run. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -597,7 +597,7 @@ public void run(String indexerName, RequestOptions requestOptions) { * @param disableCacheReprocessingChangeDetection Disables cache reprocessing change detection. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an indexer along with {@link Response} on successful completion of {@link Mono}. */ @@ -631,7 +631,7 @@ public Mono> createOrUpdateWithResponseAsync(String inde * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an indexer along with {@link Response} on successful completion of {@link Mono}. */ @@ -664,7 +664,7 @@ public Mono> createOrUpdateWithResponseAsync(String inde * @param disableCacheReprocessingChangeDetection Disables cache reprocessing change detection. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an indexer on successful completion of {@link Mono}. */ @@ -691,7 +691,7 @@ public Mono createOrUpdateAsync(String indexerName, SearchIndexer * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an indexer on successful completion of {@link Mono}. */ @@ -718,7 +718,7 @@ public Mono createOrUpdateAsync(String indexerName, SearchIndexer * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an indexer along with {@link Response}. */ @@ -751,7 +751,7 @@ public Response createOrUpdateWithResponse(String indexerName, Se * @param disableCacheReprocessingChangeDetection Disables cache reprocessing change detection. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an indexer. */ @@ -774,7 +774,7 @@ public SearchIndexer createOrUpdate(String indexerName, SearchIndexer indexer, S * server does not match this value. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if 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}. */ @@ -802,7 +802,7 @@ public Mono> deleteWithResponseAsync(String indexerName, String i * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if 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}. */ @@ -829,7 +829,7 @@ public Mono> deleteWithResponseAsync(String indexerName, String i * server does not match this value. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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. */ @@ -851,7 +851,7 @@ public Mono deleteAsync(String indexerName, String ifMatch, String ifNoneM * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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. */ @@ -873,7 +873,7 @@ public Mono deleteAsync(String indexerName, String ifMatch, String ifNoneM * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @@ -900,7 +900,7 @@ public Response deleteWithResponse(String indexerName, String ifMatch, Str * server does not match this value. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -914,7 +914,7 @@ public void delete(String indexerName, String ifMatch, String ifNoneMatch, Reque * @param indexerName The name of the indexer to retrieve. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an indexer along with {@link Response} on successful completion of {@link Mono}. */ @@ -937,7 +937,7 @@ public Mono> getWithResponseAsync(String indexerName, Re * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an indexer along with {@link Response} on successful completion of {@link Mono}. */ @@ -960,7 +960,7 @@ public Mono> getWithResponseAsync(String indexerName, Re * @param indexerName The name of the indexer to retrieve. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an indexer on successful completion of {@link Mono}. */ @@ -976,7 +976,7 @@ public Mono getAsync(String indexerName, RequestOptions requestOp * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an indexer on successful completion of {@link Mono}. */ @@ -993,7 +993,7 @@ public Mono getAsync(String indexerName, RequestOptions requestOp * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an indexer along with {@link Response}. */ @@ -1015,7 +1015,7 @@ public Response getWithResponse(String indexerName, RequestOption * @param indexerName The name of the indexer to retrieve. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an indexer. */ @@ -1031,7 +1031,7 @@ public SearchIndexer get(String indexerName, RequestOptions requestOptions) { * of JSON property names, or '*' for all properties. The default is all properties. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List Indexers request along with {@link Response} on successful completion of * {@link Mono}. @@ -1056,7 +1056,7 @@ public Mono> listWithResponseAsync(String select, R * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List Indexers request along with {@link Response} on successful completion of * {@link Mono}. @@ -1081,7 +1081,7 @@ public Mono> listWithResponseAsync(String select, R * of JSON property names, or '*' for all properties. The default is all properties. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List Indexers request on successful completion of {@link Mono}. */ @@ -1098,7 +1098,7 @@ public Mono listAsync(String select, RequestOptions requestO * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List Indexers request on successful completion of {@link Mono}. */ @@ -1115,7 +1115,7 @@ public Mono listAsync(String select, RequestOptions requestO * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List Indexers request along with {@link Response}. */ @@ -1139,7 +1139,7 @@ public Response listWithResponse(String select, RequestOptio * of JSON property names, or '*' for all properties. The default is all properties. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List Indexers request. */ @@ -1154,7 +1154,7 @@ public ListIndexersResult list(String select, RequestOptions requestOptions) { * @param indexer The definition of the indexer to create. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an indexer along with {@link Response} on successful completion of {@link Mono}. */ @@ -1177,7 +1177,7 @@ public Mono> createWithResponseAsync(SearchIndexer index * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an indexer along with {@link Response} on successful completion of {@link Mono}. */ @@ -1200,7 +1200,7 @@ public Mono> createWithResponseAsync(SearchIndexer index * @param indexer The definition of the indexer to create. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an indexer on successful completion of {@link Mono}. */ @@ -1216,7 +1216,7 @@ public Mono createAsync(SearchIndexer indexer, RequestOptions req * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an indexer on successful completion of {@link Mono}. */ @@ -1233,7 +1233,7 @@ public Mono createAsync(SearchIndexer indexer, RequestOptions req * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an indexer along with {@link Response}. */ @@ -1256,7 +1256,7 @@ public Response createWithResponse(SearchIndexer indexer, Request * @param indexer The definition of the indexer to create. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents an indexer. */ @@ -1271,7 +1271,7 @@ public SearchIndexer create(SearchIndexer indexer, RequestOptions requestOptions * @param indexerName The name of the indexer for which to retrieve status. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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 current status and execution history of an indexer along with {@link Response} on * successful completion of {@link Mono}. @@ -1296,7 +1296,7 @@ public Mono> getStatusWithResponseAsync(String ind * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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 current status and execution history of an indexer along with {@link Response} on * successful completion of {@link Mono}. @@ -1320,7 +1320,7 @@ public Mono> getStatusWithResponseAsync(String ind * @param indexerName The name of the indexer for which to retrieve status. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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 current status and execution history of an indexer on successful completion of * {@link Mono}. @@ -1337,7 +1337,7 @@ public Mono getStatusAsync(String indexerName, RequestOptio * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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 current status and execution history of an indexer on successful completion of * {@link Mono}. @@ -1356,7 +1356,7 @@ public Mono getStatusAsync(String indexerName, RequestOptio * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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 current status and execution history of an indexer along with {@link Response}. */ @@ -1379,7 +1379,7 @@ public Response getStatusWithResponse(String indexerName, R * @param indexerName The name of the indexer for which to retrieve status. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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 current status and execution history of an indexer. */ diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/IndexesImpl.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/IndexesImpl.java index 438d19d4a8aa2..e91da9dea2bed 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/IndexesImpl.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/IndexesImpl.java @@ -31,9 +31,9 @@ import com.azure.core.util.FluxUtil; import com.azure.search.documents.indexes.implementation.models.AnalyzeRequest; import com.azure.search.documents.indexes.implementation.models.AnalyzeResult; +import com.azure.search.documents.indexes.implementation.models.ErrorResponseException; import com.azure.search.documents.indexes.implementation.models.ListIndexesResult; import com.azure.search.documents.indexes.implementation.models.RequestOptions; -import com.azure.search.documents.indexes.implementation.models.SearchErrorException; import com.azure.search.documents.indexes.models.SearchIndex; import com.azure.search.documents.indexes.models.SearchIndexStatistics; import java.util.UUID; @@ -72,7 +72,7 @@ public final class IndexesImpl { public interface IndexesService { @Post("/indexes") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> create(@HostParam("endpoint") String endpoint, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -80,7 +80,7 @@ Mono> create(@HostParam("endpoint") String endpoint, @Post("/indexes") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response createSync(@HostParam("endpoint") String endpoint, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -88,21 +88,21 @@ Response createSync(@HostParam("endpoint") String endpoint, @Get("/indexes") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("$select") String select, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Get("/indexes") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("$select") String select, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Put("/indexes('{indexName}')") @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> createOrUpdate(@HostParam("endpoint") String endpoint, @PathParam("indexName") String indexName, @QueryParam("allowIndexDowntime") Boolean allowIndexDowntime, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("If-Match") String ifMatch, @@ -112,7 +112,7 @@ Mono> createOrUpdate(@HostParam("endpoint") String endpoin @Put("/indexes('{indexName}')") @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response createOrUpdateSync(@HostParam("endpoint") String endpoint, @PathParam("indexName") String indexName, @QueryParam("allowIndexDowntime") Boolean allowIndexDowntime, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("If-Match") String ifMatch, @@ -122,7 +122,7 @@ Response createOrUpdateSync(@HostParam("endpoint") String endpoint, @Delete("/indexes('{indexName}')") @ExpectedResponses({ 204, 404 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("indexName") String indexName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @QueryParam("api-version") String apiVersion, @@ -130,7 +130,7 @@ Mono> delete(@HostParam("endpoint") String endpoint, @PathParam(" @Delete("/indexes('{indexName}')") @ExpectedResponses({ 204, 404 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response deleteSync(@HostParam("endpoint") String endpoint, @PathParam("indexName") String indexName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @QueryParam("api-version") String apiVersion, @@ -138,35 +138,35 @@ Response deleteSync(@HostParam("endpoint") String endpoint, @PathParam("in @Get("/indexes('{indexName}')") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> get(@HostParam("endpoint") String endpoint, @PathParam("indexName") String indexName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Get("/indexes('{indexName}')") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response getSync(@HostParam("endpoint") String endpoint, @PathParam("indexName") String indexName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Get("/indexes('{indexName}')/search.stats") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> getStatistics(@HostParam("endpoint") String endpoint, @PathParam("indexName") String indexName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Get("/indexes('{indexName}')/search.stats") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response getStatisticsSync(@HostParam("endpoint") String endpoint, @PathParam("indexName") String indexName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Post("/indexes('{indexName}')/search.analyze") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> analyze(@HostParam("endpoint") String endpoint, @PathParam("indexName") String indexName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -174,7 +174,7 @@ Mono> analyze(@HostParam("endpoint") String endpoint, @Post("/indexes('{indexName}')/search.analyze") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response analyzeSync(@HostParam("endpoint") String endpoint, @PathParam("indexName") String indexName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -187,7 +187,7 @@ Response analyzeSync(@HostParam("endpoint") String endpoint, * @param index The definition of the index to create. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a search index definition, which describes the fields and search behavior of an index along * with {@link Response} on successful completion of {@link Mono}. @@ -211,7 +211,7 @@ public Mono> createWithResponseAsync(SearchIndex index, Re * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a search index definition, which describes the fields and search behavior of an index along * with {@link Response} on successful completion of {@link Mono}. @@ -235,7 +235,7 @@ public Mono> createWithResponseAsync(SearchIndex index, Re * @param index The definition of the index to create. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a search index definition, which describes the fields and search behavior of an index on * successful completion of {@link Mono}. @@ -252,7 +252,7 @@ public Mono createAsync(SearchIndex index, RequestOptions requestOp * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a search index definition, which describes the fields and search behavior of an index on * successful completion of {@link Mono}. @@ -269,7 +269,7 @@ public Mono createAsync(SearchIndex index, RequestOptions requestOp * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a search index definition, which describes the fields and search behavior of an index along * with {@link Response}. @@ -292,7 +292,7 @@ public Response createWithResponse(SearchIndex index, RequestOption * @param index The definition of the index to create. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a search index definition, which describes the fields and search behavior of an index. */ @@ -308,7 +308,7 @@ public SearchIndex create(SearchIndex index, RequestOptions requestOptions) { * comma-separated list of JSON property names, or '*' for all properties. The default is all properties. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List Indexes request along with {@link PagedResponse} on successful completion of * {@link Mono}. @@ -336,7 +336,7 @@ public Mono> listSinglePageAsync(String select, Reque * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List Indexes request along with {@link PagedResponse} on successful completion of * {@link Mono}. @@ -363,7 +363,7 @@ public Mono> listSinglePageAsync(String select, Reque * comma-separated list of JSON property names, or '*' for all properties. The default is all properties. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List Indexes request as paginated response with {@link PagedFlux}. */ @@ -380,7 +380,7 @@ public PagedFlux listAsync(String select, RequestOptions requestOpt * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List Indexes request as paginated response with {@link PagedFlux}. */ @@ -396,7 +396,7 @@ public PagedFlux listAsync(String select, RequestOptions requestOpt * comma-separated list of JSON property names, or '*' for all properties. The default is all properties. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List Indexes request along with {@link PagedResponse}. */ @@ -422,7 +422,7 @@ public PagedResponse listSinglePage(String select, RequestOptions r * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List Indexes request along with {@link PagedResponse}. */ @@ -447,7 +447,7 @@ public PagedResponse listSinglePage(String select, RequestOptions r * comma-separated list of JSON property names, or '*' for all properties. The default is all properties. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List Indexes request as paginated response with {@link PagedIterable}. */ @@ -464,7 +464,7 @@ public PagedIterable list(String select, RequestOptions requestOpti * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List Indexes request as paginated response with {@link PagedIterable}. */ @@ -488,7 +488,7 @@ public PagedIterable list(String select, RequestOptions requestOpti * server does not match this value. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a search index definition, which describes the fields and search behavior of an index along * with {@link Response} on successful completion of {@link Mono}. @@ -524,7 +524,7 @@ public Mono> createOrUpdateWithResponseAsync(String indexN * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a search index definition, which describes the fields and search behavior of an index along * with {@link Response} on successful completion of {@link Mono}. @@ -559,7 +559,7 @@ public Mono> createOrUpdateWithResponseAsync(String indexN * server does not match this value. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a search index definition, which describes the fields and search behavior of an index on * successful completion of {@link Mono}. @@ -587,7 +587,7 @@ public Mono createOrUpdateAsync(String indexName, SearchIndex index * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a search index definition, which describes the fields and search behavior of an index on * successful completion of {@link Mono}. @@ -615,7 +615,7 @@ public Mono createOrUpdateAsync(String indexName, SearchIndex index * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a search index definition, which describes the fields and search behavior of an index along * with {@link Response}. @@ -650,7 +650,7 @@ public Response createOrUpdateWithResponse(String indexName, Search * server does not match this value. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a search index definition, which describes the fields and search behavior of an index. */ @@ -673,7 +673,7 @@ public SearchIndex createOrUpdate(String indexName, SearchIndex index, Boolean a * server does not match this value. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if 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}. */ @@ -703,7 +703,7 @@ public Mono> deleteWithResponseAsync(String indexName, String ifM * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if 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}. */ @@ -732,7 +732,7 @@ public Mono> deleteWithResponseAsync(String indexName, String ifM * server does not match this value. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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. */ @@ -755,7 +755,7 @@ public Mono deleteAsync(String indexName, String ifMatch, String ifNoneMat * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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. */ @@ -779,7 +779,7 @@ public Mono deleteAsync(String indexName, String ifMatch, String ifNoneMat * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @@ -808,7 +808,7 @@ public Response deleteWithResponse(String indexName, String ifMatch, Strin * server does not match this value. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -822,7 +822,7 @@ public void delete(String indexName, String ifMatch, String ifNoneMatch, Request * @param indexName The name of the index to retrieve. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a search index definition, which describes the fields and search behavior of an index along * with {@link Response} on successful completion of {@link Mono}. @@ -846,7 +846,7 @@ public Mono> getWithResponseAsync(String indexName, Reques * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a search index definition, which describes the fields and search behavior of an index along * with {@link Response} on successful completion of {@link Mono}. @@ -870,7 +870,7 @@ public Mono> getWithResponseAsync(String indexName, Reques * @param indexName The name of the index to retrieve. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a search index definition, which describes the fields and search behavior of an index on * successful completion of {@link Mono}. @@ -887,7 +887,7 @@ public Mono getAsync(String indexName, RequestOptions requestOption * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a search index definition, which describes the fields and search behavior of an index on * successful completion of {@link Mono}. @@ -905,7 +905,7 @@ public Mono getAsync(String indexName, RequestOptions requestOption * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a search index definition, which describes the fields and search behavior of an index along * with {@link Response}. @@ -928,7 +928,7 @@ public Response getWithResponse(String indexName, RequestOptions re * @param indexName The name of the index to retrieve. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a search index definition, which describes the fields and search behavior of an index. */ @@ -943,7 +943,7 @@ public SearchIndex get(String indexName, RequestOptions requestOptions) { * @param indexName The name of the index for which to retrieve statistics. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return statistics for a given index along with {@link Response} on successful completion of {@link Mono}. */ @@ -967,7 +967,7 @@ public Mono> getStatisticsWithResponseAsync(Stri * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return statistics for a given index along with {@link Response} on successful completion of {@link Mono}. */ @@ -990,7 +990,7 @@ public Mono> getStatisticsWithResponseAsync(Stri * @param indexName The name of the index for which to retrieve statistics. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return statistics for a given index on successful completion of {@link Mono}. */ @@ -1007,7 +1007,7 @@ public Mono getStatisticsAsync(String indexName, RequestO * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return statistics for a given index on successful completion of {@link Mono}. */ @@ -1025,7 +1025,7 @@ public Mono getStatisticsAsync(String indexName, RequestO * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return statistics for a given index along with {@link Response}. */ @@ -1048,7 +1048,7 @@ public Response getStatisticsWithResponse(String indexNam * @param indexName The name of the index for which to retrieve statistics. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return statistics for a given index. */ @@ -1064,7 +1064,7 @@ public SearchIndexStatistics getStatistics(String indexName, RequestOptions requ * @param request The text and analyzer or analysis components to test. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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 testing an analyzer on text along with {@link Response} on successful completion of * {@link Mono}. @@ -1090,7 +1090,7 @@ public Mono> analyzeWithResponseAsync(String indexName, * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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 testing an analyzer on text along with {@link Response} on successful completion of * {@link Mono}. @@ -1115,7 +1115,7 @@ public Mono> analyzeWithResponseAsync(String indexName, * @param request The text and analyzer or analysis components to test. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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 testing an analyzer on text on successful completion of {@link Mono}. */ @@ -1133,7 +1133,7 @@ public Mono analyzeAsync(String indexName, AnalyzeRequest request * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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 testing an analyzer on text on successful completion of {@link Mono}. */ @@ -1152,7 +1152,7 @@ public Mono analyzeAsync(String indexName, AnalyzeRequest request * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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 testing an analyzer on text along with {@link Response}. */ @@ -1176,7 +1176,7 @@ public Response analyzeWithResponse(String indexName, AnalyzeRequ * @param request The text and analyzer or analysis components to test. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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 testing an analyzer on text. */ diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/SearchServiceClientImpl.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/SearchServiceClientImpl.java index dca0e9884ac55..3e51bf5355de5 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/SearchServiceClientImpl.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/SearchServiceClientImpl.java @@ -26,8 +26,8 @@ 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.indexes.implementation.models.ErrorResponseException; import com.azure.search.documents.indexes.implementation.models.RequestOptions; -import com.azure.search.documents.indexes.implementation.models.SearchErrorException; import com.azure.search.documents.indexes.models.SearchServiceStatistics; import java.util.UUID; import reactor.core.publisher.Mono; @@ -236,14 +236,14 @@ public SearchServiceClientImpl(HttpPipeline httpPipeline, SerializerAdapter seri public interface SearchServiceClientService { @Get("/servicestats") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> getServiceStatistics(@HostParam("endpoint") String endpoint, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Get("/servicestats") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response getServiceStatisticsSync(@HostParam("endpoint") String endpoint, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -254,7 +254,7 @@ Response getServiceStatisticsSync(@HostParam("endpoint" * * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return service level statistics for a search service along with {@link Response} on successful completion of * {@link Mono}. @@ -278,7 +278,7 @@ Response getServiceStatisticsSync(@HostParam("endpoint" * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return service level statistics for a search service along with {@link Response} on successful completion of * {@link Mono}. @@ -301,7 +301,7 @@ public Mono> getServiceStatisticsWithResponseA * * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return service level statistics for a search service on successful completion of {@link Mono}. */ @@ -316,7 +316,7 @@ public Mono getServiceStatisticsAsync(RequestOptions re * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return service level statistics for a search service on successful completion of {@link Mono}. */ @@ -332,7 +332,7 @@ public Mono getServiceStatisticsAsync(RequestOptions re * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return service level statistics for a search service along with {@link Response}. */ @@ -354,7 +354,7 @@ public Response getServiceStatisticsWithResponse(Reques * * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return service level statistics for a search service. */ diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/SkillsetsImpl.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/SkillsetsImpl.java index 05793154f18bd..109103c83f3e3 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/SkillsetsImpl.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/SkillsetsImpl.java @@ -25,9 +25,9 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.search.documents.indexes.implementation.models.ErrorResponseException; import com.azure.search.documents.indexes.implementation.models.ListSkillsetsResult; import com.azure.search.documents.indexes.implementation.models.RequestOptions; -import com.azure.search.documents.indexes.implementation.models.SearchErrorException; import com.azure.search.documents.indexes.implementation.models.SkillNames; import com.azure.search.documents.indexes.models.SearchIndexerSkillset; import java.util.UUID; @@ -67,7 +67,7 @@ public final class SkillsetsImpl { public interface SkillsetsService { @Put("/skillsets('{skillsetName}')") @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> createOrUpdate(@HostParam("endpoint") String endpoint, @PathParam("skillsetName") String skillsetName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("If-Match") String ifMatch, @@ -80,7 +80,7 @@ Mono> createOrUpdate(@HostParam("endpoint") Stri @Put("/skillsets('{skillsetName}')") @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response createOrUpdateSync(@HostParam("endpoint") String endpoint, @PathParam("skillsetName") String skillsetName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("If-Match") String ifMatch, @@ -93,7 +93,7 @@ Response createOrUpdateSync(@HostParam("endpoint") String @Delete("/skillsets('{skillsetName}')") @ExpectedResponses({ 204, 404 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("skillsetName") String skillsetName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("If-Match") String ifMatch, @@ -102,7 +102,7 @@ Mono> delete(@HostParam("endpoint") String endpoint, @Delete("/skillsets('{skillsetName}')") @ExpectedResponses({ 204, 404 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response deleteSync(@HostParam("endpoint") String endpoint, @PathParam("skillsetName") String skillsetName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("If-Match") String ifMatch, @@ -111,7 +111,7 @@ Response deleteSync(@HostParam("endpoint") String endpoint, @Get("/skillsets('{skillsetName}')") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> get(@HostParam("endpoint") String endpoint, @PathParam("skillsetName") String skillsetName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @@ -119,7 +119,7 @@ Mono> get(@HostParam("endpoint") String endpoint @Get("/skillsets('{skillsetName}')") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response getSync(@HostParam("endpoint") String endpoint, @PathParam("skillsetName") String skillsetName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @@ -127,21 +127,21 @@ Response getSync(@HostParam("endpoint") String endpoint, @Get("/skillsets") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("$select") String select, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Get("/skillsets") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("$select") String select, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Post("/skillsets") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> create(@HostParam("endpoint") String endpoint, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -149,7 +149,7 @@ Mono> create(@HostParam("endpoint") String endpo @Post("/skillsets") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response createSync(@HostParam("endpoint") String endpoint, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -157,7 +157,7 @@ Response createSync(@HostParam("endpoint") String endpoin @Post("/skillsets('{skillsetName}')/search.resetskills") @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> resetSkills(@HostParam("endpoint") String endpoint, @PathParam("skillsetName") String skillsetName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @@ -166,7 +166,7 @@ Mono> resetSkills(@HostParam("endpoint") String endpoint, @Post("/skillsets('{skillsetName}')/search.resetskills") @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response resetSkillsSync(@HostParam("endpoint") String endpoint, @PathParam("skillsetName") String skillsetName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @@ -187,7 +187,7 @@ Response resetSkillsSync(@HostParam("endpoint") String endpoint, * @param disableCacheReprocessingChangeDetection Disables cache reprocessing change detection. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of skills along with {@link Response} on successful completion of {@link Mono}. */ @@ -221,7 +221,7 @@ public Mono> createOrUpdateWithResponseAsync(Str * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of skills along with {@link Response} on successful completion of {@link Mono}. */ @@ -254,7 +254,7 @@ public Mono> createOrUpdateWithResponseAsync(Str * @param disableCacheReprocessingChangeDetection Disables cache reprocessing change detection. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of skills on successful completion of {@link Mono}. */ @@ -281,7 +281,7 @@ public Mono createOrUpdateAsync(String skillsetName, Sear * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of skills on successful completion of {@link Mono}. */ @@ -308,7 +308,7 @@ public Mono createOrUpdateAsync(String skillsetName, Sear * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of skills along with {@link Response}. */ @@ -341,7 +341,7 @@ public Response createOrUpdateWithResponse(String skillse * @param disableCacheReprocessingChangeDetection Disables cache reprocessing change detection. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of skills. */ @@ -364,7 +364,7 @@ public SearchIndexerSkillset createOrUpdate(String skillsetName, SearchIndexerSk * server does not match this value. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if 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}. */ @@ -392,7 +392,7 @@ public Mono> deleteWithResponseAsync(String skillsetName, String * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if 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}. */ @@ -419,7 +419,7 @@ public Mono> deleteWithResponseAsync(String skillsetName, String * server does not match this value. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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. */ @@ -441,7 +441,7 @@ public Mono deleteAsync(String skillsetName, String ifMatch, String ifNone * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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. */ @@ -463,7 +463,7 @@ public Mono deleteAsync(String skillsetName, String ifMatch, String ifNone * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @@ -490,7 +490,7 @@ public Response deleteWithResponse(String skillsetName, String ifMatch, St * server does not match this value. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -504,7 +504,7 @@ public void delete(String skillsetName, String ifMatch, String ifNoneMatch, Requ * @param skillsetName The name of the skillset to retrieve. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of skills along with {@link Response} on successful completion of {@link Mono}. */ @@ -528,7 +528,7 @@ public Mono> getWithResponseAsync(String skillse * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of skills along with {@link Response} on successful completion of {@link Mono}. */ @@ -551,7 +551,7 @@ public Mono> getWithResponseAsync(String skillse * @param skillsetName The name of the skillset to retrieve. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of skills on successful completion of {@link Mono}. */ @@ -567,7 +567,7 @@ public Mono getAsync(String skillsetName, RequestOptions * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of skills on successful completion of {@link Mono}. */ @@ -584,7 +584,7 @@ public Mono getAsync(String skillsetName, RequestOptions * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of skills along with {@link Response}. */ @@ -607,7 +607,7 @@ public Response getWithResponse(String skillsetName, Requ * @param skillsetName The name of the skillset to retrieve. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of skills. */ @@ -623,7 +623,7 @@ public SearchIndexerSkillset get(String skillsetName, RequestOptions requestOpti * list of JSON property names, or '*' for all properties. The default is all properties. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a list skillset request along with {@link Response} on successful completion of * {@link Mono}. @@ -648,7 +648,7 @@ public Mono> listWithResponseAsync(String select, * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a list skillset request along with {@link Response} on successful completion of * {@link Mono}. @@ -673,7 +673,7 @@ public Mono> listWithResponseAsync(String select, * list of JSON property names, or '*' for all properties. The default is all properties. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a list skillset request on successful completion of {@link Mono}. */ @@ -690,7 +690,7 @@ public Mono listAsync(String select, RequestOptions request * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a list skillset request on successful completion of {@link Mono}. */ @@ -707,7 +707,7 @@ public Mono listAsync(String select, RequestOptions request * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a list skillset request along with {@link Response}. */ @@ -731,7 +731,7 @@ public Response listWithResponse(String select, RequestOpti * list of JSON property names, or '*' for all properties. The default is all properties. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a list skillset request. */ @@ -746,7 +746,7 @@ public ListSkillsetsResult list(String select, RequestOptions requestOptions) { * @param skillset The skillset containing one or more skills to create in a search service. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of skills along with {@link Response} on successful completion of {@link Mono}. */ @@ -770,7 +770,7 @@ public Mono> createWithResponseAsync(SearchIndex * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of skills along with {@link Response} on successful completion of {@link Mono}. */ @@ -793,7 +793,7 @@ public Mono> createWithResponseAsync(SearchIndex * @param skillset The skillset containing one or more skills to create in a search service. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of skills on successful completion of {@link Mono}. */ @@ -809,7 +809,7 @@ public Mono createAsync(SearchIndexerSkillset skillset, R * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of skills on successful completion of {@link Mono}. */ @@ -827,7 +827,7 @@ public Mono createAsync(SearchIndexerSkillset skillset, R * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of skills along with {@link Response}. */ @@ -850,7 +850,7 @@ public Response createWithResponse(SearchIndexerSkillset * @param skillset The skillset containing one or more skills to create in a search service. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of skills. */ @@ -866,7 +866,7 @@ public SearchIndexerSkillset create(SearchIndexerSkillset skillset, RequestOptio * @param skillNames The names of skills to reset. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if 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}. */ @@ -891,7 +891,7 @@ public Mono> resetSkillsWithResponseAsync(String skillsetName, Sk * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if 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}. */ @@ -915,7 +915,7 @@ public Mono> resetSkillsWithResponseAsync(String skillsetName, Sk * @param skillNames The names of skills to reset. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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. */ @@ -932,7 +932,7 @@ public Mono resetSkillsAsync(String skillsetName, SkillNames skillNames, R * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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. */ @@ -951,7 +951,7 @@ public Mono resetSkillsAsync(String skillsetName, SkillNames skillNames, R * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @@ -975,7 +975,7 @@ public Response resetSkillsWithResponse(String skillsetName, SkillNames sk * @param skillNames The names of skills to reset. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/SynonymMapsImpl.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/SynonymMapsImpl.java index b48f92647d4c1..d63503c5da004 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/SynonymMapsImpl.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/SynonymMapsImpl.java @@ -25,9 +25,9 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.search.documents.indexes.implementation.models.ErrorResponseException; import com.azure.search.documents.indexes.implementation.models.ListSynonymMapsResult; import com.azure.search.documents.indexes.implementation.models.RequestOptions; -import com.azure.search.documents.indexes.implementation.models.SearchErrorException; import com.azure.search.documents.indexes.models.SynonymMap; import java.util.UUID; import reactor.core.publisher.Mono; @@ -66,7 +66,7 @@ public final class SynonymMapsImpl { public interface SynonymMapsService { @Put("/synonymmaps('{synonymMapName}')") @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> createOrUpdate(@HostParam("endpoint") String endpoint, @PathParam("synonymMapName") String synonymMapName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("If-Match") String ifMatch, @@ -76,7 +76,7 @@ Mono> createOrUpdate(@HostParam("endpoint") String endpoint @Put("/synonymmaps('{synonymMapName}')") @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response createOrUpdateSync(@HostParam("endpoint") String endpoint, @PathParam("synonymMapName") String synonymMapName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("If-Match") String ifMatch, @@ -86,7 +86,7 @@ Response createOrUpdateSync(@HostParam("endpoint") String endpoint, @Delete("/synonymmaps('{synonymMapName}')") @ExpectedResponses({ 204, 404 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> delete(@HostParam("endpoint") String endpoint, @PathParam("synonymMapName") String synonymMapName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("If-Match") String ifMatch, @@ -95,7 +95,7 @@ Mono> delete(@HostParam("endpoint") String endpoint, @Delete("/synonymmaps('{synonymMapName}')") @ExpectedResponses({ 204, 404 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response deleteSync(@HostParam("endpoint") String endpoint, @PathParam("synonymMapName") String synonymMapName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @HeaderParam("If-Match") String ifMatch, @@ -104,7 +104,7 @@ Response deleteSync(@HostParam("endpoint") String endpoint, @Get("/synonymmaps('{synonymMapName}')") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> get(@HostParam("endpoint") String endpoint, @PathParam("synonymMapName") String synonymMapName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @@ -112,7 +112,7 @@ Mono> get(@HostParam("endpoint") String endpoint, @Get("/synonymmaps('{synonymMapName}')") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response getSync(@HostParam("endpoint") String endpoint, @PathParam("synonymMapName") String synonymMapName, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @@ -120,21 +120,21 @@ Response getSync(@HostParam("endpoint") String endpoint, @Get("/synonymmaps") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("$select") String select, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Get("/synonymmaps") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("$select") String select, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Post("/synonymmaps") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> create(@HostParam("endpoint") String endpoint, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -142,7 +142,7 @@ Mono> create(@HostParam("endpoint") String endpoint, @Post("/synonymmaps") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(SearchErrorException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response createSync(@HostParam("endpoint") String endpoint, @HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -160,7 +160,7 @@ Response createSync(@HostParam("endpoint") String endpoint, * server does not match this value. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a synonym map definition along with {@link Response} on successful completion of {@link Mono}. */ @@ -191,7 +191,7 @@ public Mono> createOrUpdateWithResponseAsync(String synonym * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a synonym map definition along with {@link Response} on successful completion of {@link Mono}. */ @@ -220,7 +220,7 @@ public Mono> createOrUpdateWithResponseAsync(String synonym * server does not match this value. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a synonym map definition on successful completion of {@link Mono}. */ @@ -243,7 +243,7 @@ public Mono createOrUpdateAsync(String synonymMapName, SynonymMap sy * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a synonym map definition on successful completion of {@link Mono}. */ @@ -266,7 +266,7 @@ public Mono createOrUpdateAsync(String synonymMapName, SynonymMap sy * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a synonym map definition along with {@link Response}. */ @@ -295,7 +295,7 @@ public Response createOrUpdateWithResponse(String synonymMapName, Sy * server does not match this value. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a synonym map definition. */ @@ -316,7 +316,7 @@ public SynonymMap createOrUpdate(String synonymMapName, SynonymMap synonymMap, S * server does not match this value. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if 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}. */ @@ -344,7 +344,7 @@ public Mono> deleteWithResponseAsync(String synonymMapName, Strin * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if 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}. */ @@ -371,7 +371,7 @@ public Mono> deleteWithResponseAsync(String synonymMapName, Strin * server does not match this value. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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. */ @@ -393,7 +393,7 @@ public Mono deleteAsync(String synonymMapName, String ifMatch, String ifNo * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException 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. */ @@ -415,7 +415,7 @@ public Mono deleteAsync(String synonymMapName, String ifMatch, String ifNo * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @@ -442,7 +442,7 @@ public Response deleteWithResponse(String synonymMapName, String ifMatch, * server does not match this value. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -456,7 +456,7 @@ public void delete(String synonymMapName, String ifMatch, String ifNoneMatch, Re * @param synonymMapName The name of the synonym map to retrieve. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a synonym map definition along with {@link Response} on successful completion of {@link Mono}. */ @@ -479,7 +479,7 @@ public Mono> getWithResponseAsync(String synonymMapName, Re * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a synonym map definition along with {@link Response} on successful completion of {@link Mono}. */ @@ -502,7 +502,7 @@ public Mono> getWithResponseAsync(String synonymMapName, Re * @param synonymMapName The name of the synonym map to retrieve. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a synonym map definition on successful completion of {@link Mono}. */ @@ -518,7 +518,7 @@ public Mono getAsync(String synonymMapName, RequestOptions requestOp * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a synonym map definition on successful completion of {@link Mono}. */ @@ -535,7 +535,7 @@ public Mono getAsync(String synonymMapName, RequestOptions requestOp * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a synonym map definition along with {@link Response}. */ @@ -557,7 +557,7 @@ public Response getWithResponse(String synonymMapName, RequestOption * @param synonymMapName The name of the synonym map to retrieve. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a synonym map definition. */ @@ -573,7 +573,7 @@ public SynonymMap get(String synonymMapName, RequestOptions requestOptions) { * list of JSON property names, or '*' for all properties. The default is all properties. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List SynonymMaps request along with {@link Response} on successful completion of * {@link Mono}. @@ -598,7 +598,7 @@ public Mono> listWithResponseAsync(String select * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List SynonymMaps request along with {@link Response} on successful completion of * {@link Mono}. @@ -623,7 +623,7 @@ public Mono> listWithResponseAsync(String select * list of JSON property names, or '*' for all properties. The default is all properties. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List SynonymMaps request on successful completion of {@link Mono}. */ @@ -640,7 +640,7 @@ public Mono listAsync(String select, RequestOptions reque * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List SynonymMaps request on successful completion of {@link Mono}. */ @@ -657,7 +657,7 @@ public Mono listAsync(String select, RequestOptions reque * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List SynonymMaps request along with {@link Response}. */ @@ -681,7 +681,7 @@ public Response listWithResponse(String select, RequestOp * list of JSON property names, or '*' for all properties. The default is all properties. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response from a List SynonymMaps request. */ @@ -696,7 +696,7 @@ public ListSynonymMapsResult list(String select, RequestOptions requestOptions) * @param synonymMap The definition of the synonym map to create. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a synonym map definition along with {@link Response} on successful completion of {@link Mono}. */ @@ -719,7 +719,7 @@ public Mono> createWithResponseAsync(SynonymMap synonymMap, * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a synonym map definition along with {@link Response} on successful completion of {@link Mono}. */ @@ -742,7 +742,7 @@ public Mono> createWithResponseAsync(SynonymMap synonymMap, * @param synonymMap The definition of the synonym map to create. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a synonym map definition on successful completion of {@link Mono}. */ @@ -758,7 +758,7 @@ public Mono createAsync(SynonymMap synonymMap, RequestOptions reques * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a synonym map definition on successful completion of {@link Mono}. */ @@ -775,7 +775,7 @@ public Mono createAsync(SynonymMap synonymMap, RequestOptions reques * @param requestOptions Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a synonym map definition along with {@link Response}. */ @@ -798,7 +798,7 @@ public Response createWithResponse(SynonymMap synonymMap, RequestOpt * @param synonymMap The definition of the synonym map to create. * @param requestOptions Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws SearchErrorException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return represents a synonym map definition. */ diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/models/ErrorAdditionalInfo.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/models/ErrorAdditionalInfo.java new file mode 100644 index 0000000000000..7e2ebe6735850 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/models/ErrorAdditionalInfo.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package com.azure.search.documents.indexes.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 java.io.IOException; + +/** + * The resource management error additional info. + */ +@Immutable +public final class ErrorAdditionalInfo implements JsonSerializable { + /* + * The additional info type. + */ + private String type; + + /* + * The additional info. + */ + private Object info; + + /** + * Creates an instance of ErrorAdditionalInfo class. + */ + public ErrorAdditionalInfo() { + } + + /** + * Get the type property: The additional info type. + * + * @return the type value. + */ + public String getType() { + return this.type; + } + + /** + * Get the info property: The additional info. + * + * @return the info value. + */ + public Object getInfo() { + return this.info; + } + + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ErrorAdditionalInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ErrorAdditionalInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ErrorAdditionalInfo. + */ + public static ErrorAdditionalInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ErrorAdditionalInfo deserializedErrorAdditionalInfo = new ErrorAdditionalInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedErrorAdditionalInfo.type = reader.getString(); + } else if ("info".equals(fieldName)) { + deserializedErrorAdditionalInfo.info = reader.readUntyped(); + } else { + reader.skipChildren(); + } + } + + return deserializedErrorAdditionalInfo; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/models/ErrorDetail.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/models/ErrorDetail.java new file mode 100644 index 0000000000000..ac3ecce49150c --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/models/ErrorDetail.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package com.azure.search.documents.indexes.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 java.io.IOException; +import java.util.List; + +/** + * The error detail. + */ +@Immutable +public final class ErrorDetail implements JsonSerializable { + /* + * The error code. + */ + private String code; + + /* + * The error message. + */ + private String message; + + /* + * The error target. + */ + private String target; + + /* + * The error details. + */ + private List details; + + /* + * The error additional info. + */ + private List additionalInfo; + + /** + * Creates an instance of ErrorDetail class. + */ + public ErrorDetail() { + } + + /** + * Get the code property: The error code. + * + * @return the code value. + */ + public String getCode() { + return this.code; + } + + /** + * Get the message property: The error message. + * + * @return the message value. + */ + public String getMessage() { + return this.message; + } + + /** + * Get the target property: The error target. + * + * @return the target value. + */ + public String getTarget() { + return this.target; + } + + /** + * Get the details property: The error details. + * + * @return the details value. + */ + public List getDetails() { + return this.details; + } + + /** + * Get the additionalInfo property: The error additional info. + * + * @return the additionalInfo value. + */ + public List getAdditionalInfo() { + return this.additionalInfo; + } + + @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 ("target".equals(fieldName)) { + deserializedErrorDetail.target = reader.getString(); + } else if ("details".equals(fieldName)) { + List details = reader.readArray(reader1 -> ErrorDetail.fromJson(reader1)); + deserializedErrorDetail.details = details; + } else if ("additionalInfo".equals(fieldName)) { + List additionalInfo + = reader.readArray(reader1 -> ErrorAdditionalInfo.fromJson(reader1)); + deserializedErrorDetail.additionalInfo = additionalInfo; + } else { + reader.skipChildren(); + } + } + + return deserializedErrorDetail; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/models/ErrorResponse.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/models/ErrorResponse.java new file mode 100644 index 0000000000000..f414801b282dc --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/models/ErrorResponse.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package com.azure.search.documents.indexes.implementation.models; + +import com.azure.core.annotation.Fluent; +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 response + * + * Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also + * follows the OData error response format.). + */ +@Fluent +public final class ErrorResponse implements JsonSerializable { + /* + * The error object. + */ + private ErrorDetail error; + + /** + * Creates an instance of ErrorResponse class. + */ + public ErrorResponse() { + } + + /** + * Get the error property: The error object. + * + * @return the error value. + */ + public ErrorDetail getError() { + return this.error; + } + + /** + * Set the error property: The error object. + * + * @param error the error value to set. + * @return the ErrorResponse object itself. + */ + public ErrorResponse setError(ErrorDetail error) { + this.error = error; + return this; + } + + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("error", this.error); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ErrorResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ErrorResponse if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ErrorResponse. + */ + public static ErrorResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ErrorResponse deserializedErrorResponse = new ErrorResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("error".equals(fieldName)) { + deserializedErrorResponse.error = ErrorDetail.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedErrorResponse; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/models/ErrorResponseException.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/models/ErrorResponseException.java new file mode 100644 index 0000000000000..a83cabce5e5cb --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/models/ErrorResponseException.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package com.azure.search.documents.indexes.implementation.models; + +import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.HttpResponse; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public final class ErrorResponseException extends HttpResponseException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available. + * @param response the HTTP response. + */ + public ErrorResponseException(String message, HttpResponse response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException 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 ErrorResponseException(String message, HttpResponse response, ErrorResponse value) { + super(message, response, value); + } + + /** + * {@inheritDoc} + */ + @Override + public ErrorResponse getValue() { + return (ErrorResponse) super.getValue(); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/models/ScalarQuantizationCompressionConfiguration.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/models/ScalarQuantizationCompressionConfiguration.java new file mode 100644 index 0000000000000..507000eddcc25 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/models/ScalarQuantizationCompressionConfiguration.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package com.azure.search.documents.indexes.implementation.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.search.documents.indexes.models.VectorSearchCompressionConfiguration; +import com.azure.search.documents.indexes.models.VectorSearchCompressionKind; +import java.io.IOException; + +/** + * Contains configuration options specific to the scalar quantization compression method used during indexing and + * querying. + */ +@Fluent +public final class ScalarQuantizationCompressionConfiguration extends VectorSearchCompressionConfiguration { + /* + * Contains the parameters specific to Scalar Quantization. + */ + private ScalarQuantizationParameters parameters; + + /** + * Creates an instance of ScalarQuantizationCompressionConfiguration class. + * + * @param name the name value to set. + */ + public ScalarQuantizationCompressionConfiguration(String name) { + super(name); + } + + /** + * Get the parameters property: Contains the parameters specific to Scalar Quantization. + * + * @return the parameters value. + */ + public ScalarQuantizationParameters getParameters() { + return this.parameters; + } + + /** + * Set the parameters property: Contains the parameters specific to Scalar Quantization. + * + * @param parameters the parameters value to set. + * @return the ScalarQuantizationCompressionConfiguration object itself. + */ + public ScalarQuantizationCompressionConfiguration setParameters(ScalarQuantizationParameters parameters) { + this.parameters = parameters; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ScalarQuantizationCompressionConfiguration setRerankWithOriginalVectors(Boolean rerankWithOriginalVectors) { + super.setRerankWithOriginalVectors(rerankWithOriginalVectors); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ScalarQuantizationCompressionConfiguration setDefaultOversampling(Double defaultOversampling) { + super.setDefaultOversampling(defaultOversampling); + return this; + } + + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", VectorSearchCompressionKind.SCALAR_QUANTIZATION == null ? null + : VectorSearchCompressionKind.SCALAR_QUANTIZATION.toString()); + jsonWriter.writeStringField("name", getName()); + jsonWriter.writeBooleanField("rerankWithOriginalVectors", isRerankWithOriginalVectors()); + jsonWriter.writeNumberField("defaultOversampling", getDefaultOversampling()); + jsonWriter.writeJsonField("scalarQuantizationParameters", this.parameters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScalarQuantizationCompressionConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScalarQuantizationCompressionConfiguration if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties or the + * polymorphic discriminator. + * @throws IOException If an error occurs while reading the ScalarQuantizationCompressionConfiguration. + */ + public static ScalarQuantizationCompressionConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + boolean nameFound = false; + String name = null; + Boolean rerankWithOriginalVectors = null; + Double defaultOversampling = null; + ScalarQuantizationParameters parameters = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + String kind = reader.getString(); + if (!"scalarQuantization".equals(kind)) { + throw new IllegalStateException( + "'kind' was expected to be non-null and equal to 'scalarQuantization'. The found 'kind' was '" + + kind + "'."); + } + } else if ("name".equals(fieldName)) { + name = reader.getString(); + nameFound = true; + } else if ("rerankWithOriginalVectors".equals(fieldName)) { + rerankWithOriginalVectors = reader.getNullable(JsonReader::getBoolean); + } else if ("defaultOversampling".equals(fieldName)) { + defaultOversampling = reader.getNullable(JsonReader::getDouble); + } else if ("scalarQuantizationParameters".equals(fieldName)) { + parameters = ScalarQuantizationParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + if (nameFound) { + ScalarQuantizationCompressionConfiguration deserializedScalarQuantizationCompressionConfiguration + = new ScalarQuantizationCompressionConfiguration(name); + deserializedScalarQuantizationCompressionConfiguration + .setRerankWithOriginalVectors(rerankWithOriginalVectors); + deserializedScalarQuantizationCompressionConfiguration.setDefaultOversampling(defaultOversampling); + deserializedScalarQuantizationCompressionConfiguration.parameters = parameters; + + return deserializedScalarQuantizationCompressionConfiguration; + } + throw new IllegalStateException("Missing required property: name"); + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/models/ScalarQuantizationParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/models/ScalarQuantizationParameters.java new file mode 100644 index 0000000000000..04e15571cc138 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/models/ScalarQuantizationParameters.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package com.azure.search.documents.indexes.implementation.models; + +import com.azure.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.search.documents.indexes.models.VectorSearchCompressionTargetDataType; +import java.io.IOException; + +/** + * Contains the parameters specific to Scalar Quantization. + */ +@Fluent +public final class ScalarQuantizationParameters implements JsonSerializable { + /* + * The quantized data type of compressed vector values. + */ + private VectorSearchCompressionTargetDataType quantizedDataType; + + /** + * Creates an instance of ScalarQuantizationParameters class. + */ + public ScalarQuantizationParameters() { + } + + /** + * Get the quantizedDataType property: The quantized data type of compressed vector values. + * + * @return the quantizedDataType value. + */ + public VectorSearchCompressionTargetDataType getQuantizedDataType() { + return this.quantizedDataType; + } + + /** + * Set the quantizedDataType property: The quantized data type of compressed vector values. + * + * @param quantizedDataType the quantizedDataType value to set. + * @return the ScalarQuantizationParameters object itself. + */ + public ScalarQuantizationParameters setQuantizedDataType(VectorSearchCompressionTargetDataType quantizedDataType) { + this.quantizedDataType = quantizedDataType; + return this; + } + + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("quantizedDataType", + this.quantizedDataType == null ? null : this.quantizedDataType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScalarQuantizationParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScalarQuantizationParameters if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ScalarQuantizationParameters. + */ + public static ScalarQuantizationParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScalarQuantizationParameters deserializedScalarQuantizationParameters = new ScalarQuantizationParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("quantizedDataType".equals(fieldName)) { + deserializedScalarQuantizationParameters.quantizedDataType + = VectorSearchCompressionTargetDataType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedScalarQuantizationParameters; + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/CustomWebApiParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/CustomWebApiParameters.java index 877a1953fcace..5deb2a5c8902c 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/CustomWebApiParameters.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/CustomWebApiParameters.java @@ -44,7 +44,7 @@ public final class CustomWebApiParameters implements JsonSerializable getHttpHeaders() { @@ -94,7 +94,7 @@ public Map getHttpHeaders() { /** * Set the httpHeaders property: The headers required to make the HTTP request. - * + * * @param httpHeaders the httpHeaders value to set. * @return the CustomWebApiParameters object itself. */ @@ -105,7 +105,7 @@ public CustomWebApiParameters setHttpHeaders(Map httpHeaders) { /** * Get the httpMethod property: The method for the HTTP request. - * + * * @return the httpMethod value. */ public String getHttpMethod() { @@ -114,7 +114,7 @@ public String getHttpMethod() { /** * Set the httpMethod property: The method for the HTTP request. - * + * * @param httpMethod the httpMethod value to set. * @return the CustomWebApiParameters object itself. */ @@ -125,7 +125,7 @@ public CustomWebApiParameters setHttpMethod(String httpMethod) { /** * Get the timeout property: The desired timeout for the request. Default is 30 seconds. - * + * * @return the timeout value. */ public Duration getTimeout() { @@ -134,7 +134,7 @@ public Duration getTimeout() { /** * Set the timeout property: The desired timeout for the request. Default is 30 seconds. - * + * * @param timeout the timeout value to set. * @return the CustomWebApiParameters object itself. */ @@ -146,11 +146,11 @@ public CustomWebApiParameters setTimeout(Duration timeout) { /** * Get the authResourceId property: Applies to custom endpoints that connect to external code in an Azure function * or some other application that provides the transformations. This value should be the application ID created for - * the function or app when it was registered with Microsoft Entra ID. When specified, the vectorization + * the function or app when it was registered with Azure Active Directory. When specified, the vectorization * connects to the function or app using a managed ID (either system or user-assigned) of the search service and * the access token of the function or app, using this value as the resource id for creating the scope of the * access token. - * + * * @return the authResourceId value. */ public String getAuthResourceId() { @@ -160,11 +160,11 @@ public String getAuthResourceId() { /** * Set the authResourceId property: Applies to custom endpoints that connect to external code in an Azure function * or some other application that provides the transformations. This value should be the application ID created for - * the function or app when it was registered with Microsoft Entra ID. When specified, the vectorization + * the function or app when it was registered with Azure Active Directory. When specified, the vectorization * connects to the function or app using a managed ID (either system or user-assigned) of the search service and * the access token of the function or app, using this value as the resource id for creating the scope of the * access token. - * + * * @param authResourceId the authResourceId value to set. * @return the CustomWebApiParameters object itself. */ @@ -178,7 +178,7 @@ public CustomWebApiParameters setAuthResourceId(String authResourceId) { * authResourceId is provided and it's not specified, the system-assigned managed identity is used. On updates to * the indexer, if the identity is unspecified, the value remains unchanged. If set to "none", the value of this * property is cleared. - * + * * @return the authIdentity value. */ public SearchIndexerDataIdentity getAuthIdentity() { @@ -190,7 +190,7 @@ public SearchIndexerDataIdentity getAuthIdentity() { * authResourceId is provided and it's not specified, the system-assigned managed identity is used. On updates to * the indexer, if the identity is unspecified, the value remains unchanged. If set to "none", the value of this * property is cleared. - * + * * @param authIdentity the authIdentity value to set. * @return the CustomWebApiParameters object itself. */ @@ -213,7 +213,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of CustomWebApiParameters from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of CustomWebApiParameters if the JsonReader was pointing to an instance of it, or null if it * was pointing to JSON null. diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchField.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchField.java index 5f47b7494981d..9c01243c67e40 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchField.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchField.java @@ -46,6 +46,17 @@ public final class SearchField implements JsonSerializable { */ private Boolean hidden; + /* + * An immutable value indicating whether the field will be persisted separately on disk to be returned in a search + * result. You can disable this option if you don't plan to return the field contents in a search response to save + * on storage overhead. This can only be set during index creation and only for vector fields. This property cannot + * be changed for existing fields or set as false for new fields. If this property is set as false, the property + * 'retrievable' must also be set to false. This property must be true or unset for key fields, for new fields, and + * for non-vector fields, and it must be null for complex fields. Disabling this property will reduce index storage + * requirements. The default is true for vector fields. + */ + private Boolean stored; + /* * A value indicating whether the field is full-text searchable. This means it will undergo analysis such as * word-breaking during indexing. If you set a searchable field to a value like "sunny day", internally it will be @@ -226,6 +237,38 @@ public SearchField setHidden(Boolean hidden) { return this; } + /** + * Get the stored property: An immutable value indicating whether the field will be persisted separately on disk to + * be returned in a search result. You can disable this option if you don't plan to return the field contents in a + * search response to save on storage overhead. This can only be set during index creation and only for vector + * fields. This property cannot be changed for existing fields or set as false for new fields. If this property is + * set as false, the property 'retrievable' must also be set to false. This property must be true or unset for key + * fields, for new fields, and for non-vector fields, and it must be null for complex fields. Disabling this + * property will reduce index storage requirements. The default is true for vector fields. + * + * @return the stored value. + */ + public Boolean isStored() { + return this.stored; + } + + /** + * Set the stored property: An immutable value indicating whether the field will be persisted separately on disk to + * be returned in a search result. You can disable this option if you don't plan to return the field contents in a + * search response to save on storage overhead. This can only be set during index creation and only for vector + * fields. This property cannot be changed for existing fields or set as false for new fields. If this property is + * set as false, the property 'retrievable' must also be set to false. This property must be true or unset for key + * fields, for new fields, and for non-vector fields, and it must be null for complex fields. Disabling this + * property will reduce index storage requirements. The default is true for vector fields. + * + * @param stored the stored value to set. + * @return the SearchField object itself. + */ + public SearchField setStored(Boolean stored) { + this.stored = stored; + return this; + } + /** * Get the searchable property: A value indicating whether the field is full-text searchable. This means it will * undergo analysis such as word-breaking during indexing. If you set a searchable field to a value like "sunny @@ -557,6 +600,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); jsonWriter.writeBooleanField("key", this.key); jsonWriter.writeBooleanField("retrievable", this.hidden); + jsonWriter.writeBooleanField("stored", this.stored); jsonWriter.writeBooleanField("searchable", this.searchable); jsonWriter.writeBooleanField("filterable", this.filterable); jsonWriter.writeBooleanField("sortable", this.sortable); @@ -592,6 +636,7 @@ public static SearchField fromJson(JsonReader jsonReader) throws IOException { SearchFieldDataType type = null; Boolean key = null; Boolean hidden = null; + Boolean stored = null; Boolean searchable = null; Boolean filterable = null; Boolean sortable = null; @@ -617,6 +662,8 @@ public static SearchField fromJson(JsonReader jsonReader) throws IOException { key = reader.getNullable(JsonReader::getBoolean); } else if ("retrievable".equals(fieldName)) { hidden = reader.getNullable(JsonReader::getBoolean); + } else if ("stored".equals(fieldName)) { + stored = reader.getNullable(JsonReader::getBoolean); } else if ("searchable".equals(fieldName)) { searchable = reader.getNullable(JsonReader::getBoolean); } else if ("filterable".equals(fieldName)) { @@ -649,6 +696,7 @@ public static SearchField fromJson(JsonReader jsonReader) throws IOException { SearchField deserializedSearchField = new SearchField(name, type); deserializedSearchField.key = key; deserializedSearchField.hidden = hidden; + deserializedSearchField.stored = stored; deserializedSearchField.searchable = searchable; deserializedSearchField.filterable = filterable; deserializedSearchField.sortable = sortable; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchFieldDataType.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchFieldDataType.java index 05eaed97d98e4..cd4bfc06a1864 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchFieldDataType.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchFieldDataType.java @@ -59,6 +59,22 @@ public final class SearchFieldDataType extends ExpandableStringEnum { */ private List vectorizers; + /* + * Contains configuration options specific to the compression method used during indexing or querying. + */ + private List compressions; + /** * Creates an instance of VectorSearch class. */ @@ -102,12 +107,35 @@ public VectorSearch setVectorizers(List vectorizers) { return this; } + /** + * Get the compressions property: Contains configuration options specific to the compression method used during + * indexing or querying. + * + * @return the compressions value. + */ + public List getCompressions() { + return this.compressions; + } + + /** + * Set the compressions property: Contains configuration options specific to the compression method used during + * indexing or querying. + * + * @param compressions the compressions value to set. + * @return the VectorSearch object itself. + */ + public VectorSearch setCompressions(List compressions) { + this.compressions = compressions; + return this; + } + @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("profiles", this.profiles, (writer, element) -> writer.writeJson(element)); jsonWriter.writeArrayField("algorithms", this.algorithms, (writer, element) -> writer.writeJson(element)); jsonWriter.writeArrayField("vectorizers", this.vectorizers, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("compressions", this.compressions, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -137,6 +165,10 @@ public static VectorSearch fromJson(JsonReader jsonReader) throws IOException { List vectorizers = reader.readArray(reader1 -> VectorSearchVectorizer.fromJson(reader1)); deserializedVectorSearch.vectorizers = vectorizers; + } else if ("compressions".equals(fieldName)) { + List compressions + = reader.readArray(reader1 -> VectorSearchCompressionConfiguration.fromJson(reader1)); + deserializedVectorSearch.compressions = compressions; } else { reader.skipChildren(); } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchCompressionConfiguration.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchCompressionConfiguration.java new file mode 100644 index 0000000000000..7ec3a16f252fb --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchCompressionConfiguration.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package com.azure.search.documents.indexes.models; + +import com.azure.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.search.documents.indexes.implementation.models.ScalarQuantizationCompressionConfiguration; +import java.io.IOException; + +/** + * Contains configuration options specific to the compression method used during indexing or querying. + */ +@Fluent +public class VectorSearchCompressionConfiguration implements JsonSerializable { + /* + * The name to associate with this particular configuration. + */ + private final String name; + + /* + * If set to true, once the ordered set of results calculated using compressed vectors are obtained, they will be + * reranked again by recalculating the full-precision similarity scores. This will improve recall at the expense of + * latency. + */ + private Boolean rerankWithOriginalVectors; + + /* + * Default oversampling factor. Oversampling will internally request more documents (specified by this multiplier) + * in the initial search. This increases the set of results that will be reranked using recomputed similarity + * scores from full-precision vectors. Minimum value is 1, meaning no oversampling (1x). This parameter can only be + * set when rerankWithOriginalVectors is true. Higher values improve recall at the expense of latency. + */ + private Double defaultOversampling; + + /** + * Creates an instance of VectorSearchCompressionConfiguration class. + * + * @param name the name value to set. + */ + public VectorSearchCompressionConfiguration(String name) { + this.name = name; + } + + /** + * Get the name property: The name to associate with this particular configuration. + * + * @return the name value. + */ + public String getName() { + return this.name; + } + + /** + * Get the rerankWithOriginalVectors property: If set to true, once the ordered set of results calculated using + * compressed vectors are obtained, they will be reranked again by recalculating the full-precision similarity + * scores. This will improve recall at the expense of latency. + * + * @return the rerankWithOriginalVectors value. + */ + public Boolean isRerankWithOriginalVectors() { + return this.rerankWithOriginalVectors; + } + + /** + * Set the rerankWithOriginalVectors property: If set to true, once the ordered set of results calculated using + * compressed vectors are obtained, they will be reranked again by recalculating the full-precision similarity + * scores. This will improve recall at the expense of latency. + * + * @param rerankWithOriginalVectors the rerankWithOriginalVectors value to set. + * @return the VectorSearchCompressionConfiguration object itself. + */ + public VectorSearchCompressionConfiguration setRerankWithOriginalVectors(Boolean rerankWithOriginalVectors) { + this.rerankWithOriginalVectors = rerankWithOriginalVectors; + return this; + } + + /** + * Get the defaultOversampling property: Default oversampling factor. Oversampling will internally request more + * documents (specified by this multiplier) in the initial search. This increases the set of results that will be + * reranked using recomputed similarity scores from full-precision vectors. Minimum value is 1, meaning no + * oversampling (1x). This parameter can only be set when rerankWithOriginalVectors is true. Higher values improve + * recall at the expense of latency. + * + * @return the defaultOversampling value. + */ + public Double getDefaultOversampling() { + return this.defaultOversampling; + } + + /** + * Set the defaultOversampling property: Default oversampling factor. Oversampling will internally request more + * documents (specified by this multiplier) in the initial search. This increases the set of results that will be + * reranked using recomputed similarity scores from full-precision vectors. Minimum value is 1, meaning no + * oversampling (1x). This parameter can only be set when rerankWithOriginalVectors is true. Higher values improve + * recall at the expense of latency. + * + * @param defaultOversampling the defaultOversampling value to set. + * @return the VectorSearchCompressionConfiguration object itself. + */ + public VectorSearchCompressionConfiguration setDefaultOversampling(Double defaultOversampling) { + this.defaultOversampling = defaultOversampling; + return this; + } + + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeBooleanField("rerankWithOriginalVectors", this.rerankWithOriginalVectors); + jsonWriter.writeNumberField("defaultOversampling", this.defaultOversampling); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VectorSearchCompressionConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VectorSearchCompressionConfiguration if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties or the + * polymorphic discriminator. + * @throws IOException If an error occurs while reading the VectorSearchCompressionConfiguration. + */ + public static VectorSearchCompressionConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + 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 ("scalarQuantization".equals(discriminatorValue)) { + return ScalarQuantizationCompressionConfiguration.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + }); + } + + static VectorSearchCompressionConfiguration fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + boolean nameFound = false; + String name = null; + Boolean rerankWithOriginalVectors = null; + Double defaultOversampling = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + name = reader.getString(); + nameFound = true; + } else if ("rerankWithOriginalVectors".equals(fieldName)) { + rerankWithOriginalVectors = reader.getNullable(JsonReader::getBoolean); + } else if ("defaultOversampling".equals(fieldName)) { + defaultOversampling = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + if (nameFound) { + VectorSearchCompressionConfiguration deserializedVectorSearchCompressionConfiguration + = new VectorSearchCompressionConfiguration(name); + deserializedVectorSearchCompressionConfiguration.rerankWithOriginalVectors = rerankWithOriginalVectors; + deserializedVectorSearchCompressionConfiguration.defaultOversampling = defaultOversampling; + + return deserializedVectorSearchCompressionConfiguration; + } + throw new IllegalStateException("Missing required property: name"); + }); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchCompressionKind.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchCompressionKind.java new file mode 100644 index 0000000000000..2563c7e698571 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchCompressionKind.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package com.azure.search.documents.indexes.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The compression method used for indexing and querying. + */ +public final class VectorSearchCompressionKind extends ExpandableStringEnum { + /** + * Scalar Quantization, a type of compression method. In scalar quantization, the original vectors values are + * compressed to a narrower type by discretizing and representing each component of a vector using a reduced set of + * quantized values, thereby reducing the overall data size. + */ + public static final VectorSearchCompressionKind SCALAR_QUANTIZATION = fromString("scalarQuantization"); + + /** + * Creates a new instance of VectorSearchCompressionKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VectorSearchCompressionKind() { + } + + /** + * Creates or finds a VectorSearchCompressionKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding VectorSearchCompressionKind. + */ + public static VectorSearchCompressionKind fromString(String name) { + return fromString(name, VectorSearchCompressionKind.class); + } + + /** + * Gets known VectorSearchCompressionKind values. + * + * @return known VectorSearchCompressionKind values. + */ + public static Collection values() { + return values(VectorSearchCompressionKind.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchCompressionTargetDataType.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchCompressionTargetDataType.java new file mode 100644 index 0000000000000..d3bc63dceea21 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchCompressionTargetDataType.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package com.azure.search.documents.indexes.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The quantized data type of compressed vector values. + */ +public final class VectorSearchCompressionTargetDataType + extends ExpandableStringEnum { + /** + * Static value int8 for VectorSearchCompressionTargetDataType. + */ + public static final VectorSearchCompressionTargetDataType INT8 = fromString("int8"); + + /** + * Creates a new instance of VectorSearchCompressionTargetDataType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VectorSearchCompressionTargetDataType() { + } + + /** + * Creates or finds a VectorSearchCompressionTargetDataType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VectorSearchCompressionTargetDataType. + */ + public static VectorSearchCompressionTargetDataType fromString(String name) { + return fromString(name, VectorSearchCompressionTargetDataType.class); + } + + /** + * Gets known VectorSearchCompressionTargetDataType values. + * + * @return known VectorSearchCompressionTargetDataType values. + */ + public static Collection values() { + return values(VectorSearchCompressionTargetDataType.class); + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchProfile.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchProfile.java index cf5c28bbdd723..7308fc28cede6 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchProfile.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchProfile.java @@ -35,6 +35,11 @@ public final class VectorSearchProfile implements JsonSerializable inputs, List getHttpHeaders() { @@ -100,7 +100,7 @@ public Map getHttpHeaders() { /** * Set the httpHeaders property: The headers required to make the http request. - * + * * @param httpHeaders the httpHeaders value to set. * @return the WebApiSkill object itself. */ @@ -111,7 +111,7 @@ public WebApiSkill setHttpHeaders(Map httpHeaders) { /** * Get the httpMethod property: The method for the http request. - * + * * @return the httpMethod value. */ public String getHttpMethod() { @@ -120,7 +120,7 @@ public String getHttpMethod() { /** * Set the httpMethod property: The method for the http request. - * + * * @param httpMethod the httpMethod value to set. * @return the WebApiSkill object itself. */ @@ -131,7 +131,7 @@ public WebApiSkill setHttpMethod(String httpMethod) { /** * Get the timeout property: The desired timeout for the request. Default is 30 seconds. - * + * * @return the timeout value. */ public Duration getTimeout() { @@ -140,7 +140,7 @@ public Duration getTimeout() { /** * Set the timeout property: The desired timeout for the request. Default is 30 seconds. - * + * * @param timeout the timeout value to set. * @return the WebApiSkill object itself. */ @@ -151,7 +151,7 @@ public WebApiSkill setTimeout(Duration timeout) { /** * Get the batchSize property: The desired batch size which indicates number of documents. - * + * * @return the batchSize value. */ public Integer getBatchSize() { @@ -160,7 +160,7 @@ public Integer getBatchSize() { /** * Set the batchSize property: The desired batch size which indicates number of documents. - * + * * @param batchSize the batchSize value to set. * @return the WebApiSkill object itself. */ @@ -171,7 +171,7 @@ public WebApiSkill setBatchSize(Integer batchSize) { /** * Get the degreeOfParallelism property: If set, the number of parallel calls that can be made to the Web API. - * + * * @return the degreeOfParallelism value. */ public Integer getDegreeOfParallelism() { @@ -180,7 +180,7 @@ public Integer getDegreeOfParallelism() { /** * Set the degreeOfParallelism property: If set, the number of parallel calls that can be made to the Web API. - * + * * @param degreeOfParallelism the degreeOfParallelism value to set. * @return the WebApiSkill object itself. */ @@ -192,11 +192,11 @@ public WebApiSkill setDegreeOfParallelism(Integer degreeOfParallelism) { /** * Get the authResourceId property: Applies to custom skills that connect to external code in an Azure function or * some other application that provides the transformations. This value should be the application ID created for - * the function or app when it was registered with Microsoft Entra ID. When specified, the custom skill + * the function or app when it was registered with Azure Active Directory. When specified, the custom skill * connects to the function or app using a managed ID (either system or user-assigned) of the search service and * the access token of the function or app, using this value as the resource id for creating the scope of the * access token. - * + * * @return the authResourceId value. */ public String getAuthResourceId() { @@ -206,11 +206,11 @@ public String getAuthResourceId() { /** * Set the authResourceId property: Applies to custom skills that connect to external code in an Azure function or * some other application that provides the transformations. This value should be the application ID created for - * the function or app when it was registered with Microsoft Entra ID. When specified, the custom skill + * the function or app when it was registered with Azure Active Directory. When specified, the custom skill * connects to the function or app using a managed ID (either system or user-assigned) of the search service and * the access token of the function or app, using this value as the resource id for creating the scope of the * access token. - * + * * @param authResourceId the authResourceId value to set. * @return the WebApiSkill object itself. */ @@ -224,7 +224,7 @@ public WebApiSkill setAuthResourceId(String authResourceId) { * authResourceId is provided and it's not specified, the system-assigned managed identity is used. On updates to * the indexer, if the identity is unspecified, the value remains unchanged. If set to "none", the value of this * property is cleared. - * + * * @return the authIdentity value. */ public SearchIndexerDataIdentity getAuthIdentity() { @@ -236,7 +236,7 @@ public SearchIndexerDataIdentity getAuthIdentity() { * authResourceId is provided and it's not specified, the system-assigned managed identity is used. On updates to * the indexer, if the identity is unspecified, the value remains unchanged. If set to "none", the value of this * property is cleared. - * + * * @param authIdentity the authIdentity value to set. * @return the WebApiSkill object itself. */ @@ -294,7 +294,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of WebApiSkill from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of WebApiSkill if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorQuery.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorQuery.java index a7e40f8d95b8d..17e5acba8ef50 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorQuery.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorQuery.java @@ -34,6 +34,13 @@ public class VectorQuery implements JsonSerializable { */ private Boolean exhaustive; + /* + * Oversampling factor. Minimum value is 1. It overrides the 'defaultOversampling' parameter configured in the + * index definition. It can be set only when 'rerankWithOriginalVectors' is true. This parameter is only permitted + * when a compression method is used on the underlying vector field. + */ + private Double oversampling; + /** * Creates an instance of VectorQuery class. */ @@ -104,12 +111,37 @@ public VectorQuery setExhaustive(Boolean exhaustive) { return this; } + /** + * Get the oversampling property: Oversampling factor. Minimum value is 1. It overrides the 'defaultOversampling' + * parameter configured in the index definition. It can be set only when 'rerankWithOriginalVectors' is true. This + * parameter is only permitted when a compression method is used on the underlying vector field. + * + * @return the oversampling value. + */ + public Double getOversampling() { + return this.oversampling; + } + + /** + * Set the oversampling property: Oversampling factor. Minimum value is 1. It overrides the 'defaultOversampling' + * parameter configured in the index definition. It can be set only when 'rerankWithOriginalVectors' is true. This + * parameter is only permitted when a compression method is used on the underlying vector field. + * + * @param oversampling the oversampling value to set. + * @return the VectorQuery object itself. + */ + public VectorQuery setOversampling(Double oversampling) { + this.oversampling = oversampling; + return this; + } + @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeNumberField("k", this.kNearestNeighborsCount); jsonWriter.writeStringField("fields", this.fields); jsonWriter.writeBooleanField("exhaustive", this.exhaustive); + jsonWriter.writeNumberField("oversampling", this.oversampling); return jsonWriter.writeEndObject(); } @@ -161,6 +193,8 @@ static VectorQuery fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOEx deserializedVectorQuery.fields = reader.getString(); } else if ("exhaustive".equals(fieldName)) { deserializedVectorQuery.exhaustive = reader.getNullable(JsonReader::getBoolean); + } else if ("oversampling".equals(fieldName)) { + deserializedVectorQuery.oversampling = reader.getNullable(JsonReader::getDouble); } else { reader.skipChildren(); } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorizableTextQuery.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorizableTextQuery.java index eea1b77128fbb..b9be6cf439a8d 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorizableTextQuery.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorizableTextQuery.java @@ -68,6 +68,15 @@ public VectorizableTextQuery setExhaustive(Boolean exhaustive) { return this; } + /** + * {@inheritDoc} + */ + @Override + public VectorizableTextQuery setOversampling(Double oversampling) { + super.setOversampling(oversampling); + return this; + } + @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); @@ -75,6 +84,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeNumberField("k", getKNearestNeighborsCount()); jsonWriter.writeStringField("fields", getFields()); jsonWriter.writeBooleanField("exhaustive", isExhaustive()); + jsonWriter.writeNumberField("oversampling", getOversampling()); jsonWriter.writeStringField("text", this.text); return jsonWriter.writeEndObject(); } @@ -94,6 +104,7 @@ public static VectorizableTextQuery fromJson(JsonReader jsonReader) throws IOExc Integer kNearestNeighborsCount = null; String fields = null; Boolean exhaustive = null; + Double oversampling = null; boolean textFound = false; String text = null; while (reader.nextToken() != JsonToken.END_OBJECT) { @@ -112,6 +123,8 @@ public static VectorizableTextQuery fromJson(JsonReader jsonReader) throws IOExc fields = reader.getString(); } else if ("exhaustive".equals(fieldName)) { exhaustive = reader.getNullable(JsonReader::getBoolean); + } else if ("oversampling".equals(fieldName)) { + oversampling = reader.getNullable(JsonReader::getDouble); } else if ("text".equals(fieldName)) { text = reader.getString(); textFound = true; @@ -124,6 +137,7 @@ public static VectorizableTextQuery fromJson(JsonReader jsonReader) throws IOExc deserializedVectorizableTextQuery.setKNearestNeighborsCount(kNearestNeighborsCount); deserializedVectorizableTextQuery.setFields(fields); deserializedVectorizableTextQuery.setExhaustive(exhaustive); + deserializedVectorizableTextQuery.setOversampling(oversampling); return deserializedVectorizableTextQuery; } throw new IllegalStateException("Missing required property: text"); diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorizedQuery.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorizedQuery.java index 5c0b476c36e61..b523b504ccd87 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorizedQuery.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/VectorizedQuery.java @@ -69,6 +69,15 @@ public VectorizedQuery setExhaustive(Boolean exhaustive) { return this; } + /** + * {@inheritDoc} + */ + @Override + public VectorizedQuery setOversampling(Double oversampling) { + super.setOversampling(oversampling); + return this; + } + @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); @@ -76,6 +85,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeNumberField("k", getKNearestNeighborsCount()); jsonWriter.writeStringField("fields", getFields()); jsonWriter.writeBooleanField("exhaustive", isExhaustive()); + jsonWriter.writeNumberField("oversampling", getOversampling()); jsonWriter.writeArrayField("vector", this.vector, (writer, element) -> writer.writeFloat(element)); return jsonWriter.writeEndObject(); } @@ -95,6 +105,7 @@ public static VectorizedQuery fromJson(JsonReader jsonReader) throws IOException Integer kNearestNeighborsCount = null; String fields = null; Boolean exhaustive = null; + Double oversampling = null; boolean vectorFound = false; List vector = null; while (reader.nextToken() != JsonToken.END_OBJECT) { @@ -113,6 +124,8 @@ public static VectorizedQuery fromJson(JsonReader jsonReader) throws IOException fields = reader.getString(); } else if ("exhaustive".equals(fieldName)) { exhaustive = reader.getNullable(JsonReader::getBoolean); + } else if ("oversampling".equals(fieldName)) { + oversampling = reader.getNullable(JsonReader::getDouble); } else if ("vector".equals(fieldName)) { vector = reader.readArray(reader1 -> reader1.getFloat()); vectorFound = true; @@ -125,6 +138,7 @@ public static VectorizedQuery fromJson(JsonReader jsonReader) throws IOException deserializedVectorizedQuery.setKNearestNeighborsCount(kNearestNeighborsCount); deserializedVectorizedQuery.setFields(fields); deserializedVectorizedQuery.setExhaustive(exhaustive); + deserializedVectorizedQuery.setOversampling(oversampling); return deserializedVectorizedQuery; } throw new IllegalStateException("Missing required property: vector"); diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/VectorSearchTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/VectorSearchTests.java index 0d6e6a9763053..1c64d6641b213 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/VectorSearchTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/VectorSearchTests.java @@ -357,6 +357,7 @@ public void updateExistingIndexToAddVectorFieldsAsync() { SearchField vectorField = new SearchField("DescriptionVector", SearchFieldDataType.collection(SearchFieldDataType.SINGLE)) .setSearchable(true) + .setHidden(false) .setVectorSearchDimensions(1536) .setVectorSearchProfileName("my-vector-profile"); @@ -449,6 +450,7 @@ public void updateExistingIndexToAddVectorFieldsSync() { SearchField vectorField = new SearchField("DescriptionVector", SearchFieldDataType.collection(SearchFieldDataType.SINGLE)) .setSearchable(true) + .setHidden(false) .setVectorSearchDimensions(1536) .setVectorSearchProfileName("my-vector-profile"); diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/FieldBuilderTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/FieldBuilderTests.java index a6f45f285539e..7aad823cce5f8 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/FieldBuilderTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/FieldBuilderTests.java @@ -17,7 +17,6 @@ import com.azure.search.documents.test.environment.models.HotelWithArray; import com.azure.search.documents.test.environment.models.HotelWithEmptyInSynonymMaps; import com.azure.search.documents.test.environment.models.HotelWithIgnoredFields; -import com.azure.search.documents.test.environment.models.HotelWithUnsupportedField; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; @@ -72,6 +71,7 @@ public void hotelWithEmptySynonymMaps() { SearchFieldDataType.collection(SearchFieldDataType.STRING)) .setSearchable(true) .setKey(false) + .setStored(true) .setHidden(false) .setFilterable(false) .setSortable(false) @@ -126,7 +126,7 @@ public void ignoredPropertyName() { public void supportedFields() { List fields = SearchIndexClient.buildSearchFields(AllSupportedFields.class, null); - assertEquals(19, fields.size()); + assertEquals(23, fields.size()); Map fieldToDataType = fields.stream() .collect(Collectors.toMap(SearchField::getName, SearchField::getType)); @@ -150,6 +150,10 @@ public void supportedFields() { assertEquals(SearchFieldDataType.collection(SearchFieldDataType.INT32), fieldToDataType.get("intList")); assertEquals(SearchFieldDataType.collection(SearchFieldDataType.SINGLE), fieldToDataType.get("floatArray")); assertEquals(SearchFieldDataType.collection(SearchFieldDataType.SINGLE), fieldToDataType.get("floatList")); + assertEquals(SearchFieldDataType.INT16, fieldToDataType.get("nullableShort")); + assertEquals(SearchFieldDataType.INT16, fieldToDataType.get("primitiveShort")); + assertEquals(SearchFieldDataType.SBYTE, fieldToDataType.get("nullableByte")); + assertEquals(SearchFieldDataType.SBYTE, fieldToDataType.get("primitiveByte")); } @SuppressWarnings({"unused", "UseOfObsoleteDateTimeApi"}) @@ -268,15 +272,31 @@ public List getFloatList() { public Float[] getFloatArray() { return floatArray; } - } - @Test - public void unsupportedFields() { - Exception exception = assertThrows(IllegalArgumentException.class, () -> - SearchIndexClient.buildSearchFields(HotelWithUnsupportedField.class, null)); - assertExceptionMassageAndDataType(exception, null, "is not supported"); - } + // 20. name = 'primitiveShort', OData type = INT16 + private short primitiveShort; + public short getPrimitiveShort() { + return primitiveShort; + } + + // 21. name = 'nullableShort', OData type = INT16 + private Short nullableShort; + public Short getNullableShort() { + return nullableShort; + } + + // 22. name = 'primitiveByte', OData type = SBYTE + private byte primitiveByte; + public byte getPrimitiveByte() { + return primitiveByte; + } + // 23. name = 'nullableByte', OData type = SBYTE + private Byte nullableByte; + public Byte getNullableByte() { + return nullableByte; + } + } @Test public void validNormalizerField() { List fields = SearchIndexClient.buildSearchFields(ValidNormalizer.class, null); @@ -426,6 +446,7 @@ private List buildHotelWithArrayModel() { SearchField hotelId = new SearchField("hotelId", SearchFieldDataType.STRING) .setKey(true) .setSortable(true) + .setStored(true) .setHidden(false) .setSearchable(false) .setFacetable(false) @@ -433,6 +454,7 @@ private List buildHotelWithArrayModel() { SearchField tags = new SearchField("tags", SearchFieldDataType.collection(SearchFieldDataType.STRING)) .setKey(false) .setHidden(false) + .setStored(true) .setSearchable(true) .setSortable(false) .setFilterable(false) diff --git a/sdk/search/azure-search-documents/swagger/README.md b/sdk/search/azure-search-documents/swagger/README.md index 82d39c3c717cf..faac14825de7a 100644 --- a/sdk/search/azure-search-documents/swagger/README.md +++ b/sdk/search/azure-search-documents/swagger/README.md @@ -87,10 +87,10 @@ These settings apply only when `--tag=searchindex` is specified on the command l ``` yaml $(tag) == 'searchindex' namespace: com.azure.search.documents input-file: -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/58e92dd03733bc175e6a9540f4bc53703b57fcc9/specification/search/data-plane/Azure.Search/preview/2023-10-01-Preview/searchindex.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/a0151afd7cd14913fc86cb793bde49c71122eb1e/specification/search/data-plane/Azure.Search/preview/2024-03-01-Preview/searchindex.json models-subpackage: models custom-types-subpackage: implementation.models -custom-types: AutocompleteRequest,IndexAction,IndexBatch,RequestOptions,SearchDocumentsResult,SearchError,SearchErrorException,SearchOptions,SearchRequest,SearchResult,SuggestDocumentsResult,SuggestRequest,SuggestResult,VectorQueryKind +custom-types: AutocompleteRequest,IndexAction,IndexBatch,RequestOptions,SearchDocumentsResult,SearchErrorException,SearchOptions,SearchRequest,SearchResult,SuggestDocumentsResult,SuggestRequest,SuggestResult,VectorQueryKind,ErrorAdditionalInfo,ErrorDetail,ErrorResponse,ErrorResponseException,ScalarQuantizationParameters,ScalarQuantizationCompressionConfiguration customization-class: src/main/java/SearchIndexCustomizations.java directive: - rename-model: @@ -105,10 +105,10 @@ These settings apply only when `--tag=searchservice` is specified on the command ``` yaml $(tag) == 'searchservice' namespace: com.azure.search.documents.indexes input-file: -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/58e92dd03733bc175e6a9540f4bc53703b57fcc9/specification/search/data-plane/Azure.Search/preview/2023-10-01-Preview/searchservice.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/a0151afd7cd14913fc86cb793bde49c71122eb1e/specification/search/data-plane/Azure.Search/preview/2024-03-01-Preview/searchservice.json models-subpackage: models custom-types-subpackage: implementation.models -custom-types: AnalyzeRequest,AnalyzeResult,AzureActiveDirectoryApplicationCredentials,DataSourceCredentials,DocumentKeysOrIds,EdgeNGramTokenFilterV1,EdgeNGramTokenFilterV2,EntityRecognitionSkillV1,EntityRecognitionSkillV3,KeywordTokenizerV1,KeywordTokenizerV2,ListAliasesResult,ListDataSourcesResult,ListIndexersResult,ListIndexesResult,ListSkillsetsResult,ListSynonymMapsResult,LuceneStandardTokenizerV1,LuceneStandardTokenizerV2,NGramTokenFilterV1,NGramTokenFilterV2,RequestOptions,SearchError,SearchErrorException,SentimentSkillV1,SentimentSkillV3,SkillNames,VectorSearchAlgorithmKind +custom-types: AnalyzeRequest,AnalyzeResult,AzureActiveDirectoryApplicationCredentials,DataSourceCredentials,DocumentKeysOrIds,EdgeNGramTokenFilterV1,EdgeNGramTokenFilterV2,EntityRecognitionSkillV1,EntityRecognitionSkillV3,KeywordTokenizerV1,KeywordTokenizerV2,ListAliasesResult,ListDataSourcesResult,ListIndexersResult,ListIndexesResult,ListSkillsetsResult,ListSynonymMapsResult,LuceneStandardTokenizerV1,LuceneStandardTokenizerV2,NGramTokenFilterV1,NGramTokenFilterV2,RequestOptions,SearchErrorException,SentimentSkillV1,SentimentSkillV3,SkillNames,VectorSearchAlgorithmKind,ErrorAdditionalInfo,ErrorDetail,ErrorResponse,ErrorResponseException,ScalarQuantizationParameters,ScalarQuantizationCompressionConfiguration customization-class: src/main/java/SearchServiceCustomizations.java directive: - rename-model: diff --git a/sdk/search/azure-search-documents/swagger/src/main/java/SearchIndexCustomizations.java b/sdk/search/azure-search-documents/swagger/src/main/java/SearchIndexCustomizations.java index 79c11eb1c0657..0e98334d48715 100644 --- a/sdk/search/azure-search-documents/swagger/src/main/java/SearchIndexCustomizations.java +++ b/sdk/search/azure-search-documents/swagger/src/main/java/SearchIndexCustomizations.java @@ -104,7 +104,7 @@ private void customizeSuggestOptions(ClassCustomization classCustomization) { private void customizeImplementationModelsPackage(PackageCustomization packageCustomization) { customizeSearchOptions(packageCustomization.getClass("SearchOptions")); customizeIndexAction(packageCustomization.getClass("IndexAction")); - customizeSearchError(packageCustomization.getClass("SearchError")); + // customizeSearchError(packageCustomization.getClass("SearchError")); } private void customizeSearchOptions(ClassCustomization classCustomization) { diff --git a/sdk/search/azure-search-documents/swagger/src/main/java/SearchServiceCustomizations.java b/sdk/search/azure-search-documents/swagger/src/main/java/SearchServiceCustomizations.java index 1b0bfe321889d..e2cbe06d9f04f 100644 --- a/sdk/search/azure-search-documents/swagger/src/main/java/SearchServiceCustomizations.java +++ b/sdk/search/azure-search-documents/swagger/src/main/java/SearchServiceCustomizations.java @@ -95,7 +95,7 @@ public void customize(LibraryCustomization libraryCustomization, Logger logger) customizeSearchIndexerDataSourceConnection(publicCustomization.getClass("SearchIndexerDataSourceConnection")); customizeSemanticPrioritizedFields(publicCustomization.getClass("SemanticPrioritizedFields")); customizeVectorSearch(publicCustomization.getClass("VectorSearch")); - customizeSearchError(implCustomization.getClass("SearchError")); + // customizeSearchError(implCustomization.getClass("SearchError")); bulkRemoveFromJsonMethods(publicCustomization.getClass("SearchIndexerKnowledgeStoreProjectionSelector"), publicCustomization.getClass("SearchIndexerKnowledgeStoreBlobProjectionSelector")); From 3c2ca021f47814df97869d1244d8a8f796dba79b Mon Sep 17 00:00:00 2001 From: Jair Myree Date: Mon, 11 Mar 2024 11:38:31 -0700 Subject: [PATCH 10/90] Prepare Monitor Ingestion March 2024 Patch Release (Manual) (#39143) * Prepare Monitor Ingestion March 2024 Patch Release (Manual) * Update CHANGELOG.md --- eng/versioning/version_client.txt | 2 +- sdk/monitor/azure-monitor-ingestion-perf/pom.xml | 2 +- sdk/monitor/azure-monitor-ingestion/CHANGELOG.md | 11 ++++++----- sdk/monitor/azure-monitor-ingestion/README.md | 2 +- sdk/monitor/azure-monitor-ingestion/pom.xml | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 1a20a8c051293..f13fd61a0212c 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -163,7 +163,7 @@ com.azure:azure-messaging-webpubsub-client;1.0.0;1.1.0-beta.1 com.azure:azure-mixedreality-authentication;1.2.21;1.3.0-beta.1 com.azure:azure-mixedreality-remoterendering;1.1.26;1.2.0-beta.1 com.azure:azure-monitor-opentelemetry-exporter;1.0.0-beta.20;1.0.0-beta.21 -com.azure:azure-monitor-ingestion;1.1.4;1.2.0-beta.1 +com.azure:azure-monitor-ingestion;1.1.4;1.1.5 com.azure:azure-monitor-ingestion-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-monitor-query;1.2.9;1.3.0-beta.3 com.azure:azure-monitor-query-perf;1.0.0-beta.1;1.0.0-beta.1 diff --git a/sdk/monitor/azure-monitor-ingestion-perf/pom.xml b/sdk/monitor/azure-monitor-ingestion-perf/pom.xml index 78320a30de04a..d5ec3b414e47a 100644 --- a/sdk/monitor/azure-monitor-ingestion-perf/pom.xml +++ b/sdk/monitor/azure-monitor-ingestion-perf/pom.xml @@ -31,7 +31,7 @@ com.azure azure-monitor-ingestion - 1.2.0-beta.1 + 1.1.5 com.azure diff --git a/sdk/monitor/azure-monitor-ingestion/CHANGELOG.md b/sdk/monitor/azure-monitor-ingestion/CHANGELOG.md index 0bcdf0b1427ef..1f42795d3a156 100644 --- a/sdk/monitor/azure-monitor-ingestion/CHANGELOG.md +++ b/sdk/monitor/azure-monitor-ingestion/CHANGELOG.md @@ -1,14 +1,15 @@ # Release History -## 1.2.0-beta.1 (Unreleased) +## 1.1.5 (2024-03-11) -### Features Added +### Other Changes -### Breaking Changes +- Updated the JavaDoc documentation to increase support for our clients. -### Bugs Fixed +#### Dependency Updates -### Other Changes +- Upgraded `azure-core-http-netty` from `1.14.0` to version `1.14.1`. +- Upgraded `azure-core` from `1.46.0` to version `1.47.0`. ## 1.1.4 (2024-02-20) diff --git a/sdk/monitor/azure-monitor-ingestion/README.md b/sdk/monitor/azure-monitor-ingestion/README.md index 2a47890e21d62..9ddab2cce4169 100644 --- a/sdk/monitor/azure-monitor-ingestion/README.md +++ b/sdk/monitor/azure-monitor-ingestion/README.md @@ -57,7 +57,7 @@ add the direct dependency to your project as follows. com.azure azure-monitor-ingestion - 1.1.0 + 1.1.5 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/monitor/azure-monitor-ingestion/pom.xml b/sdk/monitor/azure-monitor-ingestion/pom.xml index eb1a6f3a02c3a..171983fcbba84 100644 --- a/sdk/monitor/azure-monitor-ingestion/pom.xml +++ b/sdk/monitor/azure-monitor-ingestion/pom.xml @@ -7,7 +7,7 @@ com.azure azure-monitor-ingestion - 1.2.0-beta.1 + 1.1.5 jar Microsoft Azure SDK for Azure Monitor Data Ingestion From 21e4d0f0d859ad4564c88b0aec55d6c5bf0bfb02 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Mon, 11 Mar 2024 12:31:08 -0700 Subject: [PATCH 11/90] Support `url.query` (#39133) * Support url.query * Handle default port --- .../implementation/SpanDataMapper.java | 38 +++++++++++++++---- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/sdk/monitor/azure-monitor-opentelemetry-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/SpanDataMapper.java b/sdk/monitor/azure-monitor-opentelemetry-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/SpanDataMapper.java index 380eaec5d9e1c..f6f1f6ff0e223 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/SpanDataMapper.java +++ b/sdk/monitor/azure-monitor-opentelemetry-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/SpanDataMapper.java @@ -642,19 +642,43 @@ private static String getHttpUrlFromServerSpanStableSemconv(Attributes attribute if (scheme == null) { return null; } - String path = attributes.get(SemanticAttributes.URL_PATH); - if (path == null) { - return null; - } String host = attributes.get(SemanticAttributes.SERVER_ADDRESS); if (host == null) { return null; } Long port = attributes.get(SemanticAttributes.SERVER_PORT); - if (port != null && port > 0) { - return scheme + "://" + host + ":" + port + path; + String path = attributes.get(SemanticAttributes.URL_PATH); + if (path == null) { + return null; } - return scheme + "://" + host + path; + String query = attributes.get(SemanticAttributes.URL_QUERY); + + int len = scheme.length() + host.length() + path.length(); + if (port != null) { + len += 6; // max 5 digits for port plus the port separator ":" + } + if (query != null) { + len += query.length() + 1; // including the query separator "?" + } + + StringBuilder sb = new StringBuilder(len); + sb.append(scheme); + sb.append("://"); + sb.append(host); + if (port != null && port > 0 && !isDefaultPortForScheme(port, scheme)) { + sb.append(':'); + sb.append(port); + } + sb.append(path); + if (query != null) { + sb.append('?'); + sb.append(query); + } + return sb.toString(); + } + + private static boolean isDefaultPortForScheme(Long port, String scheme) { + return (port == 80 && scheme.equals("http")) || (port == 443 && scheme.equals("https")); } @Nullable From f9959d3f75454577a809d6ea16861daaf462a978 Mon Sep 17 00:00:00 2001 From: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Date: Mon, 11 Mar 2024 16:26:39 -0400 Subject: [PATCH 12/90] Fix CODEOWNER formatting (#39158) Fix CODEOWNER formatting --- .github/CODEOWNERS | 1118 ++++++++++++++++++++++---------------------- 1 file changed, 569 insertions(+), 549 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d25b5d5f1826c..70099f5a2fa05 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -21,822 +21,842 @@ /sdk/ @joshfree @srnagar @anuchandy @conniey @lmolkova @jonathangiles # BOM -# AzureSdkOwners: @vcolin7 @alzimmermsft -# ServiceLabel: %azure-sdk-bom + # PRLabel: %azure-sdk-bom /sdk/boms/azure-sdk-bom/ @vcolin7 @alzimmermsft @jonathangiles @srnagar @anuchandy -# ServiceLabel: %azure-spring +# ServiceLabel: %azure-sdk-bom +# AzureSdkOwners: @vcolin7 @alzimmermsft + # PRLabel: %azure-spring /sdk/boms/spring-cloud-azure-dependencies/ @saragluna @chenrujun @netyyyy @moarychan -#### -# Service teams -#### +# ######## Core Libraries ######## -# AzureSdkOwners: @srnagar -# ServiceLabel: %graalvm -# PRLabel: %graalvm -/sdk/aot/ @srnagar @jonathangiles +# PRLabel: %Azure.Core +/sdk/core/ @alzimmermsft @srnagar @anuchandy @lmolkova @vcolin7 @mssfang @jonathangiles @billwert + +# ServiceLabel: %Azure.Core +# AzureSdkOwners: @alzimmermsft + +# PRLabel: %Azure.Core.AMQP +/sdk/core/azure-core-amqp/ @anuchandy @conniey @lmolkova + +# ServiceLabel: %Azure.Core.AMQP +# AzureSdkOwners: @anuchandy @conniey @lmolkova + +# PRLabel: %OpenTelemetry +/sdk/core/azure-core-tracing-opentelemetry/ @lmolkova @trask + +# ServiceLabel: %OpenTelemetry +# AzureSdkOwners: @lmolkova +# ServiceOwners: @cijothomas @reyang @rajkumar-rangaraj @TimothyMothra @vishweshbankwar @ramthi + +# PRLabel: %Azure.Core +/sdk/parents/ @alzimmermsft + +# PRLabel: %Azure.Core +/sdk/serialization/ @alzimmermsft @srnagar + +# ######## Services ######## + +# ServiceLabel: %AAD +# ServiceOwners: @adamedx + +# ServiceLabel: %Advisor +# ServiceOwners: @mojayara @Prasanna-Padmanabhan + +# ServiceLabel: %AKS +# ServiceOwners: @Azure/aks-pm + +# ServiceLabel: %Alerts Management +# ServiceOwners: @liadtal @yairgil + +# ServiceLabel: %Analysis Services +# ServiceOwners: @athipp @taiwu @minghan + +# ServiceLabel: %API Management +# ServiceOwners: @miaojiang -# AzureSdkOwners: @mssfang -# ServiceLabel: %App Configuration # PRLabel: %App Configuration /sdk/appconfiguration/ @mssfang @alzimmermsft -# PRLabel: %Attestation -/sdk/attestation/ @Azure/azure-sdk-write-attestation @anilba06 @gkostal @larryosterman -/sdk/attestation/azure-security-attestation/ @Azure/azure-sdk-write-attestation @anilba06 @gkostal @larryosterman -/sdk/attestation/azure-resourcemanager-attestation/ @Azure/azure-sdk-write-attestation @anilba06 @gkostal +# ServiceLabel: %App Configuration +# AzureSdkOwners: @mssfang +# ServiceOwners: @shenmuxiaosen @avanigupta -# PRLabel: %Batch -/sdk/batch/ @skapur12 @wiboris @dpwatrous @NickKouds +# ServiceLabel: %Application Insights +# ServiceOwners: @azmonapplicationinsights -# PRLabel: %Communication -/sdk/communication/ +# ServiceLabel: %App Services +# ServiceOwners: @antcp @AzureAppServiceCLI -# PRLabel: %Communication - Calling Server -/sdk/communication/azure-communication-callingserver/ @minwoolee-msft +# ServiceLabel: %ARM +# ServiceOwners: @armleads-azure -# PRLabel: %Communication - Call Automation -/sdk/communication/azure-communication-callautomation/ @juntuchen-msft @cochi2 +# ServiceLabel: %ARM - Templates +# ServiceOwners: @armleads-azure -# PRLabel: %Communication - Chat -/sdk/communication/azure-communication-chat/ @ankitarorabit @minnieliu @Azure/azure-sdk-communication-code-reviewers +# ServiceLabel: %ARM - Tags +# ServiceOwners: @armleads-azure -# PRLabel: %Communication - Identity -/sdk/communication/azure-communication-identity/ @Azure/acs-identity-sdk @AikoBB @maximrytych-ms @mjafferi-msft +# ServiceLabel: %ARM - Core +# ServiceOwners: @armleads-azure -# PRLabel: %Communication - Common -/sdk/communication/azure-communication-common/ @Azure/acs-identity-sdk @AikoBB @maximrytych-ms @mjafferi-msft +# ServiceLabel: %ARM - Managed Applications +# ServiceOwners: @armleads-azure -# PRLabel: %Communication - Network Traversal -/sdk/communication/azure-communication-networktraversal/ @ankitarorabit @minnieliu @Azure/azure-sdk-communication-code-reviewers +# ServiceLabel: %ARM - Service Catalog +# ServiceOwners: @armleads-azure -# PRLabel: %Communication - Phone Numbers -/sdk/communication/azure-communication-phonenumbers/ @miguhern @whisper6284 @RoyHerrod @danielav7 +# ServiceLabel: %ARM - RBAC +# ServiceOwners: @armleads-azure -# PRLabel: %Communication - SMS -/sdk/communication/azure-communication-sms/ @DimaKolomiiets @gfeitosa-msft @besh2014 @phermanov-msft @ilyapaliakou-msft +# ServiceLabel: %ARO +# ServiceOwners: @mjudeikis @jim-minter @julienstroheker @amanohar -# PRLabel: %Communication - Resource Manager -/sdk/communication/azure-resourcemanager-communication/ +# PRLabel: %graalvm +/sdk/aot/ @srnagar @jonathangiles -# PRLabel: %Communication - Rooms -/sdk/communication/azure-communication-rooms/ @minnieliu @paolamvhz @alexokun @Mrayyan @shwali-msft @allchiang-msft @mikehang-msft +# ServiceLabel: %graalvm +# AzureSdkOwners: @srnagar -# AzureSdkOwners: @lmolkova -# ServiceLabel: %Container Registry -# PRLabel: %Container Registry -/sdk/containerregistry/ @lmolkova @alzimmermsft @Azure/azsdk-acr +# PRLabel: %Attestation +/sdk/attestation/ @Azure/azure-sdk-write-attestation @anilba06 @gkostal @larryosterman -# AzureSdkOwners: @alzimmermsft -# ServiceLabel: %Azure.Core -# PRLabel: %Azure.Core -/sdk/core/ @alzimmermsft @srnagar @anuchandy @lmolkova @vcolin7 @mssfang @jonathangiles @billwert +# PRLabel: %Attestation +/sdk/attestation/azure-security-attestation/ @Azure/azure-sdk-write-attestation @anilba06 @gkostal @larryosterman -# AzureSdkOwners: @anuchandy @conniey @lmolkova -# ServiceLabel: %Azure.Core.AMQP -# PRLabel: %Azure.Core.AMQP -/sdk/core/azure-core-amqp/ @anuchandy @conniey @lmolkova +# PRLabel: %Attestation +/sdk/attestation/azure-resourcemanager-attestation/ @Azure/azure-sdk-write-attestation @anilba06 @gkostal -# AzureSdkOwners: @lmolkova -# ServiceLabel: %OpenTelemetry -# PRLabel: %OpenTelemetry -/sdk/core/azure-core-tracing-opentelemetry/ @lmolkova @trask +# ServiceLabel: %Attestation +# ServiceOwners: @anilba06 @gkostal -# ServiceLabel: %Cosmos -# PRLabel: %Cosmos -/sdk/cosmos/ @kushagraThapar @FabianMeiswinkel @kirankumarkolli @xinlian12 @milismsft @aayush3011 @simorenoh @jeet1995 @Pilchie +# ServiceLabel: %Authorization +# ServiceOwners: @darshanhs90 @AshishGargMicrosoft -# PRLabel: %Load Testing -/sdk/loadtesting/ @Harshan01 @prativen +# ServiceLabel: %Automation +# ServiceOwners: @jaspkaur28 @omairabdullah -# ServiceLabel: %Device Update for IoT Hub %Service Attention -/sdk/deviceupdate/ @dpokluda +# ServiceLabel: %AVS +# ServiceOwners: @divka78 @amitchat @aishu -# PRLabel: %Digital Twins -/sdk/digitaltwins/ @johngallardo @efriesner @abhinav-ghai @Aashish93-stack @sjiherzig @Satya-Kolluri +# ServiceLabel: %Azure Arc Enabled Servers +# ServiceOwners: @rpsqrd @edyoung -# PRLabel: %Models Repository -/sdk/modelsrepository/ @drwill-ms @timtay-microsoft @abhipsaMisra @digimaun @andyk-ms @brycewang-microsoft @tmahmood-microsoft @ngastelum-ms +# ServiceLabel: %Azure Data Explorer +# ServiceOwners: @ilayrn @astauben @zoharHenMicrosoft @sagivf @Aviv-Yaniv -# AzureSdkOwners: @billwert -# ServiceOwners: @jfggdl -# ServiceLabel: %Event Grid +# ServiceLabel: %Azure Stack +# ServiceOwners: @sijuman @sarathys @bganapa @rakku-ms -# PRLabel: %Event Grid -/sdk/eventgrid/ @billwert @mssfang @srnagar @lmolkova +# PRLabel: %Batch +/sdk/batch/ @skapur12 @wiboris @dpwatrous @NickKouds -# AzureSdkOwners: @conniey @anuchandy @lmolkova -# ServiceOwners: @serkantkaraca @sjkwak -# ServiceLabel: %Event Hubs +# ServiceLabel: %Batch +# ServiceOwners: @mksuni @bgklein @mscurrell @cRui861 @paterasMSFT @gingi @dpwatrous -# PRLabel: %Event Hubs -/sdk/eventhubs/ @conniey @anuchandy @lmolkova +# ServiceLabel: %BatchAI +# ServiceOwners: @matthchr -# PRLabel: %Event Hubs -/sdk/eventhubs/microsoft-azure-eventhubs-eph/ @sjkwak +# ServiceLabel: %Billing +# ServiceOwners: @cabbpt -# PRLabel: %Event Hubs -/sdk/eventhubs/microsoft-azure-eventhubs-extensions/ @sjkwak +# ServiceLabel: %Blueprint +# ServiceOwners: @alex-frankel @filizt -# PRLabel: %Event Hubs -/sdk/eventhubs/microsoft-azure-eventhubs/ @sjkwak +# ServiceLabel: %Bot Service +# ServiceOwners: @sgellock + +# ServiceLabel: %Cloud Shell +# ServiceOwners: @maertendMSFT + +# PRLabel: %Cognitive - Text Analytics +/sdk/textanalytics/ @samvaity @mssfang @quentinRobinson @wangyuantao + +# ServiceLabel: %Cognitive - Text Analytics +# AzureSdkOwners: @samvaity +# ServiceOwners: @assafi -# AzureSdkOwners: @samvaity -# ServiceLabel: %Cognitive - Form Recognizer # PRLabel: %Cognitive - Form Recognizer /sdk/formrecognizer/ @samvaity @mssfang -# AzureSdkOwners: @samvaity -# ServiceLabel: %Cognitive - Metrics Advisor +# ServiceLabel: %Cognitive - Form Recognizer +# AzureSdkOwners: @samvaity +# ServiceOwners: @ctstone @vkurpad + # PRLabel: %Cognitive - Metrics Advisor /sdk/metricsadvisor/ @samvaity @anuchandy +# ServiceLabel: %Cognitive - Metrics Advisor +# AzureSdkOwners: @samvaity +# ServiceOwners: @bowgong + # PRLabel: %Cognitive - Anomaly Detector /sdk/anomalydetector/ @conhua @mengaims @juaduan @moreOver0 -# AzureSdkOwners: @g2vinay @billwert -# ServiceLabel: %Azure.Identity -# PRLabel: %Azure.Identity -/sdk/identity/ @g2vinay @billwert @joshfree @Azure/azure-sdk-write-identity - +# ServiceLabel: %Cognitive - Anomaly Detector +# ServiceOwners: @yingqunpku @bowgong -# PRLabel: %azure-spring -/sdk/identity/azure-identity-extensions/ @chenrujun @netyyyy @saragluna @moarychan +# ServiceLabel: %Cognitive - Custom Vision +# ServiceOwners: @areddish @tburns10 -# AzureSdkOwners: @vcolin7 -# ServiceLabel: %KeyVault -# PRLabel: %KeyVault -/sdk/keyvault/ @vcolin7 @g2vinay @Azure/azsdk-keyvault +# ServiceLabel: %Cognitive - Computer Vision +# ServiceOwners: @ryogok @TFR258 @tburns10 -# PRLabel: %azure-spring -/sdk/keyvault/azure-security-keyvault-jca/ @chenrujun @netyyyy @saragluna @moarychan +# ServiceLabel: %Cognitive - Face +# ServiceOwners: @JinyuID @dipidoo @SteveMSFT -/sdk/loganalytics/microsoft-azure-loganalytics/ @ischrei +# ServiceLabel: %Cognitive - QnA Maker +# ServiceOwners: @bingisbestest @nerajput1607 -# PRLabel: %OpenTelemetry -/sdk/monitor/azure-monitor-opentelemetry-exporter/ @trask @ramthi @heyams @jeanbisutti +# ServiceLabel: %Cognitive - Translator +# ServiceOwners: @swmachan -# AzureSdkOwners: @srnagar @jairmyree -# ServiceLabel: %Monitor -# PRLabel: %Monitor -/sdk/monitor/azure-monitor-query*/ @srnagar @jairmyree @lmolkova @Azure/azure-sdk-write-monitor-data-plane -/sdk/monitor/azure-monitor-ingestion*/ @srnagar @jairmyree @lmolkova @Azure/azure-sdk-write-monitor-data-plane +# ServiceLabel: %Cognitive - Speech +# ServiceOwners: @robch @oscholz -# PRLabel: %Mixed Reality Authentication -/sdk/mixedreality/azure-mixedreality-authentication/ @RamonArguelles +# ServiceLabel: %Cognitive - LUIS +# ServiceOwners: @cahann @kayousef -# PRLabel: %OpenAI -/sdk/openai/azure-ai-openai/ @brandom-msft @jpalvarezl @mssfang -/sdk/openai/azure-ai-openai-assistants/ @brandom-msft @jpalvarezl @mssfang +# ServiceLabel: %Cognitive - Content Moderator +# ServiceOwners: @swiftarrow11 -# PRLabel: %Image Analysis -# ServiceLabel: %Image Analysis %Service Attention -/sdk/vision/azure-ai-vision-imageanalysis/ @dargilco @rhurey +# PRLabel: %Cognitive - Personalizer +/sdk/personalizer/ @sharathmalladi -# PRLabel: %Remote Rendering -/sdk/remoterendering/ @MichaelZp0 @ChristopherManthei +# ServiceLabel: %Cognitive - Personalizer +# ServiceOwners: @sharathmalladi -# AzureSdkOwners: @conniey -# ServiceOwners: @hmlam -# ServiceLabel: %Schema Registry +# ServiceLabel: %Cognitive - Immersive Reader +# ServiceOwners: @metanMSFT -# PRLabel: %Schema Registry -/sdk/schemaregistry/ @conniey @srnagar +# ServiceLabel: %Cognitive - Ink Recognizer +# ServiceOwners: @olduroja -# AzureSdkOwners: @alzimmermsft @jairmyree -# ServiceLabel: %Search -# PRLabel: %Search -/sdk/search/ @alzimmermsft @jairmyree @Azure/azsdk-search +# ServiceLabel: %Cognitive - Bing +# ServiceOwners: @jaggerbodas-ms @arwong -# AzureSdkOwners: @alzimmermsft -# ServiceLabel: %Azure.Core -# PRLabel: %Azure.Core -/sdk/serialization/ @alzimmermsft @srnagar +# ServiceLabel: %Cognitive - Mgmt +# ServiceOwners: @yangyuan -# AzureSdkOwners: @anuchandy -# ServiceOwners: @EldertGrootenboer -# ServiceLabel: %Service Bus +# ServiceLabel: %Commerce +# ServiceOwners: @ms-premp @qiaozha -# PRLabel: %Service Bus -/sdk/servicebus/ @anuchandy @conniey @lmolkova +# PRLabel: %Communication +/sdk/communication/ -# ServiceLabel: %Service Bus %Track 1 -# PRLabel: %Service Bus -/sdk/servicebus/microsoft-azure-servicebus/ @shankarsama @yvgopal +# ServiceLabel: %Communication +# ServiceOwners: @acsdevx-msft -# ServiceLabel: %Storage -# PRLabel: %Storage -/sdk/storage/ @ibrahimrabab @seanmcc-msft @ibrandes @alzimmermsft +# PRLabel: %Communication - Calling Server +/sdk/communication/azure-communication-callingserver/ @minwoolee-msft -# AzureSdkOwners: @jairmyree -# ServiceLabel: %Tables -# PRLabel: %Tables -/sdk/tables/ @jairmyree @vcolin7 +# PRLabel: %Communication - Call Automation +/sdk/communication/azure-communication-callautomation/ @juntuchen-msft @cochi2 -# PRLabel: %EngSys -/sdk/template/ @hallipr @weshaggard @JimSuplizio +# PRLabel: %Communication - Chat +/sdk/communication/azure-communication-chat/ @ankitarorabit @minnieliu @Azure/azure-sdk-communication-code-reviewers +# PRLabel: %Communication - Identity +/sdk/communication/azure-communication-identity/ @Azure/acs-identity-sdk @AikoBB @maximrytych-ms @mjafferi-msft -# AzureSdkOwners: @samvaity -# ServiceLabel: %Cognitive - Text Analytics -# PRLabel: %Cognitive - Text Analytics -/sdk/textanalytics/ @samvaity @mssfang @quentinRobinson @wangyuantao +# PRLabel: %Communication - Common +/sdk/communication/azure-communication-common/ @Azure/acs-identity-sdk @AikoBB @maximrytych-ms @mjafferi-msft -# AzureSdkOwners: @srnagar @jonathangiles -# ServiceLabel: %Azure SDK Tools -# PRLabel: %Azure SDK Tools -/sdk/tools/ @srnagar @jonathangiles +# PRLabel: %Communication - Network Traversal +/sdk/communication/azure-communication-networktraversal/ @ankitarorabit @minnieliu @Azure/azure-sdk-communication-code-reviewers -# ServiceLabel: %azure-spring -# PRLabel: %azure-spring -/sdk/spring/ @chenrujun @netyyyy @saragluna @moarychan -# PRLabel: %azure-spring -/sdk/spring-experimental/ @chenrujun @netyyyy @saragluna @moarychan +# PRLabel: %Communication - Phone Numbers +/sdk/communication/azure-communication-phonenumbers/ @miguhern @whisper6284 @RoyHerrod @danielav7 -# ServiceLabel: %Monitor - Spring -# PRLabel: %Monitor - Spring -/sdk/spring/spring-cloud-azure-starter-monitor @jeanbisutti @trask @ramthi @heyams -/sdk/spring/spring-cloud-azure-starter-monitor-test @jeanbisutti @trask @ramthi @heyams +# PRLabel: %Communication - SMS +/sdk/communication/azure-communication-sms/ @DimaKolomiiets @gfeitosa-msft @besh2014 @phermanov-msft @ilyapaliakou-msft -# PRLabel: %azure-spring -/sdk/spring/spring-cloud-azure-appconfiguration-config*/ @mrm9084 @chenrujun @netyyyy @saragluna @moarychan -/sdk/spring/spring-cloud-azure-feature-management*/ @mrm9084 @chenrujun @netyyyy @saragluna @moarychan -/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/ @mrm9084 @chenrujun @netyyyy @saragluna @moarychan -# PRLabel: %azure-spring -/sdk/spring/azure-spring-data-cosmos/ @kushagraThapar @FabianMeiswinkel @trande4884 @TheovanKraay @xinlian12 @chenrujun @netyyyy @saragluna @moarychan @aayush3011 @simorenoh @jeet1995 @Pilchie +# PRLabel: %Communication - Resource Manager +/sdk/communication/azure-resourcemanager-communication/ +# PRLabel: %Communication - Rooms +/sdk/communication/azure-communication-rooms/ @minnieliu @paolamvhz @alexokun @Mrayyan @shwali-msft @allchiang-msft @mikehang-msft -# PRLabel: %DevCenter -/sdk/devcenter/ @sebrenna @mharlan +# ServiceLabel: %Compute +# ServiceOwners: @Drewm3 @avirishuv @vaibhav-agar @amjads1 -# end to end tests -# AzureSdkOwners: @g2vinay @billwert -# ServiceLabel: %Azure.Identity -# PRLabel: %Azure.Identity -/sdk/e2e/ @g2vinay @billwert +# ServiceLabel: %Compute - Extensions +# ServiceOwners: @Drewm3 @amjads1 +# ServiceLabel: %Compute - Images +# ServiceOwners: @Drewm3 @vaibhav-agar -# AzureSdkOwners: @alzimmermsft @srnagar -# ServiceLabel: %common -# PRLabel: %common -/common/smoke-tests/ @alzimmermsft @srnagar @joshfree @jonathangiles @g2vinay @conniey +# ServiceLabel: %Compute - Managed Disks +# ServiceOwners: @Drewm3 @vaibhav-agar +# ServiceLabel: %Compute - RDFE +# ServiceOwners: @Drewm3 @avirishuv -# -# Management Plane -# +# ServiceLabel: %Compute - VM +# ServiceOwners: @Drewm3 @avirishuv -# AzureSdkOwners: @weidongxu-microsoft -# ServiceLabel: %Mgmt -# PRLabel: %Mgmt -/sdk/resourcemanager/ @weidongxu-microsoft @haolingdong-msft @XiaofeiCao @arthurma1978 +# ServiceLabel: %Compute - VMSS +# ServiceOwners: @Drewm3 @avirishuv -# AzureSdkOwners: @weidongxu-microsoft -# ServiceLabel: %Mgmt -# PRLabel: %Mgmt -/sdk/**/azure-resourcemanager-*/ @weidongxu-microsoft @haolingdong-msft @XiaofeiCao @arthurma1978 +# ServiceLabel: %Connected Kubernetes +# ServiceOwners: @akashkeshari -# AzureSdkOwners: @weidongxu-microsoft -# ServiceLabel: %Mgmt -# PRLabel: %Mgmt -/sdk/resourcemanagerhybrid/ @weidongxu-microsoft @haolingdong-msft @XiaofeiCao @arthurma1978 @bganapa +# ServiceLabel: %Consumption - Billing +# ServiceOwners: @ccmbpxpcrew +# ServiceLabel: %Consumption - Budget +# ServiceOwners: @ccmaxpcrew -# Quantum -# PRLabel: %Azure Quantum -/sdk/quantum/ @vxfield @cgranade @ricardo-espinoza @anjbur @msoeken @guenp +# ServiceLabel: %Consumption - Query +# ServiceOwners: @ccmixpdevs +# ServiceLabel: %Consumption - RIandShowBack +# ServiceOwners: @ccmshowbackdevs -# ServiceLabel: %AAD %Service Attention -#// @adamedx +# ServiceLabel: %Consumption - UsageDetailsAndExport +# ServiceOwners: @TiagoCrewGitHubIssues -# ServiceLabel: %AKS %Service Attention -#// @Azure/aks-pm +# ServiceLabel: %Container Instances +# ServiceOwners: @macolso -# ServiceLabel: %Alerts Management %Service Attention -#// @liadtal @yairgil +# PRLabel: %Container Registry +/sdk/containerregistry/ @lmolkova @alzimmermsft @Azure/azsdk-acr -# ServiceLabel: %ARM %Service Attention -#// @armleads-azure +# ServiceLabel: %Container Registry +# AzureSdkOwners: @lmolkova +# ServiceOwners: @toddysm @northtyphoon -# ServiceLabel: %ARM - Templates %Service Attention -#// @armleads-azure +# ServiceLabel: %Container Service +# ServiceOwners: @qike-ms @jwilder @thomas1206 @seanmck -# ServiceLabel: %ARM - Tags %Service Attention -#// @armleads-azure +# ServiceLabel: %Cosmos +# ServiceOwners: @kushagraThapar @TheovanKraay @pjohari-ms -# ServiceLabel: %ARM - Core %Service Attention -#// @armleads-azure +# PRLabel: %Cosmos +/sdk/cosmos/ @kushagraThapar @FabianMeiswinkel @kirankumarkolli @xinlian12 @milismsft @aayush3011 @simorenoh @jeet1995 @Pilchie -# ServiceLabel: %ARM - Managed Applications %Service Attention -#// @armleads-azure +# ServiceLabel: %Cost Management - Billing +# ServiceOwners: @ccmbpxpcrew -# ServiceLabel: %ARM - Service Catalog %Service Attention -#// @armleads-azure +# ServiceLabel: %Cost Management - Budget +# ServiceOwners: @ccmaxpcrew -# ServiceLabel: %ARM - RBAC %Service Attention -#// @armleads-azure +# ServiceLabel: %Cost Management - Query +# ServiceOwners: @ccmixpdevs -# ServiceLabel: %Advisor %Service Attention -#// @mojayara @Prasanna-Padmanabhan +# ServiceLabel: %Cost Management - RIandShowBack +# ServiceOwners: @ccmshowbackdevs -# ServiceLabel: %Analysis Services %Service Attention -#// @athipp @taiwu @minghan +# ServiceLabel: %Cost Management - UsageDetailsAndExport +# ServiceOwners: @TiagoCrewGitHubIssues -# ServiceLabel: %API Management %Service Attention -#// @miaojiang +# ServiceLabel: %Customer Insights +# ServiceOwners: @shefymk -# ServiceLabel: %Application Insights %Service Attention -#// @azmonapplicationinsights +# ServiceLabel: %Custom Providers +# ServiceOwners: @manoharp @MSEvanhi -# ServiceLabel: %App Services %Service Attention -#// @antcp @AzureAppServiceCLI +# ServiceLabel: %CycleCloud +# ServiceOwners: @adriankjohnson -# ServiceLabel: %App Configuration %Service Attention -#// @shenmuxiaosen @avanigupta +# ServiceLabel: %Data Bricks +# ServiceOwners: @arindamc -# ServiceLabel: %ARO %Service Attention -#// @mjudeikis @jim-minter @julienstroheker @amanohar +# ServiceLabel: %DataBox +# ServiceOwners: @tmvishwajit @matdickson @manuaery @madhurinms -# ServiceLabel: %Attestation %Service Attention -#// @anilba06 +# ServiceLabel: %DataBox Edge +# ServiceOwners: @a-t-mason @ganzee @manuaery -# ServiceLabel: %Authorization %Service Attention -#// @darshanhs90 @AshishGargMicrosoft +# ServiceLabel: %Data Catalog +# ServiceOwners: @ingave -# ServiceLabel: %Automation %Service Attention -#// @jaspkaur28 @omairabdullah +# ServiceLabel: %Data Factory +# ServiceOwners: @shawnxzq @lmy269 @Jingshu923 -# ServiceLabel: %AVS %Service Attention -#// @divka78 @amitchat @aishu +# ServiceLabel: %Data Lake +# ServiceOwners: @sumantmehtams -# ServiceLabel: %Azure Stack %Service Attention -#// @sijuman @sarathys @bganapa @rakku-ms +# ServiceLabel: %Data Lake Storage Gen1 +# ServiceOwners: @sumantmehtams -# ServiceLabel: %Batch %Service Attention -#// @mksuni @bgklein @mscurrell @cRui861 @paterasMSFT @gingi @dpwatrous +# ServiceLabel: %Data Lake Storage Gen2 +# ServiceOwners: @sumantmehtams -# ServiceLabel: %BatchAI %Service Attention -#// @matthchr +# ServiceLabel: %Data Lake Analytics +# ServiceOwners: @idear1203 -# ServiceLabel: %Billing %Service Attention -#// @cabbpt +# ServiceLabel: %Data Lake Store +# ServiceOwners: @sumantmehtams -# ServiceLabel: %Blueprint %Service Attention -#// @alex-frankel @filizt +# ServiceLabel: %Data Migration +# ServiceOwners: @radjaram @kavitham10 -# ServiceLabel: %Bot Service %Service Attention -#// @sgellock +# ServiceLabel: %Data Share +# ServiceOwners: @raedJarrar @jifems -# ServiceLabel: %Cloud Shell %Service Attention -#// @maertendMSFT +# PRLabel: %DevCenter +/sdk/devcenter/ @sebrenna @mharlan -# ServiceLabel: %Cognitive - Text Analytics %Service Attention -#// @assafi +# ServiceLabel: %DevCenter +# ServiceOwners: @sebrenna @mharlan -# ServiceLabel: %Cognitive - Form Recognizer %Service Attention -#// @ctstone @vkurpad +# ServiceLabel: %Device Provisioning Service +# ServiceOwners: @nberdy -# ServiceLabel: %Cognitive - Anomaly Detector %Service Attention -#// @yingqunpku @bowgong +# ServiceLabel: %Device Update +/sdk/deviceupdate/ @dpokluda -# ServiceLabel: %Cognitive - Custom Vision %Service Attention -#// @areddish @tburns10 +# ServiceLabel: %Device Update +# ServiceOwners: @dpokluda -# ServiceLabel: %Cognitive - Computer Vision %Service Attention -#// @ryogok @TFR258 @tburns10 +# ServiceLabel: %DevOps +# ServiceOwners: @narula0781 @ashishonce @romil07 -# ServiceLabel: %Cognitive - Face %Service Attention -#// @JinyuID @dipidoo @SteveMSFT +# ServiceLabel: %Dev Spaces +# ServiceOwners: @yuzorMa @johnsta @greenie-msft -# ServiceLabel: %Cognitive - QnA Maker %Service Attention -#// @bingisbestest @nerajput1607 +# ServiceLabel: %Devtestlab +# ServiceOwners: @Tanmayeekamath -# ServiceLabel: %Cognitive - Translator %Service Attention -#// @swmachan +# PRLabel: %Digital Twins +/sdk/digitaltwins/ @johngallardo @efriesner @abhinav-ghai @Aashish93-stack @sjiherzig @Satya-Kolluri -# ServiceLabel: %Cognitive - Speech %Service Attention -#// @robch @oscholz +# ServiceLabel: %Digital Twins +# ServiceOwners: @drwill-ms @timtay-microsoft @abhipsaMisra @vinagesh @azabbasi @barustum @jamdavi -# ServiceLabel: %Cognitive - LUIS %Service Attention -#// @cahann @kayousef +# PRLabel: %Event Grid +/sdk/eventgrid/ @billwert @mssfang @srnagar @lmolkova -# ServiceLabel: %Cognitive - Content Moderator %Service Attention -#// @swiftarrow11 +# ServiceLabel: %Event Grid +# AzureSdkOwners: @billwert +# ServiceOwners: @jfggdl -# ServiceLabel: %Cognitive - Personalizer %Service Attention -/sdk/personalizer/ @sharathmalladi +# PRLabel: %Event Hubs +/sdk/eventhubs/ @conniey @anuchandy @lmolkova -# ServiceLabel: %Cognitive - Immersive Reader %Service Attention -#// @metanMSFT +# ServiceLabel: %Event Hubs +# AzureSdkOwners: @conniey @anuchandy @lmolkova +# ServiceOwners: @serkantkaraca @sjkwak -# ServiceLabel: %Cognitive - Ink Recognizer %Service Attention -#// @olduroja +# PRLabel: %Event Hubs +/sdk/eventhubs/microsoft-azure-eventhubs-eph/ @sjkwak -# ServiceLabel: %Cognitive - Bing %Service Attention -#// @jaggerbodas-ms @arwong +# PRLabel: %Event Hubs +/sdk/eventhubs/microsoft-azure-eventhubs-extensions/ @sjkwak -# ServiceLabel: %Cognitive - Mgmt %Service Attention -#// @yangyuan +# PRLabel: %Event Hubs +/sdk/eventhubs/microsoft-azure-eventhubs/ @sjkwak -# ServiceLabel: %Commerce %Service Attention -#// @ms-premp @qiaozha +# ServiceLabel: %Functions +# ServiceOwners: @ahmedelnably @fabiocav -# ServiceLabel: %Compute %Service Attention -#// @Drewm3 @avirishuv @vaibhav-agar @amjads1 +# ServiceLabel: %Graph.Microsoft +# ServiceOwners: @dkershaw10 @baywet -# ServiceLabel: %Compute - Extensions %Service Attention -#// @Drewm3 @amjads1 +# ServiceLabel: %Guest Configuration +# ServiceOwners: @mgreenegit @vivlingaiah -# ServiceLabel: %Compute - Images %Service Attention -#// @Drewm3 @vaibhav-agar +# ServiceLabel: %HDInsight +# ServiceOwners: @aim-for-better @idear1203 @deshriva -# ServiceLabel: %Compute - Managed Disks %Service Attention -#// @Drewm3 @vaibhav-agar +# ServiceLabel: %HPC Cache +# ServiceOwners: @romahamu @omzevall -# ServiceLabel: %Compute - RDFE %Service Attention -#// @Drewm3 @avirishuv +# PRLabel: %Azure.Identity +/sdk/identity/ @g2vinay @billwert @joshfree @Azure/azure-sdk-write-identity -# ServiceLabel: %Compute - VM %Service Attention -#// @Drewm3 @avirishuv +# ServiceLabel: %Azure.Identity +# AzureSdkOwners: @g2vinay @billwert -# ServiceLabel: %Compute - VMSS %Service Attention -#// @Drewm3 @avirishuv +# PRLabel: %Image Analysis +/sdk/vision/azure-ai-vision-imageanalysis/ @dargilco @rhurey -# ServiceLabel: %Connected Kubernetes %Service Attention -#// @akashkeshari +# ServiceLabel: %Image Analysis +# ServiceOwners: @rhurey @dargilco -# ServiceLabel: %Container Instances %Service Attention -#// @macolso +# ServiceLabel: %Import Export +# ServiceOwners: @madhurinms -# ServiceLabel: %Container Registry %Service Attention -#// @toddysm @northtyphoon +# ServiceLabel: %IoT - CLI +# ServiceOwners: @Azure/azure-iot-cli-triage -# ServiceLabel: %Container Service %Service Attention -#// @qike-ms @jwilder @thomas1206 @seanmck +# PRLabel: %KeyVault +/sdk/keyvault/ @vcolin7 @g2vinay @Azure/azsdk-keyvault -# ServiceLabel: %Cosmos %Service Attention -#// @kushagraThapar @TheovanKraay @pjohari-ms +# ServiceLabel: %KeyVault +# AzureSdkOwners: @vcolin7 +# ServiceOwners: @RandalliLama @schaabs @jlichwa -# ServiceLabel: %Customer Insights %Service Attention -#// @shefymk +# ServiceLabel: %Kubernetes Configuration +# ServiceOwners: @NarayanThiru -# ServiceLabel: %Custom Providers %Service Attention -#// @manoharp @MSEvanhi +# ServiceLabel: %Lab Services +# ServiceOwners: @Tanmayeekamath -# ServiceLabel: %CycleCloud %Service Attention -#// @adriankjohnson +# PRLabel: %Load Testing +/sdk/loadtesting/ @Harshan01 @prativen -# ServiceLabel: %Data Bricks %Service Attention -#// @arindamc +/sdk/loganalytics/microsoft-azure-loganalytics/ @ischrei -# ServiceLabel: %DataBox %Service Attention -#// @tmvishwajit @matdickson @manuaery @madhurinms +# ServiceLabel: %Logic App +# ServiceOwners: @Azure/azure-logicapps-team -# ServiceLabel: %DataBox Edge %Service Attention -#// @a-t-mason @ganzee @manuaery +# ServiceLabel: %LOUIS +# ServiceOwners: @minamnmik -# ServiceLabel: %Data Catalog %Service Attention -#// @ingave +# ServiceLabel: %Managed Identity +# ServiceOwners: @varunkch -# ServiceLabel: %Data Factory %Service Attention -#// @shawnxzq @lmy269 @Jingshu923 +# ServiceLabel: %Machine Learning +# ServiceOwners: @azureml-github -# ServiceLabel: %Data Lake %Service Attention -#// @sumantmehtams +# ServiceLabel: %Machine Learning Compute +# ServiceOwners: @azureml-github -# ServiceLabel: %Data Lake Storage Gen1 %Service Attention -#// @sumantmehtams +# ServiceLabel: %Machine Learning Experimentation +# ServiceOwners: @aashishb -# ServiceLabel: %Data Lake Storage Gen2 %Service Attention -#// @sumantmehtams +# ServiceLabel: %Managed Services +# ServiceOwners: @Lighthouse-Azure -# ServiceLabel: %Data Lake Analytics %Service Attention -#// @idear1203 +# ServiceLabel: %MariaDB +# ServiceOwners: @ambhatna @savjani -# ServiceLabel: %Data Lake Store %Service Attention -#// @sumantmehtams +# ServiceLabel: %Marketplace Ordering +# ServiceOwners: @prbansa -# ServiceLabel: %Data Migration %Service Attention -#// @radjaram @kavitham10 +# ServiceLabel: %Media Services +# ServiceOwners: @akucer -# ServiceLabel: %Data Share %Service Attention -#// @raedJarrar @jifems +# ServiceLabel: %Migrate +# ServiceOwners: @shijojoy -# ServiceLabel: %DevOps %Service Attention -#// @narula0781 @ashishonce @romil07 +# PRLabel: %Mixed Reality Authentication +/sdk/mixedreality/azure-mixedreality-authentication/ @RamonArguelles -# ServiceLabel: %Dev Spaces %Service Attention -#// @yuzorMa @johnsta @greenie-msft +# ServiceLabel: %Mobile Engagement +# ServiceOwners: @kpiteira -# ServiceLabel: %Devtestlab %Service Attention -#// @Tanmayeekamath +# PRLabel: %Models Repository +/sdk/modelsrepository/ @drwill-ms @timtay-microsoft @abhipsaMisra @digimaun @andyk-ms @brycewang-microsoft @tmahmood-microsoft @ngastelum-ms -# ServiceLabel: %Device Provisioning Service %Service Attention -#// @nberdy +# PRLabel: %Monitor +/sdk/monitor/azure-monitor-query*/ @srnagar @jairmyree @lmolkova @Azure/azure-sdk-write-monitor-data-plane -# ServiceLabel: %Digital Twins %Service Attention -#// @@drwill-ms @@timtay-microsoft @@abhipsaMisra @@vinagesh @@azabbasi @@barustum @@jamdavi +# PRLabel: %Monitor +/sdk/monitor/azure-monitor-ingestion*/ @srnagar @jairmyree @lmolkova @Azure/azure-sdk-write-monitor-data-plane -# ServiceLabel: %Functions %Service Attention -#// @ahmedelnably @fabiocav +# ServiceLabel: %Monitor +# AzureSdkOwners: @srnagar @jairmyree +# ServiceOwners: @SameergMS @dadunl @AzMonEssential @AzmonAlerts @AzmonActionG @AzmonLogA -# ServiceLabel: %Graph.Microsoft %Service Attention -#// @dkershaw10 @baywet +# ServiceLabel: %Monitor - ApplicationInsights +# ServiceOwners: @azmonapplicationinsights -# ServiceLabel: %Guest Configuration %Service Attention -#// @mgreenegit @vivlingaiah +# ServiceLabel: %MySQL +# ServiceOwners: @ambhatna @savjani -# ServiceLabel: %HDInsight %Service Attention -#// @aim-for-better @idear1203 @deshriva +# PRLabel: %OpenTelemetry +/sdk/monitor/azure-monitor-opentelemetry-exporter/ @trask @ramthi @heyams @jeanbisutti -# ServiceLabel: %HPC Cache %Service Attention -#// @romahamu @omzevall +# ServiceLabel: %Network +# ServiceOwners: @aznetsuppgithub -# ServiceLabel: %Import Export %Service Attention -#// @madhurinms +# ServiceLabel: %Network - Application Gateway +# ServiceOwners: @appgwsuppgithub -# ServiceLabel: %KeyVault %Service Attention -#// @RandalliLama @schaabs @jlichwa +# ServiceLabel: %Network - CDN +# ServiceOwners: @cdnfdsuppgithub -# ServiceLabel: %Kubernetes Configuration %Service Attention -#// @NarayanThiru +# ServiceLabel: %Network - DDOS Protection +# ServiceOwners: @ddossuppgithub -# ServiceLabel: %Azure Data Explorer %Service Attention -#// @ilayrn @astauben @zoharHenMicrosoft @sagivf @Aviv-Yaniv +# ServiceLabel: %Network - ExpressRoute +# ServiceOwners: @exrsuppgithub -# ServiceLabel: %Lab Services %Service Attention -#// @Tanmayeekamath +# ServiceLabel: %Network - Firewall +# ServiceOwners: @fwsuppgithub -# ServiceLabel: %Logic App %Service Attention -#// @Azure/azure-logicapps-team +# ServiceLabel: %Network - Front Door +# ServiceOwners: @cdnfdsuppgithub -# ServiceLabel: %LOUIS %Service Attention -#// @minamnmik +# ServiceLabel: %Network - Load Balancer +# ServiceOwners: @slbsupportgithub -# ServiceLabel: %Managed Identity %Service Attention -#// @varunkch +# ServiceLabel: %Network - Virtual Network NAT +# ServiceOwners: @vnetsuppgithub -# ServiceLabel: %Machine Learning %Service Attention -#// @azureml-github +# ServiceLabel: %Network - Network Watcher +# ServiceOwners: @netwatchsuppgithub -# ServiceLabel: %Machine Learning Compute %Service Attention -#// @azureml-github +# ServiceLabel: %Network - DNS +# ServiceOwners: @dnssuppgithub -# ServiceLabel: %Machine Learning Experimentation %Service Attention -#// @aashishb +# ServiceLabel: %Network - Traffic Manager +# ServiceOwners: @tmsuppgithub -# ServiceLabel: %Managed Services %Service Attention -#// @Lighthouse-Azure +# ServiceLabel: %Network - VPN Gateway +# ServiceOwners: @vpngwsuppgithub -# ServiceLabel: %MariaDB %Service Attention -#// @ambhatna @savjani +# ServiceLabel: %Network - Virtual Network +# ServiceOwners: @vnetsuppgithub -# ServiceLabel: %Marketplace Ordering %Service Attention -#// @prbansa +# ServiceLabel: %Network - Virtual WAN +# ServiceOwners: @vwansuppgithub -# ServiceLabel: %Media Services %Service Attention -#// @akucer +# ServiceLabel: %Network - Network Virtual Appliance +# ServiceOwners: @nvasuppgithub -# ServiceLabel: %Migrate %Service Attention -#// @shijojoy +# ServiceLabel: %Network - Bastion +# ServiceOwners: @bastionsuppgithub -# ServiceLabel: %Mobile Engagement %Service Attention -#// @kpiteira +# ServiceLabel: %Network - Private Link +# ServiceOwners: @privlinksuppgithub -# ServiceLabel: %Monitor %Service Attention -#// @SameergMS @dadunl @AzMonEssential @AzmonAlerts @AzmonActionG @AzmonLogA +# ServiceLabel: %Notification Hub +# ServiceOwners: @tjsomasundaram -# ServiceLabel: %Monitor - ApplicationInsights %Service Attention -#// @azmonapplicationinsights +# PRLabel: %OpenAI +/sdk/openai/azure-ai-openai/ @brandom-msft @jpalvarezl @mssfang -# ServiceLabel: %MySQL %Service Attention -#// @ambhatna @savjani +# PRLabel: %OpenAI +/sdk/openai/azure-ai-openai-assistants/ @brandom-msft @jpalvarezl @mssfang -# ServiceLabel: %Network %Service Attention -#// @aznetsuppgithub +# ServiceLabel: %Operational Insights +# ServiceOwners: @AzmonLogA -# ServiceLabel: %Network - Application Gateway %Service Attention -#// @appgwsuppgithub +# ServiceLabel: %Policy +# ServiceOwners: @aperezcloud @kenieva -# ServiceLabel: %Network - CDN %Service Attention -#// @cdnfdsuppgithub +# ServiceLabel: %Policy Insights +# ServiceOwners: @kenieva -# ServiceLabel: %Network - DDOS Protection %Service Attention -#// @ddossuppgithub +# ServiceLabel: %PostgreSQL +# ServiceOwners: @sunilagarwal @lfittl-msft @sr-msft @niklarin -# ServiceLabel: %Network - ExpressRoute %Service Attention -#// @exrsuppgithub +# PRLabel: %Azure Quantum +/sdk/quantum/ @vxfield @cgranade @ricardo-espinoza @anjbur @msoeken @guenp -# ServiceLabel: %Network - Firewall %Service Attention -#// @fwsuppgithub +# ServiceLabel: %Recovery Services Backup +# ServiceOwners: @Daya-Patil -# ServiceLabel: %Network - Front Door %Service Attention -#// @cdnfdsuppgithub +# ServiceLabel: %Recovery Services Site-Recovery +# ServiceOwners: @Sharmistha-Rai -# ServiceLabel: %Network - Load Balancer %Service Attention -#// @slbsupportgithub +# ServiceLabel: %Redis Cache +# ServiceOwners: @yegu-ms -# ServiceLabel: %Network - Virtual Network NAT %Service Attention -#// @vnetsuppgithub +# ServiceLabel: %Relay +# ServiceOwners: @jfggdl -# ServiceLabel: %Network - Network Watcher %Service Attention -#// @netwatchsuppgithub +# PRLabel: %Remote Rendering +/sdk/remoterendering/ @MichaelZp0 @ChristopherManthei -# ServiceLabel: %Network - DNS %Service Attention -#// @dnssuppgithub +# ServiceLabel: %Reservations +# ServiceOwners: @Rkapso -# ServiceLabel: %Network - Traffic Manager %Service Attention -#// @tmsuppgithub +# ServiceLabel: %Resource Authorization +# ServiceOwners: @darshanhs90 @AshishGargMicrosoft -# ServiceLabel: %Network - VPN Gateway %Service Attention -#// @vpngwsuppgithub +# ServiceLabel: %Resource Graph +# ServiceOwners: @chiragg4u -# ServiceLabel: %Notification Hub %Service Attention -#// @tjsomasundaram +# ServiceLabel: %Resource Health +# ServiceOwners: @stephbaron -# ServiceLabel: %Operational Insights %Service Attention -#// @AzmonLogA +# ServiceLabel: %Scheduler +# ServiceOwners: @derek1ee -# ServiceLabel: %Policy %Service Attention -#// @aperezcloud @kenieva +# PRLabel: %Schema Registry +/sdk/schemaregistry/ @conniey @srnagar -# ServiceLabel: %Policy Insights %Service Attention -#// @kenieva +# ServiceLabel: %Schema Registry +# AzureSdkOwners: @conniey +# ServiceOwners: @hmlam -# ServiceLabel: %PostgreSQL %Service Attention -#// @sunilagarwal @lfittl-msft @sr-msft @niklarin +# PRLabel: %Search +/sdk/search/ @alzimmermsft @jairmyree @Azure/azsdk-search -# ServiceLabel: %Recovery Services Backup %Service Attention -#// @Daya-Patil +# ServiceLabel: %Search +# AzureSdkOwners: @alzimmermsft @jairmyree +# ServiceOwners: @bleroy @tjacobhi @markheff @miwelsh -# ServiceLabel: %Recovery Services Site-Recovery %Service Attention -#// @Sharmistha-Rai +# ServiceLabel: %Security +# ServiceOwners: @chlahav -# ServiceLabel: %Redis Cache %Service Attention -#// @yegu-ms +# ServiceLabel: %SecurityInsights +# ServiceOwners: @amirkeren -# ServiceLabel: %Relay %Service Attention -#// @jfggdl +# ServiceLabel: %Service Bus +# AzureSdkOwners: @anuchandy +# ServiceOwners: @EldertGrootenboer -# ServiceLabel: %Reservations %Service Attention -#// @Rkapso +# PRLabel: %Service Bus +/sdk/servicebus/ @anuchandy @conniey @lmolkova -# ServiceLabel: %Resource Authorization %Service Attention -#// @darshanhs90 @AshishGargMicrosoft +# PRLabel: %Service Bus %Track 1 +/sdk/servicebus/microsoft-azure-servicebus/ @shankarsama @yvgopal -# ServiceLabel: %Resource Graph %Service Attention -#// @chiragg4u +# ServiceLabel: %Service Bus %Track 1 +# AzureSdkOwners: @shankarsama @yvgopal -# ServiceLabel: %Resource Health %Service Attention -#// @stephbaron +# ServiceLabel: %Service Bus +# AzureSdkOwners: @anuchandy +# ServiceOwners: @EldertGrootenboer -# ServiceLabel: %Scheduler %Service Attention -#// @derek1ee +# ServiceLabel: %Service Fabric +# ServiceOwners: @QingChenmsft @vaishnavk @juhacket -# ServiceLabel: %Search %Service Attention -#// @bleroy @tjacobhi @markheff @miwelsh +# ServiceLabel: %SignalR +# ServiceOwners: @sffamily @chenkennt -# ServiceLabel: %Security %Service Attention -#// @chlahav +# ServiceLabel: %SQL +# ServiceOwners: @azureSQLGitHub -# ServiceLabel: %Service Attention %Service Fabric -#// @QingChenmsft @vaishnavk @juhacket +# ServiceLabel: %SQL - VM +# ServiceOwners: @azureSQLGitHub -# ServiceLabel: %Service Attention %SignalR -#// @sffamily @chenkennt +# ServiceLabel: %SQL - Backup & Restore +# ServiceOwners: @azureSQLGitHub -# ServiceLabel: %Service Attention %SQL -#// @azureSQLGitHub +# ServiceLabel: %SQL - Data Security +# ServiceOwners: @azureSQLGitHub -# ServiceLabel: %Service Attention %SQL - VM -#// @azureSQLGitHub +# ServiceLabel: %SQL - Elastic Jobs +# ServiceOwners: @azureSQLGitHub -# ServiceLabel: %Service Attention %SQL - Backup & Restore -#// @azureSQLGitHub +# ServiceLabel: %SQL - Managed Instance +# ServiceOwners: @azureSQLGitHub -# ServiceLabel: %Service Attention %SQL - Data Security -#// @azureSQLGitHub +# ServiceLabel: %SQL - Replication & Failover +# ServiceOwners: @azureSQLGitHub -# ServiceLabel: %Service Attention %SQL - Elastic Jobs -#// @azureSQLGitHub +# PRLabel: %Storage +/sdk/storage/ @ibrahimrabab @seanmcc-msft @ibrandes @alzimmermsft -# ServiceLabel: %Service Attention %SQL - Managed Instance -#// @azureSQLGitHub +# ServiceLabel: %Storage +# AzureSdkOwners: @ibrahimrabab @seanmcc-msft @ibrandes +# ServiceOwners: @xgithubtriage -# ServiceLabel: %Service Attention %SQL - Replication & Failover -#// @azureSQLGitHub +# ServiceLabel: %Storsimple +# ServiceOwners: @anoobbacker @ganzee @manuaery @patelkunal -# ServiceLabel: %Service Attention %Storage -#// @xgithubtriage +# ServiceLabel: %Stream Analytics +# ServiceOwners: @atpham256 -# ServiceLabel: %Service Attention %Storsimple -#// @anoobbacker @ganzee @manuaery @patelkunal +# ServiceLabel: %Subscription +# ServiceOwners: @anuragdalmia @shilpigautam @ramaganesan-rg -# ServiceLabel: %Service Attention %Stream Analytics -#// @atpham256 +# ServiceLabel: %Support +# ServiceOwners: @shahbj79 @mit2nil @aygoya @ganganarayanan -# ServiceLabel: %Service Attention %Subscription -#// @anuragdalmia @shilpigautam @ramaganesan-rg +# ServiceLabel: %Synapse +# ServiceOwners: @wonner @zesluo -# ServiceLabel: %Service Attention %Support -#// @shahbj79 @mit2nil @aygoya @ganganarayanan +# PRLabel: %Tables +/sdk/tables/ @jairmyree @vcolin7 -# ServiceLabel: %Service Attention %Synapse -#// @wonner @zesluo +# ServiceLabel: %Tables +# AzureSdkOwners: @jairmyree +# ServiceOwners: @klaaslanghout -# ServiceLabel: %Service Attention %Tables -#// @klaaslanghout +# PRLabel: %EngSys +/sdk/template/ @hallipr @weshaggard @JimSuplizio -# ServiceLabel: %Service Attention %TimeseriesInsights -#// @Shipra1Mishra +# ServiceLabel: %TimeseriesInsights +# ServiceOwners: @Shipra1Mishra -# ServiceLabel: %Service Attention %vFXT -#// @zhusijia26 +# ServiceLabel: %vFXT +# ServiceOwners: @zhusijia26 -# ServiceLabel: %Service Attention %Web Apps -#// @AzureAppServiceCLI @antcp +# ServiceLabel: %Web Apps +# ServiceOwners: @AzureAppServiceCLI @antcp -# ServiceLabel: %Network - Virtual Network %Service Attention -#// @vnetsuppgithub +# PRLabel: %Azure SDK Tools +/sdk/tools/ @srnagar @jonathangiles -# ServiceLabel: %Network - Virtual WAN %Service Attention -#// @vwansuppgithub +# ServiceLabel: %Azure SDK Tools +# AzureSdkOwners: @srnagar @jonathangiles -# ServiceLabel: %Network - Network Virtual Appliance %Service Attention -#// @nvasuppgithub +# ######## Spring ######## -# ServiceLabel: %Network - Bastion %Service Attention -#// @bastionsuppgithub +# ServiceLabel: %azure-spring +# AzureSdkOwners: @saragluna @chenrujun @netyyyy @moarychan # ServiceLabel: %Azure.Spring - Cosmos -#// @kushagraThapar +# ServiceOwners: @kushagraThapar -# ServiceLabel: %Network - Private Link %Service Attention -#// @privlinksuppgithub +# PRLabel: %azure-spring +/sdk/identity/azure-identity-extensions/ @chenrujun @netyyyy @saragluna @moarychan -# ServiceLabel: %Azure Arc enabled servers %Service Attention -#// @rpsqrd @edyoung +# PRLabel: %azure-spring +/sdk/keyvault/azure-security-keyvault-jca/ @chenrujun @netyyyy @saragluna @moarychan -# ServiceLabel: %SecurityInsights %Service Attention -#// @amirkeren +# PRLabel: %azure-spring +/sdk/spring/ @chenrujun @netyyyy @saragluna @moarychan -# ServiceLabel: %IoT - CLI %Service Attention -#// @Azure/azure-iot-cli-triage +# PRLabel: %azure-spring +/sdk/spring-experimental/ @chenrujun @netyyyy @saragluna @moarychan -# ServiceLabel: %Communication %Service Attention -#// @acsdevx-msft +# PRLabel: %Monitor - Spring +/sdk/spring/spring-cloud-azure-starter-monitor @jeanbisutti @trask @ramthi @heyams + +# PRLabel: %Monitor - Spring +/sdk/spring/spring-cloud-azure-starter-monitor-test @jeanbisutti @trask @ramthi @heyams -# ServiceLabel: %OpenTelemetry %Service Attention -#// @@cijothomas @@reyang @@rajkumar-rangaraj @@TimothyMothra @@vishweshbankwar @@ramthi +# ServiceLabel: %Monitor - Spring +# AzureSdkOwners: @jeanbisutti @trask @ramthi @heyams + +# PRLabel: %azure-spring +/sdk/spring/spring-cloud-azure-appconfiguration-config*/ @mrm9084 @chenrujun @netyyyy @saragluna @moarychan + +# PRLabel: %azure-spring +/sdk/spring/spring-cloud-azure-feature-management*/ @mrm9084 @chenrujun @netyyyy @saragluna @moarychan + +# PRLabel: %azure-spring +/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/ @mrm9084 @chenrujun @netyyyy @saragluna @moarychan -# ServiceLabel: %Cost Management - Budget %Service Attention -#// @ccmaxpcrew +# PRLabel: %azure-spring +/sdk/spring/azure-spring-data-cosmos/ @kushagraThapar @FabianMeiswinkel @trande4884 @TheovanKraay @xinlian12 @chenrujun @netyyyy @saragluna @moarychan @aayush3011 @simorenoh @jeet1995 @Pilchie -# ServiceLabel: %Consumption - Budget %Service Attention -#// @ccmaxpcrew +# ######## End-to-end tests ######## -# ServiceLabel: %Cost Management - Query %Service Attention -#// @ccmixpdevs +# PRLabel: %Azure.Identity +/sdk/e2e/ @g2vinay @billwert -# ServiceLabel: %Consumption - Query %Service Attention -#// @ccmixpdevs +# PRLabel: %common +/common/smoke-tests/ @alzimmermsft @srnagar @joshfree @jonathangiles @g2vinay @conniey -# ServiceLabel: %Cost Management - Billing %Service Attention -#// @ccmbpxpcrew +# ServiceLabel: %common +# AzureSdkOwners: @alzimmermsft @srnagar -# ServiceLabel: %Consumption - Billing %Service Attention -#// @ccmbpxpcrew +# ######## Management Plane ######## -# ServiceLabel: %Cost Management - UsageDetailsAndExport %Service Attention -#// @TiagoCrewGitHubIssues +# PRLabel: %Mgmt +/sdk/resourcemanager/ @weidongxu-microsoft @haolingdong-msft @XiaofeiCao @arthurma1978 -# ServiceLabel: %Consumption - UsageDetailsAndExport %Service Attention -#// @TiagoCrewGitHubIssues +# ServiceLabel: %Mgmt +# AzureSdkOwners: @weidongxu-microsoft -# ServiceLabel: %Cost Management - RIandShowBack %Service Attention -#// @ccmshowbackdevs +# PRLabel: %Mgmt +/sdk/**/azure-resourcemanager-*/ @weidongxu-microsoft @haolingdong-msft @XiaofeiCao @arthurma1978 -# ServiceLabel: %Consumption - RIandShowBack %Service Attention -#// @ccmshowbackdevs +# PRLabel: %Mgmt +/sdk/resourcemanagerhybrid/ @weidongxu-microsoft @haolingdong-msft @XiaofeiCao @arthurma1978 @bganapa -# ServiceLabel: %DevCenter %Service Attention -#// @sebrenna @mharlan +# ######## Eng Sys ######## -################ -# Eng Sys -################ /eng/ @hallipr @weshaggard @benbp @JimSuplizio +/eng/bomgenerator/ @vcolin7 @alzimmermsft @srnagar @jonathangiles /eng/code-quality-reports/ @mssfang @JonathanGiles -/eng/spotbugs-aggregate-report/ @srnagar @JonathanGiles /eng/mgmt/ @weidongxu-microsoft @haolingdong-msft @XiaofeiCao @arthurma1978 @hallipr @weshaggard @benbp @JimSuplizio +/eng/spotbugs-aggregate-report/ @srnagar @JonathanGiles /eng/versioning/ @alzimmermsft @samvaity @g2vinay @JimSuplizio /eng/versioning/external_dependencies.txt @alzimmermsft @samvaity @g2vinay @jonathangiles @chenrujun @netyyyy @saragluna @moarychan -/eng/bomgenerator/ @vcolin7 @alzimmermsft @srnagar @jonathangiles -/sdk/parents/ @alzimmermsft # Add owners for notifications for specific pipelines /eng/pipelines/aggregate-reports.yml @joshfree @jonathangiles From c11f1aadca4cfa68f62c8ec6535d6b4654571231 Mon Sep 17 00:00:00 2001 From: Helen <56097766+heyams@users.noreply.github.com> Date: Mon, 11 Mar 2024 13:46:02 -0700 Subject: [PATCH 13/90] Prepare to release beta.21 (#39159) * Prepare to release beta.21 * Reword Co-authored-by: Trask Stalnaker --------- Co-authored-by: Trask Stalnaker --- .../azure-monitor-opentelemetry-exporter/CHANGELOG.md | 11 +++-------- .../azure-monitor-opentelemetry-exporter/README.md | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/sdk/monitor/azure-monitor-opentelemetry-exporter/CHANGELOG.md b/sdk/monitor/azure-monitor-opentelemetry-exporter/CHANGELOG.md index 0b812e07e0ece..050071f84af81 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-exporter/CHANGELOG.md +++ b/sdk/monitor/azure-monitor-opentelemetry-exporter/CHANGELOG.md @@ -1,14 +1,9 @@ # Release History -## 1.0.0-beta.21 (Unreleased) - -### Features Added - -### Breaking Changes +## 1.0.0-beta.21 (2024-03-11) ### Bugs Fixed - -### Other Changes +- [Support stable HTTP semconv url.query](https://github.com/Azure/azure-sdk-for-java/pull/39133) ## 1.0.0-beta.20 (2024-03-07) @@ -16,7 +11,7 @@ - [Support ingestion sampling](https://github.com/Azure/azure-sdk-for-java/pull/39103) ### Bugs Fixed -- [Avoid warning on sporadic connection failures] (https://github.com/Azure/azure-sdk-for-java/pull/39021) +- [Avoid warning on sporadic connection failures](https://github.com/Azure/azure-sdk-for-java/pull/39021) ## 1.0.0-beta.19 (2024-02-23) diff --git a/sdk/monitor/azure-monitor-opentelemetry-exporter/README.md b/sdk/monitor/azure-monitor-opentelemetry-exporter/README.md index f3e8541a4760a..810e2a5455a2b 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-exporter/README.md +++ b/sdk/monitor/azure-monitor-opentelemetry-exporter/README.md @@ -23,7 +23,7 @@ For more information, please read [introduction to Application Insights][applica com.azure azure-monitor-opentelemetry-exporter - 1.0.0-beta.20/version> + 1.0.0-beta.21/version> ``` [//]: # ({x-version-update-end}) From 44c019ce73aec00d5175ae165a21fb04ad5cf0a0 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Mon, 11 Mar 2024 17:07:36 -0400 Subject: [PATCH 14/90] Skip env processing on matrix import step (#39160) Co-authored-by: Ben Broderick Phillips --- .../scripts/job-matrix/job-matrix-functions.ps1 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/eng/common/scripts/job-matrix/job-matrix-functions.ps1 b/eng/common/scripts/job-matrix/job-matrix-functions.ps1 index 198d68f00f7f2..f20dbe5281b05 100644 --- a/eng/common/scripts/job-matrix/job-matrix-functions.ps1 +++ b/eng/common/scripts/job-matrix/job-matrix-functions.ps1 @@ -96,7 +96,8 @@ function GenerateMatrix( [String]$displayNameFilter = ".*", [Array]$filters = @(), [Array]$replace = @(), - [Array]$nonSparseParameters = @() + [Array]$nonSparseParameters = @(), + [Switch]$skipEnvironmentVariables ) { $matrixParameters, $importedMatrix, $combinedDisplayNameLookup = ` ProcessImport $config.matrixParameters $selectFromMatrixType $nonSparseParameters $config.displayNamesLookup @@ -124,7 +125,9 @@ function GenerateMatrix( $matrix = FilterMatrix $matrix $filters $matrix = ProcessReplace $matrix $replace $combinedDisplayNameLookup - $matrix = ProcessEnvironmentVariableReferences $matrix $combinedDisplayNameLookup + if (!$skipEnvironmentVariables) { + $matrix = ProcessEnvironmentVariableReferences $matrix $combinedDisplayNameLookup + } $matrix = FilterMatrixDisplayName $matrix $displayNameFilter return $matrix } @@ -427,10 +430,14 @@ function ProcessImport([MatrixParameter[]]$matrix, [String]$selection, [Array]$n exit 1 } $importedMatrixConfig = GetMatrixConfigFromFile (Get-Content -Raw $importPath) + # Add skipEnvironmentVariables so we don't process environment variables on import + # because we want top level filters to work against the the env key, not the value. + # The environment variables will get resolved after the import. $importedMatrix = GenerateMatrix ` -config $importedMatrixConfig ` -selectFromMatrixType $selection ` - -nonSparseParameters $nonSparseParameters + -nonSparseParameters $nonSparseParameters ` + -skipEnvironmentVariables $combinedDisplayNameLookup = $importedMatrixConfig.displayNamesLookup foreach ($lookup in $displayNamesLookup.GetEnumerator()) { From e0fc329124a69ec2a88109c1bd2d90515d40119c Mon Sep 17 00:00:00 2001 From: Jair Myree Date: Mon, 11 Mar 2024 14:50:21 -0700 Subject: [PATCH 15/90] Prepare Search March 2024 Beta Release (#39161) * Prepare Search March 2024 Beta Release * updating code coverage requirements --- sdk/search/azure-search-documents/CHANGELOG.md | 17 +++++++++-------- sdk/search/azure-search-documents/README.md | 2 +- .../src/samples/README.md | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index 3120ce8f1d841..cb266dd6656c0 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -1,23 +1,24 @@ # Release History -## 11.7.0-beta.2 (Unreleased) +## 11.7.0-beta.2 (2024-03-11) ### Features Added -### Breaking Changes - -### Bugs Fixed +- Added support for the java types `Byte` and `Short` to FieldBuilder. +- Added support for "isStored" annotation to FieldBuilder. +- Added `VectorSearchCompressionConfiguration` to `VectorSearch` -### Other Changes +### Breaking Changes -## 11.6.1 (2024-02-22) +- Replaced `SearchErrorException` with `ErrorResponseException` ### Other Changes #### Dependency Updates -- Upgraded `azure-core` from `1.45.1` to version `1.46.0`. -- Upgraded `azure-core-http-netty` from `1.13.11` to version `1.14.0`. +- Upgraded `azure-core-serializer-json-jackson` to version `1.4.10`. +- Upgraded `azure-core-http-netty` to version `1.14.1`. +- Upgraded `azure-core` to version `1.47.0`. ## 11.7.0-beta.1 (2024-02-09) diff --git a/sdk/search/azure-search-documents/README.md b/sdk/search/azure-search-documents/README.md index 02623a2fe8dc3..513dcde4d890f 100644 --- a/sdk/search/azure-search-documents/README.md +++ b/sdk/search/azure-search-documents/README.md @@ -75,7 +75,7 @@ add the direct dependency to your project as follows. com.azure azure-search-documents - 11.6.2 + 11.7.0-beta.2 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/search/azure-search-documents/src/samples/README.md b/sdk/search/azure-search-documents/src/samples/README.md index d578bc8d413c6..de5e01dc3c05a 100644 --- a/sdk/search/azure-search-documents/src/samples/README.md +++ b/sdk/search/azure-search-documents/src/samples/README.md @@ -61,7 +61,7 @@ add the direct dependency to your project as follows. com.azure azure-search-documents - 11.6.2 + 11.7.0-beta.2 ``` [//]: # ({x-version-update-end}) From 0b0e2251b263013a66ed26bc11ac479bd4cddfa7 Mon Sep 17 00:00:00 2001 From: Bill Wert Date: Mon, 11 Mar 2024 16:14:28 -0700 Subject: [PATCH 16/90] New ApiCenter events (#39005) * New ApiCenter events * update to final --- .../messaging/eventgrid/SystemEventNames.java | 14 ++ .../ApiCenterApiDefinitionAddedEventData.java | 141 ++++++++++++++++++ ...piCenterApiDefinitionUpdatedEventData.java | 141 ++++++++++++++++++ .../ApiCenterApiSpecification.java | 110 ++++++++++++++ .../swagger/README.md | 53 +++---- 5 files changed, 433 insertions(+), 26 deletions(-) create mode 100644 sdk/eventgrid/azure-messaging-eventgrid/src/main/java/com/azure/messaging/eventgrid/systemevents/ApiCenterApiDefinitionAddedEventData.java create mode 100644 sdk/eventgrid/azure-messaging-eventgrid/src/main/java/com/azure/messaging/eventgrid/systemevents/ApiCenterApiDefinitionUpdatedEventData.java create mode 100644 sdk/eventgrid/azure-messaging-eventgrid/src/main/java/com/azure/messaging/eventgrid/systemevents/ApiCenterApiSpecification.java diff --git a/sdk/eventgrid/azure-messaging-eventgrid/src/main/java/com/azure/messaging/eventgrid/SystemEventNames.java b/sdk/eventgrid/azure-messaging-eventgrid/src/main/java/com/azure/messaging/eventgrid/SystemEventNames.java index 28a9953f36392..66f3177fdb076 100644 --- a/sdk/eventgrid/azure-messaging-eventgrid/src/main/java/com/azure/messaging/eventgrid/SystemEventNames.java +++ b/sdk/eventgrid/azure-messaging-eventgrid/src/main/java/com/azure/messaging/eventgrid/SystemEventNames.java @@ -50,6 +50,8 @@ import com.azure.messaging.eventgrid.systemevents.AcsSmsDeliveryReportReceivedEventData; import com.azure.messaging.eventgrid.systemevents.AcsSmsReceivedEventData; import com.azure.messaging.eventgrid.systemevents.AcsUserDisconnectedEventData; +import com.azure.messaging.eventgrid.systemevents.ApiCenterApiDefinitionAddedEventData; +import com.azure.messaging.eventgrid.systemevents.ApiCenterApiDefinitionUpdatedEventData; import com.azure.messaging.eventgrid.systemevents.ApiManagementApiCreatedEventData; import com.azure.messaging.eventgrid.systemevents.ApiManagementApiDeletedEventData; import com.azure.messaging.eventgrid.systemevents.ApiManagementApiReleaseCreatedEventData; @@ -488,6 +490,16 @@ public final class SystemEventNames { */ public static final String COMMUNICATION_USER_DISCONNECTED = "Microsoft.Communication.UserDisconnected"; + /** + * Schema of the data property of an EventGridEvent for a Microsoft.ApiCenter.ApiDefinitionAdded event. + */ + public static final String API_CENTER_API_DEFINITION_ADDED = "Microsoft.ApiCenter.ApiDefinitionAdded"; + + /** + * Schema of the data property of an EventGridEvent for a Microsoft.ApiCenter.ApiDefinitionUpdated event. + */ + public static final String API_CENTER_API_DEFINITION_UPDATED = "Microsoft.ApiCenter.ApiDefinitionUpdated"; + /** * Schema of the Data property of an EventGridEvent for a Microsoft.ApiManagement.APICreated event. */ @@ -1490,6 +1502,8 @@ public final class SystemEventNames { put(COMMUNICATION_SMS_DELIVERY_REPORT_RECEIVED, AcsSmsDeliveryReportReceivedEventData.class); put(COMMUNICATION_SMS_RECEIVED, AcsSmsReceivedEventData.class); put(COMMUNICATION_USER_DISCONNECTED, AcsUserDisconnectedEventData.class); + put(API_CENTER_API_DEFINITION_ADDED, ApiCenterApiDefinitionAddedEventData.class); + put(API_CENTER_API_DEFINITION_UPDATED, ApiCenterApiDefinitionUpdatedEventData.class); put(API_MANAGEMENT_API_CREATED, ApiManagementApiCreatedEventData.class); put(API_MANAGEMENT_API_DELETED, ApiManagementApiDeletedEventData.class); put(API_MANAGEMENT_API_RELEASE_CREATED, ApiManagementApiReleaseCreatedEventData.class); diff --git a/sdk/eventgrid/azure-messaging-eventgrid/src/main/java/com/azure/messaging/eventgrid/systemevents/ApiCenterApiDefinitionAddedEventData.java b/sdk/eventgrid/azure-messaging-eventgrid/src/main/java/com/azure/messaging/eventgrid/systemevents/ApiCenterApiDefinitionAddedEventData.java new file mode 100644 index 0000000000000..792eff342eafd --- /dev/null +++ b/sdk/eventgrid/azure-messaging-eventgrid/src/main/java/com/azure/messaging/eventgrid/systemevents/ApiCenterApiDefinitionAddedEventData.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.messaging.eventgrid.systemevents; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Schema of the data property of an EventGridEvent for a Microsoft.ApiCenter.ApiDefinitionAdded event. + */ +@Fluent +public final class ApiCenterApiDefinitionAddedEventData + implements JsonSerializable { + /* + * API definition title. + */ + private String title; + + /* + * API definition description. + */ + private String description; + + /* + * API specification details. + */ + private ApiCenterApiSpecification specification; + + /** + * Creates an instance of ApiCenterApiDefinitionAddedEventData class. + */ + public ApiCenterApiDefinitionAddedEventData() { + } + + /** + * Get the title property: API definition title. + * + * @return the title value. + */ + public String getTitle() { + return this.title; + } + + /** + * Set the title property: API definition title. + * + * @param title the title value to set. + * @return the ApiCenterApiDefinitionAddedEventData object itself. + */ + public ApiCenterApiDefinitionAddedEventData setTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the description property: API definition description. + * + * @return the description value. + */ + public String getDescription() { + return this.description; + } + + /** + * Set the description property: API definition description. + * + * @param description the description value to set. + * @return the ApiCenterApiDefinitionAddedEventData object itself. + */ + public ApiCenterApiDefinitionAddedEventData setDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the specification property: API specification details. + * + * @return the specification value. + */ + public ApiCenterApiSpecification getSpecification() { + return this.specification; + } + + /** + * Set the specification property: API specification details. + * + * @param specification the specification value to set. + * @return the ApiCenterApiDefinitionAddedEventData object itself. + */ + public ApiCenterApiDefinitionAddedEventData setSpecification(ApiCenterApiSpecification specification) { + this.specification = specification; + return this; + } + + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("title", this.title); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeJsonField("specification", this.specification); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiCenterApiDefinitionAddedEventData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiCenterApiDefinitionAddedEventData if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApiCenterApiDefinitionAddedEventData. + */ + public static ApiCenterApiDefinitionAddedEventData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiCenterApiDefinitionAddedEventData deserializedApiCenterApiDefinitionAddedEventData + = new ApiCenterApiDefinitionAddedEventData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("title".equals(fieldName)) { + deserializedApiCenterApiDefinitionAddedEventData.title = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedApiCenterApiDefinitionAddedEventData.description = reader.getString(); + } else if ("specification".equals(fieldName)) { + deserializedApiCenterApiDefinitionAddedEventData.specification + = ApiCenterApiSpecification.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedApiCenterApiDefinitionAddedEventData; + }); + } +} diff --git a/sdk/eventgrid/azure-messaging-eventgrid/src/main/java/com/azure/messaging/eventgrid/systemevents/ApiCenterApiDefinitionUpdatedEventData.java b/sdk/eventgrid/azure-messaging-eventgrid/src/main/java/com/azure/messaging/eventgrid/systemevents/ApiCenterApiDefinitionUpdatedEventData.java new file mode 100644 index 0000000000000..dd4fcc9dfc221 --- /dev/null +++ b/sdk/eventgrid/azure-messaging-eventgrid/src/main/java/com/azure/messaging/eventgrid/systemevents/ApiCenterApiDefinitionUpdatedEventData.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.messaging.eventgrid.systemevents; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Schema of the data property of an EventGridEvent for a Microsoft.ApiCenter.ApiDefinitionUpdated event. + */ +@Fluent +public final class ApiCenterApiDefinitionUpdatedEventData + implements JsonSerializable { + /* + * API definition title. + */ + private String title; + + /* + * API definition description. + */ + private String description; + + /* + * API specification details. + */ + private ApiCenterApiSpecification specification; + + /** + * Creates an instance of ApiCenterApiDefinitionUpdatedEventData class. + */ + public ApiCenterApiDefinitionUpdatedEventData() { + } + + /** + * Get the title property: API definition title. + * + * @return the title value. + */ + public String getTitle() { + return this.title; + } + + /** + * Set the title property: API definition title. + * + * @param title the title value to set. + * @return the ApiCenterApiDefinitionUpdatedEventData object itself. + */ + public ApiCenterApiDefinitionUpdatedEventData setTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the description property: API definition description. + * + * @return the description value. + */ + public String getDescription() { + return this.description; + } + + /** + * Set the description property: API definition description. + * + * @param description the description value to set. + * @return the ApiCenterApiDefinitionUpdatedEventData object itself. + */ + public ApiCenterApiDefinitionUpdatedEventData setDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the specification property: API specification details. + * + * @return the specification value. + */ + public ApiCenterApiSpecification getSpecification() { + return this.specification; + } + + /** + * Set the specification property: API specification details. + * + * @param specification the specification value to set. + * @return the ApiCenterApiDefinitionUpdatedEventData object itself. + */ + public ApiCenterApiDefinitionUpdatedEventData setSpecification(ApiCenterApiSpecification specification) { + this.specification = specification; + return this; + } + + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("title", this.title); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeJsonField("specification", this.specification); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiCenterApiDefinitionUpdatedEventData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiCenterApiDefinitionUpdatedEventData if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApiCenterApiDefinitionUpdatedEventData. + */ + public static ApiCenterApiDefinitionUpdatedEventData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiCenterApiDefinitionUpdatedEventData deserializedApiCenterApiDefinitionUpdatedEventData + = new ApiCenterApiDefinitionUpdatedEventData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("title".equals(fieldName)) { + deserializedApiCenterApiDefinitionUpdatedEventData.title = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedApiCenterApiDefinitionUpdatedEventData.description = reader.getString(); + } else if ("specification".equals(fieldName)) { + deserializedApiCenterApiDefinitionUpdatedEventData.specification + = ApiCenterApiSpecification.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedApiCenterApiDefinitionUpdatedEventData; + }); + } +} diff --git a/sdk/eventgrid/azure-messaging-eventgrid/src/main/java/com/azure/messaging/eventgrid/systemevents/ApiCenterApiSpecification.java b/sdk/eventgrid/azure-messaging-eventgrid/src/main/java/com/azure/messaging/eventgrid/systemevents/ApiCenterApiSpecification.java new file mode 100644 index 0000000000000..eaadd45244f95 --- /dev/null +++ b/sdk/eventgrid/azure-messaging-eventgrid/src/main/java/com/azure/messaging/eventgrid/systemevents/ApiCenterApiSpecification.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.messaging.eventgrid.systemevents; + +import com.azure.core.annotation.Fluent; +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 specification details. + */ +@Fluent +public final class ApiCenterApiSpecification implements JsonSerializable { + /* + * Specification name. + */ + private String name; + + /* + * Specification version. + */ + private String version; + + /** + * Creates an instance of ApiCenterApiSpecification class. + */ + public ApiCenterApiSpecification() { + } + + /** + * Get the name property: Specification name. + * + * @return the name value. + */ + public String getName() { + return this.name; + } + + /** + * Set the name property: Specification name. + * + * @param name the name value to set. + * @return the ApiCenterApiSpecification object itself. + */ + public ApiCenterApiSpecification setName(String name) { + this.name = name; + return this; + } + + /** + * Get the version property: Specification version. + * + * @return the version value. + */ + public String getVersion() { + return this.version; + } + + /** + * Set the version property: Specification version. + * + * @param version the version value to set. + * @return the ApiCenterApiSpecification object itself. + */ + public ApiCenterApiSpecification setVersion(String version) { + this.version = version; + return this; + } + + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiCenterApiSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiCenterApiSpecification if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApiCenterApiSpecification. + */ + public static ApiCenterApiSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiCenterApiSpecification deserializedApiCenterApiSpecification = new ApiCenterApiSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedApiCenterApiSpecification.name = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedApiCenterApiSpecification.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApiCenterApiSpecification; + }); + } +} diff --git a/sdk/eventgrid/azure-messaging-eventgrid/swagger/README.md b/sdk/eventgrid/azure-messaging-eventgrid/swagger/README.md index 3e360cde9c3fd..dcc333f8cfd8d 100644 --- a/sdk/eventgrid/azure-messaging-eventgrid/swagger/README.md +++ b/sdk/eventgrid/azure-messaging-eventgrid/swagger/README.md @@ -78,32 +78,33 @@ custom-types: CloudEvent,EventGridEvent,AcsRouterCommunicationError model-override-setter-from-superclass: true input-file: -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/46e9f311c397352c1f9b60c5277bf6f982c3c172/specification/eventgrid/data-plane/Microsoft.Storage/stable/2018-01-01/Storage.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/46e9f311c397352c1f9b60c5277bf6f982c3c172/specification/eventgrid/data-plane/Microsoft.EventHub/stable/2018-01-01/EventHub.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/46e9f311c397352c1f9b60c5277bf6f982c3c172/specification/eventgrid/data-plane/Microsoft.Resources/stable/2018-01-01/Resources.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/46e9f311c397352c1f9b60c5277bf6f982c3c172/specification/eventgrid/data-plane/Microsoft.EventGrid/stable/2018-01-01/EventGrid.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/46e9f311c397352c1f9b60c5277bf6f982c3c172/specification/eventgrid/data-plane/Microsoft.EventGrid/stable/2018-01-01/SystemEvents.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/46e9f311c397352c1f9b60c5277bf6f982c3c172/specification/eventgrid/data-plane/Microsoft.Devices/stable/2018-01-01/IotHub.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/46e9f311c397352c1f9b60c5277bf6f982c3c172/specification/eventgrid/data-plane/Microsoft.ContainerRegistry/stable/2018-01-01/ContainerRegistry.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/46e9f311c397352c1f9b60c5277bf6f982c3c172/specification/eventgrid/data-plane/Microsoft.ServiceBus/stable/2018-01-01/ServiceBus.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/46e9f311c397352c1f9b60c5277bf6f982c3c172/specification/eventgrid/data-plane/Microsoft.Media/stable/2018-01-01/MediaServices.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/46e9f311c397352c1f9b60c5277bf6f982c3c172/specification/eventgrid/data-plane/Microsoft.Maps/stable/2018-01-01/Maps.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/46e9f311c397352c1f9b60c5277bf6f982c3c172/specification/eventgrid/data-plane/Microsoft.AppConfiguration/stable/2018-01-01/AppConfiguration.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/46e9f311c397352c1f9b60c5277bf6f982c3c172/specification/eventgrid/data-plane/Microsoft.SignalRService/stable/2018-01-01/SignalRService.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/46e9f311c397352c1f9b60c5277bf6f982c3c172/specification/eventgrid/data-plane/Microsoft.KeyVault/stable/2018-01-01/KeyVault.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/46e9f311c397352c1f9b60c5277bf6f982c3c172/specification/eventgrid/data-plane/Microsoft.MachineLearningServices/stable/2018-01-01/MachineLearningServices.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/46e9f311c397352c1f9b60c5277bf6f982c3c172/specification/eventgrid/data-plane/Microsoft.Cache/stable/2018-01-01/RedisCache.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/46e9f311c397352c1f9b60c5277bf6f982c3c172/specification/eventgrid/data-plane/Microsoft.Web/stable/2018-01-01/Web.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/46e9f311c397352c1f9b60c5277bf6f982c3c172/specification/eventgrid/data-plane/Microsoft.Communication/stable/2018-01-01/AzureCommunicationServices.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/46e9f311c397352c1f9b60c5277bf6f982c3c172/specification/eventgrid/data-plane/Microsoft.PolicyInsights/stable/2018-01-01/PolicyInsights.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/46e9f311c397352c1f9b60c5277bf6f982c3c172/specification/eventgrid/data-plane/Microsoft.ContainerService/stable/2018-01-01/ContainerService.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/46e9f311c397352c1f9b60c5277bf6f982c3c172/specification/eventgrid/data-plane/Microsoft.ApiManagement/stable/2018-01-01/APIManagement.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/46e9f311c397352c1f9b60c5277bf6f982c3c172/specification/eventgrid/data-plane/Microsoft.HealthcareApis/stable/2018-01-01/HealthcareApis.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/46e9f311c397352c1f9b60c5277bf6f982c3c172/specification/eventgrid/data-plane/Microsoft.DataBox/stable/2018-01-01/DataBox.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/46e9f311c397352c1f9b60c5277bf6f982c3c172/specification/eventgrid/data-plane/Microsoft.ResourceNotifications/stable/2018-01-01/common.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/46e9f311c397352c1f9b60c5277bf6f982c3c172/specification/eventgrid/data-plane/Microsoft.ResourceNotifications/stable/2018-01-01/HealthResources.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/46e9f311c397352c1f9b60c5277bf6f982c3c172/specification/eventgrid/data-plane/Microsoft.ResourceNotifications/stable/2018-01-01/Resources.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/46e9f311c397352c1f9b60c5277bf6f982c3c172/specification/eventgrid/data-plane/Microsoft.AVS/stable/2018-01-01/PrivateCloud.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/64819c695760764afa059d799fc7320d3fee33de/specification/eventgrid/data-plane/Microsoft.Storage/stable/2018-01-01/Storage.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/64819c695760764afa059d799fc7320d3fee33de/specification/eventgrid/data-plane/Microsoft.EventHub/stable/2018-01-01/EventHub.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/64819c695760764afa059d799fc7320d3fee33de/specification/eventgrid/data-plane/Microsoft.Resources/stable/2018-01-01/Resources.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/64819c695760764afa059d799fc7320d3fee33de/specification/eventgrid/data-plane/Microsoft.EventGrid/stable/2018-01-01/EventGrid.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/64819c695760764afa059d799fc7320d3fee33de/specification/eventgrid/data-plane/Microsoft.EventGrid/stable/2018-01-01/SystemEvents.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/64819c695760764afa059d799fc7320d3fee33de/specification/eventgrid/data-plane/Microsoft.Devices/stable/2018-01-01/IotHub.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/64819c695760764afa059d799fc7320d3fee33de/specification/eventgrid/data-plane/Microsoft.ContainerRegistry/stable/2018-01-01/ContainerRegistry.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/64819c695760764afa059d799fc7320d3fee33de/specification/eventgrid/data-plane/Microsoft.ServiceBus/stable/2018-01-01/ServiceBus.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/64819c695760764afa059d799fc7320d3fee33de/specification/eventgrid/data-plane/Microsoft.Media/stable/2018-01-01/MediaServices.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/64819c695760764afa059d799fc7320d3fee33de/specification/eventgrid/data-plane/Microsoft.Maps/stable/2018-01-01/Maps.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/64819c695760764afa059d799fc7320d3fee33de/specification/eventgrid/data-plane/Microsoft.AppConfiguration/stable/2018-01-01/AppConfiguration.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/64819c695760764afa059d799fc7320d3fee33de/specification/eventgrid/data-plane/Microsoft.SignalRService/stable/2018-01-01/SignalRService.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/64819c695760764afa059d799fc7320d3fee33de/specification/eventgrid/data-plane/Microsoft.KeyVault/stable/2018-01-01/KeyVault.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/64819c695760764afa059d799fc7320d3fee33de/specification/eventgrid/data-plane/Microsoft.MachineLearningServices/stable/2018-01-01/MachineLearningServices.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/64819c695760764afa059d799fc7320d3fee33de/specification/eventgrid/data-plane/Microsoft.Cache/stable/2018-01-01/RedisCache.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/64819c695760764afa059d799fc7320d3fee33de/specification/eventgrid/data-plane/Microsoft.Web/stable/2018-01-01/Web.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/64819c695760764afa059d799fc7320d3fee33de/specification/eventgrid/data-plane/Microsoft.Communication/stable/2018-01-01/AzureCommunicationServices.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/64819c695760764afa059d799fc7320d3fee33de/specification/eventgrid/data-plane/Microsoft.PolicyInsights/stable/2018-01-01/PolicyInsights.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/64819c695760764afa059d799fc7320d3fee33de/specification/eventgrid/data-plane/Microsoft.ContainerService/stable/2018-01-01/ContainerService.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/64819c695760764afa059d799fc7320d3fee33de/specification/eventgrid/data-plane/Microsoft.ApiManagement/stable/2018-01-01/APIManagement.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/64819c695760764afa059d799fc7320d3fee33de/specification/eventgrid/data-plane/Microsoft.HealthcareApis/stable/2018-01-01/HealthcareApis.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/64819c695760764afa059d799fc7320d3fee33de/specification/eventgrid/data-plane/Microsoft.DataBox/stable/2018-01-01/DataBox.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/64819c695760764afa059d799fc7320d3fee33de/specification/eventgrid/data-plane/Microsoft.ResourceNotifications/stable/2018-01-01/common.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/64819c695760764afa059d799fc7320d3fee33de/specification/eventgrid/data-plane/Microsoft.ResourceNotifications/stable/2018-01-01/HealthResources.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/64819c695760764afa059d799fc7320d3fee33de/specification/eventgrid/data-plane/Microsoft.ResourceNotifications/stable/2018-01-01/Resources.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/64819c695760764afa059d799fc7320d3fee33de/specification/eventgrid/data-plane/Microsoft.AVS/stable/2018-01-01/PrivateCloud.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/64819c695760764afa059d799fc7320d3fee33de/specification/eventgrid/data-plane/Microsoft.ApiCenter/stable/2018-01-01/ApiCenter.json ``` ### KeyVault updates From c41fbec1476b92771ec5756e806640bf48324acb Mon Sep 17 00:00:00 2001 From: Srikanta <51379715+srnagar@users.noreply.github.com> Date: Mon, 11 Mar 2024 16:36:39 -0700 Subject: [PATCH 17/90] Azure Monitor Query: Update to latest GA service version (#39051) * Regenerate metrics clients from latest swagger * use 2024-02-01 version --- sdk/monitor/azure-monitor-query/README.md | 6 +- sdk/monitor/azure-monitor-query/assets.json | 2 +- ...yncClient.java => MetricsAsyncClient.java} | 12 +- .../MetricsBatchQueryServiceVersion.java | 35 - ...tchQueryClient.java => MetricsClient.java} | 12 +- ...Builder.java => MetricsClientBuilder.java} | 66 +- .../query/MetricsQueryAsyncClient.java | 2 +- .../monitor/query/MetricsQueryClient.java | 2 +- .../monitor/query/MetricsServiceVersion.java | 35 + .../implementation/metrics/MetricsImpl.java | 971 +++++++++++++++--- .../metrics/MonitorManagementClientImpl.java | 38 +- .../MonitorManagementClientImplBuilder.java | 42 +- .../metrics/models/ErrorAdditionalInfo.java | 50 + .../metrics/models/ErrorContract.java | 55 + .../models/ErrorContractException.java | 42 + .../metrics/models/ErrorResponse.java | 75 +- .../implementation/metrics/models/Metric.java | 16 +- .../metrics/models/MetricResultType.java | 54 + .../metrics/models/MetricUnit.java | 27 +- .../metrics/models/MetricsHelper.java | 2 +- .../metrics/models/MetricsResponse.java | 4 +- ...tionScopeMetricsRequestBodyParameters.java | 388 +++++++ .../metrics/models/TimeSeriesElement.java | 6 +- .../metrics/models/package-info.java | 4 +- .../implementation/metrics/package-info.java | 4 +- .../AzureMonitorMetricBatchBuilder.java | 12 +- .../metricsbatch/MetricsBatches.java | 137 ++- .../models/AdditionalInfoErrorResponse.java | 41 - .../AdditionalInfoErrorResponseError.java | 86 -- ...oErrorResponseErrorAdditionalInfoItem.java | 72 -- .../models/ErrorAdditionalInfo.java | 50 + .../metricsbatch/models/ErrorDetail.java | 96 ++ .../metricsbatch/models/ErrorResponse.java | 49 + ...ption.java => ErrorResponseException.java} | 17 +- .../metricsbatch/models/Metric.java | 16 +- .../MetricResultsResponseValuesItem.java | 28 +- .../metricsbatch/models/MetricUnit.java | 27 +- .../models/TimeSeriesElement.java | 6 +- .../MetricDefinitionsImpl.java | 197 +++- .../MetricsDefinitionsClientImpl.java | 38 +- .../MetricsDefinitionsClientImplBuilder.java | 42 +- .../models/AggregationType.java | 2 +- .../models/ErrorAdditionalInfo.java | 50 + .../models/ErrorContract.java | 55 + .../models/ErrorContractException.java | 42 + .../models/ErrorResponse.java | 75 +- .../models/MetricAggregationType.java | 73 ++ .../models/MetricAvailability.java | 17 +- .../models/MetricDefinition.java | 48 +- .../models/MetricDefinitionCollection.java | 4 +- .../metricsdefinitions/models/MetricUnit.java | 27 +- .../SubscriptionScopeMetricDefinition.java | 362 +++++++ ...iptionScopeMetricDefinitionCollection.java | 42 + .../models/package-info.java | 4 +- .../metricsdefinitions/package-info.java | 4 +- .../MetricsNamespacesClientImplBuilder.java | 4 +- .../models/MetricsBatchQueryOptions.java | 30 + .../query/MetricsBatchQuerySample.java | 2 +- .../azure/monitor/query/ReadmeSamples.java | 6 +- ...csBatchQueryClientJavaDocCodeSnippets.java | 22 +- .../query/LogsQueryAsyncClientTest.java | 103 +- .../monitor/query/LogsQueryClientTest.java | 37 +- ...ClientTest.java => MetricsClientTest.java} | 10 +- ...stBase.java => MetricsClientTestBase.java} | 6 +- .../monitor/query/MonitorQueryTestUtils.java | 21 +- .../azure-monitor-query/swagger/README.md | 43 +- .../src/main/java/MetricsCustomization.java | 4 +- .../java/MetricsDefinitionsCustomization.java | 8 +- sdk/monitor/test-resources.json | 27 +- 69 files changed, 3192 insertions(+), 800 deletions(-) rename sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/{MetricsBatchQueryAsyncClient.java => MetricsAsyncClient.java} (95%) delete mode 100644 sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsBatchQueryServiceVersion.java rename sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/{MetricsBatchQueryClient.java => MetricsClient.java} (95%) rename sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/{MetricsBatchQueryClientBuilder.java => MetricsClientBuilder.java} (59%) create mode 100644 sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsServiceVersion.java create mode 100644 sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/ErrorAdditionalInfo.java create mode 100644 sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/ErrorContract.java create mode 100644 sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/ErrorContractException.java create mode 100644 sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/MetricResultType.java create mode 100644 sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/SubscriptionScopeMetricsRequestBodyParameters.java delete mode 100644 sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/AdditionalInfoErrorResponse.java delete mode 100644 sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/AdditionalInfoErrorResponseError.java delete mode 100644 sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/AdditionalInfoErrorResponseErrorAdditionalInfoItem.java create mode 100644 sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/ErrorAdditionalInfo.java create mode 100644 sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/ErrorDetail.java create mode 100644 sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/ErrorResponse.java rename sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/{AdditionalInfoErrorResponseException.java => ErrorResponseException.java} (55%) create mode 100644 sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/ErrorAdditionalInfo.java create mode 100644 sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/ErrorContract.java create mode 100644 sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/ErrorContractException.java create mode 100644 sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/MetricAggregationType.java create mode 100644 sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/SubscriptionScopeMetricDefinition.java create mode 100644 sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/SubscriptionScopeMetricDefinitionCollection.java rename sdk/monitor/azure-monitor-query/src/test/java/com/azure/monitor/query/{MetricsBatchQueryClientTest.java => MetricsClientTest.java} (89%) rename sdk/monitor/azure-monitor-query/src/test/java/com/azure/monitor/query/{MetricsBatchQueryTestBase.java => MetricsClientTestBase.java} (93%) diff --git a/sdk/monitor/azure-monitor-query/README.md b/sdk/monitor/azure-monitor-query/README.md index 02ca7005ef63d..073d888869543 100644 --- a/sdk/monitor/azure-monitor-query/README.md +++ b/sdk/monitor/azure-monitor-query/README.md @@ -109,7 +109,7 @@ MetricsQueryClient metricsQueryClient = new MetricsQueryClientBuilder() ``` ```java readme-sample-createMetricsBatchQueryClient -MetricsBatchQueryClient metricsBatchQueryClient = new MetricsBatchQueryClientBuilder() +MetricsClient metricsBatchQueryClient = new MetricsClientBuilder() .credential(new DefaultAzureCredentialBuilder().build()) .endpoint("{endpoint}") .buildClient(); @@ -130,7 +130,7 @@ MetricsQueryAsyncClient metricsQueryAsyncClient = new MetricsQueryClientBuilder( ``` ```java readme-sample-createMetricsBatchQueryAsyncClient -MetricsBatchQueryAsyncClient metricsBatchQueryAsyncClient = new MetricsBatchQueryClientBuilder() +MetricsAsyncClient metricsAsyncClient = new MetricsClientBuilder() .credential(new DefaultAzureCredentialBuilder().build()) .endpoint("{endpoint}") .buildAsyncClient(); @@ -534,7 +534,7 @@ for (MetricResult metric : metricsQueryResult.getMetrics()) { #### Handle metrics batch query response ```java readme-sample-metricsquerybatch -MetricsBatchQueryClient metricsBatchQueryClient = new MetricsBatchQueryClientBuilder() +MetricsClient metricsBatchQueryClient = new MetricsClientBuilder() .credential(new DefaultAzureCredentialBuilder().build()) .endpoint("{endpoint}") .buildClient(); diff --git a/sdk/monitor/azure-monitor-query/assets.json b/sdk/monitor/azure-monitor-query/assets.json index acf694e833e2d..f9a9f39100a02 100644 --- a/sdk/monitor/azure-monitor-query/assets.json +++ b/sdk/monitor/azure-monitor-query/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/monitor/azure-monitor-query", - "Tag": "java/monitor/azure-monitor-query_a12f5cac4c" + "Tag": "java/monitor/azure-monitor-query_cc58179f15" } diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsBatchQueryAsyncClient.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsAsyncClient.java similarity index 95% rename from sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsBatchQueryAsyncClient.java rename to sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsAsyncClient.java index 5d9e7fe5b6c27..af58fac92aa9a 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsBatchQueryAsyncClient.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsAsyncClient.java @@ -33,13 +33,13 @@ * This class provides an asynchronous client that contains all the query operations that use batch requests to retrieve * metrics for multiple resources. */ -@ServiceClient(builder = MetricsBatchQueryClientBuilder.class, isAsync = true) -public final class MetricsBatchQueryAsyncClient { - private static final ClientLogger LOGGER = new ClientLogger(MetricsBatchQueryAsyncClient.class); +@ServiceClient(builder = MetricsClientBuilder.class, isAsync = true) +public final class MetricsAsyncClient { + private static final ClientLogger LOGGER = new ClientLogger(MetricsAsyncClient.class); private final AzureMonitorMetricBatch serviceClient; - MetricsBatchQueryAsyncClient(AzureMonitorMetricBatch azureMonitorMetricBatch) { + MetricsAsyncClient(AzureMonitorMetricBatch azureMonitorMetricBatch) { this.serviceClient = azureMonitorMetricBatch; } @@ -91,7 +91,9 @@ public Mono> queryBatchWithResponse(List> queryBatchWithResponse(List> responseMono = this.serviceClient.getMetricsBatches() .batchWithResponseAsync(subscriptionId, metricsNamespace, metricsNames, resourceIdList, startTime, - endTime, granularity, aggregations, top, orderBy, filter, null); + endTime, granularity, aggregations, top, orderBy, filter, rollupBy); return responseMono.map(response -> { diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsBatchQueryServiceVersion.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsBatchQueryServiceVersion.java deleted file mode 100644 index bb9ff02b5de8b..0000000000000 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsBatchQueryServiceVersion.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.monitor.query; - -import com.azure.core.util.ServiceVersion; - -/** - * The versions of Azure Monitor Metrics Batch Query supported by this client library. - */ -public enum MetricsBatchQueryServiceVersion implements ServiceVersion { - /** - * The preview version of the Metrics Batch Query service. - */ - V2023_05_01_PREVIEW("2023-05-01-preview"); - - private final String version; - - MetricsBatchQueryServiceVersion(String version) { - this.version = version; - } - - @Override - public String getVersion() { - return version; - } - - /** - * Gets the latest service version supported by this client library. - * @return the latest {@link MetricsBatchQueryServiceVersion}. - */ - public static MetricsBatchQueryServiceVersion getLatest() { - return V2023_05_01_PREVIEW; - } -} diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsBatchQueryClient.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsClient.java similarity index 95% rename from sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsBatchQueryClient.java rename to sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsClient.java index cb1a50e582b9e..eb46e7f34ee52 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsBatchQueryClient.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsClient.java @@ -32,13 +32,13 @@ * This class provides an asynchronous client that contains all the query operations that use batch requests to retrieve * metrics for multiple resources. */ -@ServiceClient(builder = MetricsBatchQueryClientBuilder.class) -public final class MetricsBatchQueryClient { - private static final ClientLogger LOGGER = new ClientLogger(MetricsBatchQueryClient.class); +@ServiceClient(builder = MetricsClientBuilder.class) +public final class MetricsClient { + private static final ClientLogger LOGGER = new ClientLogger(MetricsClient.class); private final AzureMonitorMetricBatch serviceClient; - MetricsBatchQueryClient(AzureMonitorMetricBatch azureMonitorMetricBatch) { + MetricsClient(AzureMonitorMetricBatch azureMonitorMetricBatch) { this.serviceClient = azureMonitorMetricBatch; } @@ -90,7 +90,9 @@ public Response queryBatchWithResponse(List res Integer top = null; String orderBy = null; String endTime = null; + String rollupBy = null; if (options != null) { + rollupBy = options.getRollupBy(); filter = options.getFilter(); granularity = options.getGranularity(); @@ -121,7 +123,7 @@ public Response queryBatchWithResponse(List res resourceIdList.setResourceids(resourceUris); Response response = this.serviceClient.getMetricsBatches() .batchWithResponse(subscriptionId, metricsNamespace, metricsNames, resourceIdList, startTime, - endTime, granularity, aggregations, top, orderBy, filter, context); + endTime, granularity, aggregations, top, orderBy, filter, rollupBy, context); MetricResultsResponse value = response.getValue(); List values = value.getValues(); List metricsQueryResults = values.stream() diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsBatchQueryClientBuilder.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsClientBuilder.java similarity index 59% rename from sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsBatchQueryClientBuilder.java rename to sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsClientBuilder.java index 639c077fac7cb..b83776202a1fa 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsBatchQueryClientBuilder.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsClientBuilder.java @@ -20,21 +20,21 @@ import com.azure.monitor.query.implementation.metricsbatch.AzureMonitorMetricBatchBuilder; /** - * Fluent builder for creating instances of {@link MetricsBatchQueryClient} and {@link MetricsBatchQueryAsyncClient}. + * Fluent builder for creating instances of {@link MetricsClient} and {@link MetricsAsyncClient}. */ -@ServiceClientBuilder(serviceClients = {MetricsBatchQueryClient.class, MetricsBatchQueryAsyncClient.class}) -public final class MetricsBatchQueryClientBuilder implements EndpointTrait, - HttpTrait, ConfigurationTrait, TokenCredentialTrait { +@ServiceClientBuilder(serviceClients = {MetricsClient.class, MetricsAsyncClient.class}) +public final class MetricsClientBuilder implements EndpointTrait, + HttpTrait, ConfigurationTrait, TokenCredentialTrait { private final AzureMonitorMetricBatchBuilder innerMetricsBatchBuilder = new AzureMonitorMetricBatchBuilder(); /** * Sets the metrics batch query endpoint. * @param endpoint the endpoint. - * @return the {@link MetricsBatchQueryClientBuilder}. + * @return the {@link MetricsClientBuilder}. */ @Override - public MetricsBatchQueryClientBuilder endpoint(String endpoint) { + public MetricsClientBuilder endpoint(String endpoint) { innerMetricsBatchBuilder.endpoint(endpoint); return this; } @@ -42,10 +42,10 @@ public MetricsBatchQueryClientBuilder endpoint(String endpoint) { /** * Sets The HTTP pipeline to send requests through. * @param pipeline the pipeline value. - * @return the {@link MetricsBatchQueryClientBuilder}. + * @return the {@link MetricsClientBuilder}. */ @Override - public MetricsBatchQueryClientBuilder pipeline(HttpPipeline pipeline) { + public MetricsClientBuilder pipeline(HttpPipeline pipeline) { innerMetricsBatchBuilder.pipeline(pipeline); return this; } @@ -53,10 +53,10 @@ public MetricsBatchQueryClientBuilder pipeline(HttpPipeline pipeline) { /** * Sets The HTTP client used to send the request. * @param httpClient the httpClient value. - * @return the {@link MetricsBatchQueryClientBuilder}. + * @return the {@link MetricsClientBuilder}. */ @Override - public MetricsBatchQueryClientBuilder httpClient(HttpClient httpClient) { + public MetricsClientBuilder httpClient(HttpClient httpClient) { innerMetricsBatchBuilder.httpClient(httpClient); return this; } @@ -64,10 +64,10 @@ public MetricsBatchQueryClientBuilder httpClient(HttpClient httpClient) { /** * Sets The configuration store that is used during construction of the service client. * @param configuration the configuration value. - * @return the {@link MetricsBatchQueryClientBuilder}. + * @return the {@link MetricsClientBuilder}. */ @Override - public MetricsBatchQueryClientBuilder configuration(Configuration configuration) { + public MetricsClientBuilder configuration(Configuration configuration) { innerMetricsBatchBuilder.configuration(configuration); return this; } @@ -75,10 +75,10 @@ public MetricsBatchQueryClientBuilder configuration(Configuration configuration) /** * Sets The logging configuration for HTTP requests and responses. * @param httpLogOptions the httpLogOptions value. - * @return the {@link MetricsBatchQueryClientBuilder}. + * @return the {@link MetricsClientBuilder}. */ @Override - public MetricsBatchQueryClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + public MetricsClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { innerMetricsBatchBuilder.httpLogOptions(httpLogOptions); return this; } @@ -86,9 +86,9 @@ public MetricsBatchQueryClientBuilder httpLogOptions(HttpLogOptions httpLogOptio /** * Sets The retry policy that will attempt to retry failed requests, if applicable. * @param retryPolicy the retryPolicy value. - * @return the {@link MetricsBatchQueryClientBuilder}. + * @return the {@link MetricsClientBuilder}. */ - public MetricsBatchQueryClientBuilder retryPolicy(RetryPolicy retryPolicy) { + public MetricsClientBuilder retryPolicy(RetryPolicy retryPolicy) { innerMetricsBatchBuilder.retryPolicy(retryPolicy); return this; } @@ -96,10 +96,10 @@ public MetricsBatchQueryClientBuilder retryPolicy(RetryPolicy retryPolicy) { /** * Sets the {@link RetryOptions} used for creating the client. * @param retryOptions The {@link RetryOptions}. - * @return the updated {@link MetricsBatchQueryClientBuilder}. + * @return the updated {@link MetricsClientBuilder}. */ @Override - public MetricsBatchQueryClientBuilder retryOptions(RetryOptions retryOptions) { + public MetricsClientBuilder retryOptions(RetryOptions retryOptions) { innerMetricsBatchBuilder.retryOptions(retryOptions); return this; } @@ -107,10 +107,10 @@ public MetricsBatchQueryClientBuilder retryOptions(RetryOptions retryOptions) { /** * Adds a custom Http pipeline policy. * @param customPolicy The custom Http pipeline policy to add. - * @return the {@link MetricsBatchQueryClientBuilder}. + * @return the {@link MetricsClientBuilder}. */ @Override - public MetricsBatchQueryClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + public MetricsClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { innerMetricsBatchBuilder.addPolicy(customPolicy); return this; } @@ -118,10 +118,10 @@ public MetricsBatchQueryClientBuilder addPolicy(HttpPipelinePolicy customPolicy) /** * Sets The TokenCredential used for authentication. * @param tokenCredential the tokenCredential value. - * @return the {@link MetricsBatchQueryClientBuilder}. + * @return the {@link MetricsClientBuilder}. */ @Override - public MetricsBatchQueryClientBuilder credential(TokenCredential tokenCredential) { + public MetricsClientBuilder credential(TokenCredential tokenCredential) { innerMetricsBatchBuilder.credential(tokenCredential); return this; } @@ -129,38 +129,38 @@ public MetricsBatchQueryClientBuilder credential(TokenCredential tokenCredential /** * Set the {@link ClientOptions} used for creating the client. * @param clientOptions The {@link ClientOptions}. - * @return the {@link MetricsBatchQueryClientBuilder}. + * @return the {@link MetricsClientBuilder}. */ @Override - public MetricsBatchQueryClientBuilder clientOptions(ClientOptions clientOptions) { + public MetricsClientBuilder clientOptions(ClientOptions clientOptions) { innerMetricsBatchBuilder.clientOptions(clientOptions); return this; } /** * The service version to use when creating the client. - * @param serviceVersion The {@link MetricsBatchQueryServiceVersion}. - * @return the {@link MetricsBatchQueryClientBuilder}. + * @param serviceVersion The {@link MetricsServiceVersion}. + * @return the {@link MetricsClientBuilder}. */ - public MetricsBatchQueryClientBuilder serviceVersion(MetricsBatchQueryServiceVersion serviceVersion) { + public MetricsClientBuilder serviceVersion(MetricsServiceVersion serviceVersion) { innerMetricsBatchBuilder.apiVersion(serviceVersion.getVersion()); return this; } /** * Creates a synchronous client with the configured options in this builder. - * @return A synchronous {@link MetricsBatchQueryClient}. + * @return A synchronous {@link MetricsClient}. */ - public MetricsBatchQueryClient buildClient() { - return new MetricsBatchQueryClient(innerMetricsBatchBuilder.buildClient()); + public MetricsClient buildClient() { + return new MetricsClient(innerMetricsBatchBuilder.buildClient()); } /** * Creates an asynchronous client with the configured options in this builder. - * @return An asynchronous {@link MetricsBatchQueryAsyncClient}. + * @return An asynchronous {@link MetricsAsyncClient}. */ - public MetricsBatchQueryAsyncClient buildAsyncClient() { - return new MetricsBatchQueryAsyncClient(innerMetricsBatchBuilder.buildClient()); + public MetricsAsyncClient buildAsyncClient() { + return new MetricsAsyncClient(innerMetricsBatchBuilder.buildClient()); } } diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsQueryAsyncClient.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsQueryAsyncClient.java index 5b29996843e78..988776bb9bd5d 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsQueryAsyncClient.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsQueryAsyncClient.java @@ -176,7 +176,7 @@ Mono> queryResourceWithResponse(String resourceUri, .getMetrics() .listWithResponseAsync(resourceUri, timespan, options.getGranularity(), String.join(",", metricsNames), aggregation, options.getTop(), options.getOrderBy(), - options.getFilter(), ResultType.DATA, options.getMetricNamespace(), context) + options.getFilter(), ResultType.DATA, options.getMetricNamespace(), null, null, null, context) .map(response -> convertToMetricsQueryResult(response)) .onErrorMap(ErrorResponseException.class, ex -> { return new HttpResponseException(ex.getMessage(), ex.getResponse(), diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsQueryClient.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsQueryClient.java index 54c4d40df9b9e..10b50a41da481 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsQueryClient.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsQueryClient.java @@ -124,7 +124,7 @@ public Response queryResourceWithResponse(String resourceUri Response metricsResponseResponse = metricsClient .getMetrics() .listWithResponse(resourceUri, timespan, granularity, String.join(",", metricsNames), - aggregation, top, orderBy, filter, ResultType.DATA, metricNamespace, context); + aggregation, top, orderBy, filter, ResultType.DATA, metricNamespace, null, null, null, context); return convertToMetricsQueryResult(metricsResponseResponse); } diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsServiceVersion.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsServiceVersion.java new file mode 100644 index 0000000000000..417cfff401090 --- /dev/null +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsServiceVersion.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.monitor.query; + +import com.azure.core.util.ServiceVersion; + +/** + * The versions of Azure Monitor Metrics Query supported by this client library. + */ +public enum MetricsServiceVersion implements ServiceVersion { + /** + * The preview version of the Metrics Query service. + */ + V2023_10_01("2023-10-01"); + + private final String version; + + MetricsServiceVersion(String version) { + this.version = version; + } + + @Override + public String getVersion() { + return version; + } + + /** + * Gets the latest service version supported by this client library. + * @return the latest {@link MetricsServiceVersion}. + */ + public static MetricsServiceVersion getLatest() { + return V2023_10_01; + } +} diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/MetricsImpl.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/MetricsImpl.java index 277dde80ee8d7..da9740910e753 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/MetricsImpl.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/MetricsImpl.java @@ -4,12 +4,14 @@ package com.azure.monitor.query.implementation.metrics; +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.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; @@ -19,9 +21,12 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.monitor.query.implementation.metrics.models.ErrorContractException; import com.azure.monitor.query.implementation.metrics.models.ErrorResponseException; +import com.azure.monitor.query.implementation.metrics.models.MetricResultType; import com.azure.monitor.query.implementation.metrics.models.MetricsResponse; import com.azure.monitor.query.implementation.metrics.models.ResultType; +import com.azure.monitor.query.implementation.metrics.models.SubscriptionScopeMetricsRequestBodyParameters; import java.time.Duration; import reactor.core.publisher.Mono; @@ -50,12 +55,74 @@ public final class MetricsImpl { } /** - * The interface defining all the services for MonitorManagementClientMetrics to be used by the proxy service to + * The interface defining all the services for AzureMonitorMetricsDataAPIMetrics to be used by the proxy service to * perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "MonitorManagementCli") + @ServiceInterface(name = "AzureMonitorMetricsD") public interface MetricsService { + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metrics") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ErrorContractException.class) + Mono> listAtSubscriptionScope(@HostParam("$host") String host, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @QueryParam("region") String region, @QueryParam("timespan") String timespan, + @QueryParam("interval") Duration interval, @QueryParam("metricnames") String metricnames, + @QueryParam("aggregation") String aggregation, @QueryParam("top") Integer top, + @QueryParam("orderby") String orderBy, @QueryParam("$filter") String filter, + @QueryParam("resultType") MetricResultType resultType, + @QueryParam("metricnamespace") String metricnamespace, + @QueryParam("AutoAdjustTimegrain") Boolean autoAdjustTimegrain, + @QueryParam("ValidateDimensions") Boolean validateDimensions, @QueryParam("rollupby") String rollupby, + @HeaderParam("Accept") String accept, Context context); + + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metrics") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ErrorContractException.class) + Response listAtSubscriptionScopeSync(@HostParam("$host") String host, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @QueryParam("region") String region, @QueryParam("timespan") String timespan, + @QueryParam("interval") Duration interval, @QueryParam("metricnames") String metricnames, + @QueryParam("aggregation") String aggregation, @QueryParam("top") Integer top, + @QueryParam("orderby") String orderBy, @QueryParam("$filter") String filter, + @QueryParam("resultType") MetricResultType resultType, + @QueryParam("metricnamespace") String metricnamespace, + @QueryParam("AutoAdjustTimegrain") Boolean autoAdjustTimegrain, + @QueryParam("ValidateDimensions") Boolean validateDimensions, @QueryParam("rollupby") String rollupby, + @HeaderParam("Accept") String accept, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metrics") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ErrorContractException.class) + Mono> listAtSubscriptionScopePost(@HostParam("$host") String host, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @QueryParam("region") String region, @QueryParam("timespan") String timespan, + @QueryParam("interval") Duration interval, @QueryParam("metricnames") String metricnames, + @QueryParam("aggregation") String aggregation, @QueryParam("top") Integer top, + @QueryParam("orderby") String orderBy, @QueryParam("$filter") String filter, + @QueryParam("resultType") MetricResultType resultType, + @QueryParam("metricnamespace") String metricnamespace, + @QueryParam("AutoAdjustTimegrain") Boolean autoAdjustTimegrain, + @QueryParam("ValidateDimensions") Boolean validateDimensions, @QueryParam("rollupby") String rollupby, + @BodyParam("application/json") SubscriptionScopeMetricsRequestBodyParameters body, + @HeaderParam("Accept") String accept, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metrics") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ErrorContractException.class) + Response listAtSubscriptionScopePostSync(@HostParam("$host") String host, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @QueryParam("region") String region, @QueryParam("timespan") String timespan, + @QueryParam("interval") Duration interval, @QueryParam("metricnames") String metricnames, + @QueryParam("aggregation") String aggregation, @QueryParam("top") Integer top, + @QueryParam("orderby") String orderBy, @QueryParam("$filter") String filter, + @QueryParam("resultType") MetricResultType resultType, + @QueryParam("metricnamespace") String metricnamespace, + @QueryParam("AutoAdjustTimegrain") Boolean autoAdjustTimegrain, + @QueryParam("ValidateDimensions") Boolean validateDimensions, @QueryParam("rollupby") String rollupby, + @BodyParam("application/json") SubscriptionScopeMetricsRequestBodyParameters body, + @HeaderParam("Accept") String accept, Context context); + @Get("/{resourceUri}/providers/Microsoft.Insights/metrics") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ErrorResponseException.class) @@ -65,8 +132,10 @@ Mono> list(@HostParam("$host") String host, @QueryParam("metricnames") String metricnames, @QueryParam("aggregation") String aggregation, @QueryParam("top") Integer top, @QueryParam("orderby") String orderBy, @QueryParam("$filter") String filter, @QueryParam("resultType") ResultType resultType, @QueryParam("api-version") String apiVersion, - @QueryParam("metricnamespace") String metricnamespace, @HeaderParam("Accept") String accept, - Context context); + @QueryParam("metricnamespace") String metricnamespace, + @QueryParam("AutoAdjustTimegrain") Boolean autoAdjustTimegrain, + @QueryParam("ValidateDimensions") Boolean validateDimensions, @QueryParam("rollupby") String rollupby, + @HeaderParam("Accept") String accept, Context context); @Get("/{resourceUri}/providers/Microsoft.Insights/metrics") @ExpectedResponses({ 200 }) @@ -77,8 +146,640 @@ Response listSync(@HostParam("$host") String host, @QueryParam("metricnames") String metricnames, @QueryParam("aggregation") String aggregation, @QueryParam("top") Integer top, @QueryParam("orderby") String orderBy, @QueryParam("$filter") String filter, @QueryParam("resultType") ResultType resultType, @QueryParam("api-version") String apiVersion, - @QueryParam("metricnamespace") String metricnamespace, @HeaderParam("Accept") String accept, - Context context); + @QueryParam("metricnamespace") String metricnamespace, + @QueryParam("AutoAdjustTimegrain") Boolean autoAdjustTimegrain, + @QueryParam("ValidateDimensions") Boolean validateDimensions, @QueryParam("rollupby") String rollupby, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * **Lists the metric data for a subscription**. + * + * @param region The region where the metrics you want reside. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @param interval The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special + * case for 'FULL' value that returns single datapoint for entire time span requested. + * *Examples: PT15M, PT1H, P1D, FULL*. + * @param metricnames The names of the metrics (comma separated) to retrieve. + * @param aggregation The list of aggregation types (comma separated) to retrieve. + * *Examples: average, minimum, maximum*. + * @param top The maximum number of records to retrieve per resource ID in the request. + * Valid only if filter is specified. + * Defaults to 10. + * @param orderBy The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * *Examples: sum asc*. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the + * operation's description for details. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. + * @param rollupby Dimension name(s) to rollup results by. For example if you only want to see metric values with a + * filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can + * specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorContractException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a metrics query along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listAtSubscriptionScopeWithResponseAsync(String region, String timespan, + Duration interval, String metricnames, String aggregation, Integer top, String orderBy, String filter, + MetricResultType resultType, String metricnamespace, Boolean autoAdjustTimegrain, Boolean validateDimensions, + String rollupby) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.listAtSubscriptionScope(this.client.getHost(), this.client.getSubscriptionId(), + this.client.getApiVersion(), region, timespan, interval, metricnames, aggregation, top, orderBy, filter, + resultType, metricnamespace, autoAdjustTimegrain, validateDimensions, rollupby, accept, context)); + } + + /** + * **Lists the metric data for a subscription**. + * + * @param region The region where the metrics you want reside. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @param interval The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special + * case for 'FULL' value that returns single datapoint for entire time span requested. + * *Examples: PT15M, PT1H, P1D, FULL*. + * @param metricnames The names of the metrics (comma separated) to retrieve. + * @param aggregation The list of aggregation types (comma separated) to retrieve. + * *Examples: average, minimum, maximum*. + * @param top The maximum number of records to retrieve per resource ID in the request. + * Valid only if filter is specified. + * Defaults to 10. + * @param orderBy The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * *Examples: sum asc*. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the + * operation's description for details. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. + * @param rollupby Dimension name(s) to rollup results by. For example if you only want to see metric values with a + * filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can + * specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorContractException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a metrics query along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listAtSubscriptionScopeWithResponseAsync(String region, String timespan, + Duration interval, String metricnames, String aggregation, Integer top, String orderBy, String filter, + MetricResultType resultType, String metricnamespace, Boolean autoAdjustTimegrain, Boolean validateDimensions, + String rollupby, Context context) { + final String accept = "application/json"; + return service.listAtSubscriptionScope(this.client.getHost(), this.client.getSubscriptionId(), + this.client.getApiVersion(), region, timespan, interval, metricnames, aggregation, top, orderBy, filter, + resultType, metricnamespace, autoAdjustTimegrain, validateDimensions, rollupby, accept, context); + } + + /** + * **Lists the metric data for a subscription**. + * + * @param region The region where the metrics you want reside. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @param interval The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special + * case for 'FULL' value that returns single datapoint for entire time span requested. + * *Examples: PT15M, PT1H, P1D, FULL*. + * @param metricnames The names of the metrics (comma separated) to retrieve. + * @param aggregation The list of aggregation types (comma separated) to retrieve. + * *Examples: average, minimum, maximum*. + * @param top The maximum number of records to retrieve per resource ID in the request. + * Valid only if filter is specified. + * Defaults to 10. + * @param orderBy The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * *Examples: sum asc*. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the + * operation's description for details. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. + * @param rollupby Dimension name(s) to rollup results by. For example if you only want to see metric values with a + * filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can + * specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorContractException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a metrics query on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listAtSubscriptionScopeAsync(String region, String timespan, Duration interval, + String metricnames, String aggregation, Integer top, String orderBy, String filter, MetricResultType resultType, + String metricnamespace, Boolean autoAdjustTimegrain, Boolean validateDimensions, String rollupby) { + return listAtSubscriptionScopeWithResponseAsync(region, timespan, interval, metricnames, aggregation, top, + orderBy, filter, resultType, metricnamespace, autoAdjustTimegrain, validateDimensions, rollupby) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * **Lists the metric data for a subscription**. + * + * @param region The region where the metrics you want reside. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @param interval The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special + * case for 'FULL' value that returns single datapoint for entire time span requested. + * *Examples: PT15M, PT1H, P1D, FULL*. + * @param metricnames The names of the metrics (comma separated) to retrieve. + * @param aggregation The list of aggregation types (comma separated) to retrieve. + * *Examples: average, minimum, maximum*. + * @param top The maximum number of records to retrieve per resource ID in the request. + * Valid only if filter is specified. + * Defaults to 10. + * @param orderBy The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * *Examples: sum asc*. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the + * operation's description for details. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. + * @param rollupby Dimension name(s) to rollup results by. For example if you only want to see metric values with a + * filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can + * specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorContractException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a metrics query on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listAtSubscriptionScopeAsync(String region, String timespan, Duration interval, + String metricnames, String aggregation, Integer top, String orderBy, String filter, MetricResultType resultType, + String metricnamespace, Boolean autoAdjustTimegrain, Boolean validateDimensions, String rollupby, + Context context) { + return listAtSubscriptionScopeWithResponseAsync(region, timespan, interval, metricnames, aggregation, top, + orderBy, filter, resultType, metricnamespace, autoAdjustTimegrain, validateDimensions, rollupby, context) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * **Lists the metric data for a subscription**. + * + * @param region The region where the metrics you want reside. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @param interval The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special + * case for 'FULL' value that returns single datapoint for entire time span requested. + * *Examples: PT15M, PT1H, P1D, FULL*. + * @param metricnames The names of the metrics (comma separated) to retrieve. + * @param aggregation The list of aggregation types (comma separated) to retrieve. + * *Examples: average, minimum, maximum*. + * @param top The maximum number of records to retrieve per resource ID in the request. + * Valid only if filter is specified. + * Defaults to 10. + * @param orderBy The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * *Examples: sum asc*. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the + * operation's description for details. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. + * @param rollupby Dimension name(s) to rollup results by. For example if you only want to see metric values with a + * filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can + * specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorContractException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a metrics query along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAtSubscriptionScopeWithResponse(String region, String timespan, + Duration interval, String metricnames, String aggregation, Integer top, String orderBy, String filter, + MetricResultType resultType, String metricnamespace, Boolean autoAdjustTimegrain, Boolean validateDimensions, + String rollupby, Context context) { + final String accept = "application/json"; + return service.listAtSubscriptionScopeSync(this.client.getHost(), this.client.getSubscriptionId(), + this.client.getApiVersion(), region, timespan, interval, metricnames, aggregation, top, orderBy, filter, + resultType, metricnamespace, autoAdjustTimegrain, validateDimensions, rollupby, accept, context); + } + + /** + * **Lists the metric data for a subscription**. + * + * @param region The region where the metrics you want reside. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @param interval The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special + * case for 'FULL' value that returns single datapoint for entire time span requested. + * *Examples: PT15M, PT1H, P1D, FULL*. + * @param metricnames The names of the metrics (comma separated) to retrieve. + * @param aggregation The list of aggregation types (comma separated) to retrieve. + * *Examples: average, minimum, maximum*. + * @param top The maximum number of records to retrieve per resource ID in the request. + * Valid only if filter is specified. + * Defaults to 10. + * @param orderBy The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * *Examples: sum asc*. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the + * operation's description for details. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. + * @param rollupby Dimension name(s) to rollup results by. For example if you only want to see metric values with a + * filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can + * specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorContractException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a metrics query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MetricsResponse listAtSubscriptionScope(String region, String timespan, Duration interval, + String metricnames, String aggregation, Integer top, String orderBy, String filter, MetricResultType resultType, + String metricnamespace, Boolean autoAdjustTimegrain, Boolean validateDimensions, String rollupby) { + return listAtSubscriptionScopeWithResponse(region, timespan, interval, metricnames, aggregation, top, orderBy, + filter, resultType, metricnamespace, autoAdjustTimegrain, validateDimensions, rollupby, Context.NONE) + .getValue(); + } + + /** + * **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. + * + * @param region The region where the metrics you want reside. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @param interval The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special + * case for 'FULL' value that returns single datapoint for entire time span requested. + * *Examples: PT15M, PT1H, P1D, FULL*. + * @param metricnames The names of the metrics (comma separated) to retrieve. + * @param aggregation The list of aggregation types (comma separated) to retrieve. + * *Examples: average, minimum, maximum*. + * @param top The maximum number of records to retrieve per resource ID in the request. + * Valid only if filter is specified. + * Defaults to 10. + * @param orderBy The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * *Examples: sum asc*. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the + * operation's description for details. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. + * @param rollupby Dimension name(s) to rollup results by. For example if you only want to see metric values with a + * filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can + * specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. + * @param body Parameters serialized in the body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorContractException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a metrics query along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listAtSubscriptionScopePostWithResponseAsync(String region, String timespan, + Duration interval, String metricnames, String aggregation, Integer top, String orderBy, String filter, + MetricResultType resultType, String metricnamespace, Boolean autoAdjustTimegrain, Boolean validateDimensions, + String rollupby, SubscriptionScopeMetricsRequestBodyParameters body) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.listAtSubscriptionScopePost(this.client.getHost(), this.client.getSubscriptionId(), + this.client.getApiVersion(), region, timespan, interval, metricnames, aggregation, top, orderBy, filter, + resultType, metricnamespace, autoAdjustTimegrain, validateDimensions, rollupby, body, accept, context)); + } + + /** + * **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. + * + * @param region The region where the metrics you want reside. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @param interval The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special + * case for 'FULL' value that returns single datapoint for entire time span requested. + * *Examples: PT15M, PT1H, P1D, FULL*. + * @param metricnames The names of the metrics (comma separated) to retrieve. + * @param aggregation The list of aggregation types (comma separated) to retrieve. + * *Examples: average, minimum, maximum*. + * @param top The maximum number of records to retrieve per resource ID in the request. + * Valid only if filter is specified. + * Defaults to 10. + * @param orderBy The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * *Examples: sum asc*. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the + * operation's description for details. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. + * @param rollupby Dimension name(s) to rollup results by. For example if you only want to see metric values with a + * filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can + * specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. + * @param body Parameters serialized in the body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorContractException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a metrics query along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listAtSubscriptionScopePostWithResponseAsync(String region, String timespan, + Duration interval, String metricnames, String aggregation, Integer top, String orderBy, String filter, + MetricResultType resultType, String metricnamespace, Boolean autoAdjustTimegrain, Boolean validateDimensions, + String rollupby, SubscriptionScopeMetricsRequestBodyParameters body, Context context) { + final String accept = "application/json"; + return service.listAtSubscriptionScopePost(this.client.getHost(), this.client.getSubscriptionId(), + this.client.getApiVersion(), region, timespan, interval, metricnames, aggregation, top, orderBy, filter, + resultType, metricnamespace, autoAdjustTimegrain, validateDimensions, rollupby, body, accept, context); + } + + /** + * **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. + * + * @param region The region where the metrics you want reside. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @param interval The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special + * case for 'FULL' value that returns single datapoint for entire time span requested. + * *Examples: PT15M, PT1H, P1D, FULL*. + * @param metricnames The names of the metrics (comma separated) to retrieve. + * @param aggregation The list of aggregation types (comma separated) to retrieve. + * *Examples: average, minimum, maximum*. + * @param top The maximum number of records to retrieve per resource ID in the request. + * Valid only if filter is specified. + * Defaults to 10. + * @param orderBy The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * *Examples: sum asc*. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the + * operation's description for details. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. + * @param rollupby Dimension name(s) to rollup results by. For example if you only want to see metric values with a + * filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can + * specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. + * @param body Parameters serialized in the body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorContractException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a metrics query on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listAtSubscriptionScopePostAsync(String region, String timespan, Duration interval, + String metricnames, String aggregation, Integer top, String orderBy, String filter, MetricResultType resultType, + String metricnamespace, Boolean autoAdjustTimegrain, Boolean validateDimensions, String rollupby, + SubscriptionScopeMetricsRequestBodyParameters body) { + return listAtSubscriptionScopePostWithResponseAsync(region, timespan, interval, metricnames, aggregation, top, + orderBy, filter, resultType, metricnamespace, autoAdjustTimegrain, validateDimensions, rollupby, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. + * + * @param region The region where the metrics you want reside. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @param interval The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special + * case for 'FULL' value that returns single datapoint for entire time span requested. + * *Examples: PT15M, PT1H, P1D, FULL*. + * @param metricnames The names of the metrics (comma separated) to retrieve. + * @param aggregation The list of aggregation types (comma separated) to retrieve. + * *Examples: average, minimum, maximum*. + * @param top The maximum number of records to retrieve per resource ID in the request. + * Valid only if filter is specified. + * Defaults to 10. + * @param orderBy The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * *Examples: sum asc*. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the + * operation's description for details. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. + * @param rollupby Dimension name(s) to rollup results by. For example if you only want to see metric values with a + * filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can + * specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. + * @param body Parameters serialized in the body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorContractException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a metrics query on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listAtSubscriptionScopePostAsync(String region, String timespan, Duration interval, + String metricnames, String aggregation, Integer top, String orderBy, String filter, MetricResultType resultType, + String metricnamespace, Boolean autoAdjustTimegrain, Boolean validateDimensions, String rollupby, + SubscriptionScopeMetricsRequestBodyParameters body, Context context) { + return listAtSubscriptionScopePostWithResponseAsync(region, timespan, interval, metricnames, aggregation, top, + orderBy, filter, resultType, metricnamespace, autoAdjustTimegrain, validateDimensions, rollupby, body, + context).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. + * + * @param region The region where the metrics you want reside. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @param interval The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special + * case for 'FULL' value that returns single datapoint for entire time span requested. + * *Examples: PT15M, PT1H, P1D, FULL*. + * @param metricnames The names of the metrics (comma separated) to retrieve. + * @param aggregation The list of aggregation types (comma separated) to retrieve. + * *Examples: average, minimum, maximum*. + * @param top The maximum number of records to retrieve per resource ID in the request. + * Valid only if filter is specified. + * Defaults to 10. + * @param orderBy The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * *Examples: sum asc*. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the + * operation's description for details. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. + * @param rollupby Dimension name(s) to rollup results by. For example if you only want to see metric values with a + * filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can + * specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. + * @param body Parameters serialized in the body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorContractException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a metrics query along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAtSubscriptionScopePostWithResponse(String region, String timespan, + Duration interval, String metricnames, String aggregation, Integer top, String orderBy, String filter, + MetricResultType resultType, String metricnamespace, Boolean autoAdjustTimegrain, Boolean validateDimensions, + String rollupby, SubscriptionScopeMetricsRequestBodyParameters body, Context context) { + final String accept = "application/json"; + return service.listAtSubscriptionScopePostSync(this.client.getHost(), this.client.getSubscriptionId(), + this.client.getApiVersion(), region, timespan, interval, metricnames, aggregation, top, orderBy, filter, + resultType, metricnamespace, autoAdjustTimegrain, validateDimensions, rollupby, body, accept, context); + } + + /** + * **Lists the metric data for a subscription**. Parameters can be specified on either query params or the body. + * + * @param region The region where the metrics you want reside. + * @param timespan The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * @param interval The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special + * case for 'FULL' value that returns single datapoint for entire time span requested. + * *Examples: PT15M, PT1H, P1D, FULL*. + * @param metricnames The names of the metrics (comma separated) to retrieve. + * @param aggregation The list of aggregation types (comma separated) to retrieve. + * *Examples: average, minimum, maximum*. + * @param top The maximum number of records to retrieve per resource ID in the request. + * Valid only if filter is specified. + * Defaults to 10. + * @param orderBy The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * *Examples: sum asc*. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the + * operation's description for details. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. + * @param rollupby Dimension name(s) to rollup results by. For example if you only want to see metric values with a + * filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can + * specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. + * @param body Parameters serialized in the body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorContractException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a metrics query. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MetricsResponse listAtSubscriptionScopePost(String region, String timespan, Duration interval, + String metricnames, String aggregation, Integer top, String orderBy, String filter, MetricResultType resultType, + String metricnamespace, Boolean autoAdjustTimegrain, Boolean validateDimensions, String rollupby, + SubscriptionScopeMetricsRequestBodyParameters body) { + return listAtSubscriptionScopePostWithResponse(region, timespan, interval, metricnames, aggregation, top, + orderBy, filter, resultType, metricnamespace, autoAdjustTimegrain, validateDimensions, rollupby, body, + Context.NONE).getValue(); } /** @@ -90,28 +791,33 @@ Response listSync(@HostParam("$host") String host, * @param interval The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special * case for 'FULL' value that returns single datapoint for entire time span requested. * *Examples: PT15M, PT1H, P1D, FULL*. - * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself - * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. + * @param metricnames The names of the metrics (comma separated) to retrieve. * @param aggregation The list of aggregation types (comma separated) to retrieve. - * @param top The maximum number of records to retrieve. - * Valid only if $filter is specified. + * *Examples: average, minimum, maximum*. + * @param top The maximum number of records to retrieve per resource ID in the request. + * Valid only if filter is specified. * Defaults to 10. * @param orderBy The aggregation to use for sorting results and the direction of the sort. * Only one order can be specified. - * Examples: sum asc. - * @param filter The **$filter** is used to reduce the set of metric data returned. Example: Metric contains - * metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq - * 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = 'b2'** - * This is invalid because the logical or operator cannot separate two different metadata names. - Return all time - * series where A = a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return all time - * series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension name or - * dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using $filter= "dim - * (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' "** When dimension name is **dim (test) 3** and - * dimension value is **dim3 (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) val' " use - * **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "**. + * *Examples: sum asc*. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the * operation's description for details. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. + * @param rollupby Dimension name(s) to rollup results by. For example if you only want to see metric values with a + * filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can + * specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -120,11 +826,11 @@ Response listSync(@HostParam("$host") String host, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listWithResponseAsync(String resourceUri, String timespan, Duration interval, String metricnames, String aggregation, Integer top, String orderBy, String filter, ResultType resultType, - String metricnamespace) { + String metricnamespace, Boolean autoAdjustTimegrain, Boolean validateDimensions, String rollupby) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.list(this.client.getHost(), resourceUri, timespan, interval, metricnames, aggregation, - top, orderBy, filter, resultType, this.client.getApiVersion(), metricnamespace, accept, context)); + return FluxUtil.withContext(context -> service.list(this.client.getHost(), resourceUri, timespan, interval, + metricnames, aggregation, top, orderBy, filter, resultType, this.client.getApiVersion(), metricnamespace, + autoAdjustTimegrain, validateDimensions, rollupby, accept, context)); } /** @@ -136,28 +842,33 @@ public Mono> listWithResponseAsync(String resourceUri, * @param interval The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special * case for 'FULL' value that returns single datapoint for entire time span requested. * *Examples: PT15M, PT1H, P1D, FULL*. - * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself - * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. + * @param metricnames The names of the metrics (comma separated) to retrieve. * @param aggregation The list of aggregation types (comma separated) to retrieve. - * @param top The maximum number of records to retrieve. - * Valid only if $filter is specified. + * *Examples: average, minimum, maximum*. + * @param top The maximum number of records to retrieve per resource ID in the request. + * Valid only if filter is specified. * Defaults to 10. * @param orderBy The aggregation to use for sorting results and the direction of the sort. * Only one order can be specified. - * Examples: sum asc. - * @param filter The **$filter** is used to reduce the set of metric data returned. Example: Metric contains - * metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq - * 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = 'b2'** - * This is invalid because the logical or operator cannot separate two different metadata names. - Return all time - * series where A = a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return all time - * series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension name or - * dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using $filter= "dim - * (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' "** When dimension name is **dim (test) 3** and - * dimension value is **dim3 (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) val' " use - * **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "**. + * *Examples: sum asc*. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the * operation's description for details. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. + * @param rollupby Dimension name(s) to rollup results by. For example if you only want to see metric values with a + * filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can + * specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. @@ -167,10 +878,12 @@ public Mono> listWithResponseAsync(String resourceUri, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listWithResponseAsync(String resourceUri, String timespan, Duration interval, String metricnames, String aggregation, Integer top, String orderBy, String filter, ResultType resultType, - String metricnamespace, Context context) { + String metricnamespace, Boolean autoAdjustTimegrain, Boolean validateDimensions, String rollupby, + Context context) { final String accept = "application/json"; return service.list(this.client.getHost(), resourceUri, timespan, interval, metricnames, aggregation, top, - orderBy, filter, resultType, this.client.getApiVersion(), metricnamespace, accept, context); + orderBy, filter, resultType, this.client.getApiVersion(), metricnamespace, autoAdjustTimegrain, + validateDimensions, rollupby, accept, context); } /** @@ -182,28 +895,33 @@ public Mono> listWithResponseAsync(String resourceUri, * @param interval The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special * case for 'FULL' value that returns single datapoint for entire time span requested. * *Examples: PT15M, PT1H, P1D, FULL*. - * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself - * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. + * @param metricnames The names of the metrics (comma separated) to retrieve. * @param aggregation The list of aggregation types (comma separated) to retrieve. - * @param top The maximum number of records to retrieve. - * Valid only if $filter is specified. + * *Examples: average, minimum, maximum*. + * @param top The maximum number of records to retrieve per resource ID in the request. + * Valid only if filter is specified. * Defaults to 10. * @param orderBy The aggregation to use for sorting results and the direction of the sort. * Only one order can be specified. - * Examples: sum asc. - * @param filter The **$filter** is used to reduce the set of metric data returned. Example: Metric contains - * metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq - * 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = 'b2'** - * This is invalid because the logical or operator cannot separate two different metadata names. - Return all time - * series where A = a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return all time - * series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension name or - * dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using $filter= "dim - * (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' "** When dimension name is **dim (test) 3** and - * dimension value is **dim3 (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) val' " use - * **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "**. + * *Examples: sum asc*. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the * operation's description for details. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. + * @param rollupby Dimension name(s) to rollup results by. For example if you only want to see metric values with a + * filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can + * specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -211,9 +929,11 @@ public Mono> listWithResponseAsync(String resourceUri, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono listAsync(String resourceUri, String timespan, Duration interval, String metricnames, - String aggregation, Integer top, String orderBy, String filter, ResultType resultType, String metricnamespace) { + String aggregation, Integer top, String orderBy, String filter, ResultType resultType, String metricnamespace, + Boolean autoAdjustTimegrain, Boolean validateDimensions, String rollupby) { return listWithResponseAsync(resourceUri, timespan, interval, metricnames, aggregation, top, orderBy, filter, - resultType, metricnamespace).flatMap(res -> Mono.justOrEmpty(res.getValue())); + resultType, metricnamespace, autoAdjustTimegrain, validateDimensions, rollupby) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -225,28 +945,33 @@ public Mono listAsync(String resourceUri, String timespan, Dura * @param interval The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special * case for 'FULL' value that returns single datapoint for entire time span requested. * *Examples: PT15M, PT1H, P1D, FULL*. - * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself - * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. + * @param metricnames The names of the metrics (comma separated) to retrieve. * @param aggregation The list of aggregation types (comma separated) to retrieve. - * @param top The maximum number of records to retrieve. - * Valid only if $filter is specified. + * *Examples: average, minimum, maximum*. + * @param top The maximum number of records to retrieve per resource ID in the request. + * Valid only if filter is specified. * Defaults to 10. * @param orderBy The aggregation to use for sorting results and the direction of the sort. * Only one order can be specified. - * Examples: sum asc. - * @param filter The **$filter** is used to reduce the set of metric data returned. Example: Metric contains - * metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq - * 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = 'b2'** - * This is invalid because the logical or operator cannot separate two different metadata names. - Return all time - * series where A = a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return all time - * series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension name or - * dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using $filter= "dim - * (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' "** When dimension name is **dim (test) 3** and - * dimension value is **dim3 (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) val' " use - * **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "**. + * *Examples: sum asc*. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the * operation's description for details. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. + * @param rollupby Dimension name(s) to rollup results by. For example if you only want to see metric values with a + * filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can + * specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. @@ -256,9 +981,10 @@ public Mono listAsync(String resourceUri, String timespan, Dura @ServiceMethod(returns = ReturnType.SINGLE) public Mono listAsync(String resourceUri, String timespan, Duration interval, String metricnames, String aggregation, Integer top, String orderBy, String filter, ResultType resultType, String metricnamespace, - Context context) { + Boolean autoAdjustTimegrain, Boolean validateDimensions, String rollupby, Context context) { return listWithResponseAsync(resourceUri, timespan, interval, metricnames, aggregation, top, orderBy, filter, - resultType, metricnamespace, context).flatMap(res -> Mono.justOrEmpty(res.getValue())); + resultType, metricnamespace, autoAdjustTimegrain, validateDimensions, rollupby, context) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -270,28 +996,33 @@ public Mono listAsync(String resourceUri, String timespan, Dura * @param interval The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special * case for 'FULL' value that returns single datapoint for entire time span requested. * *Examples: PT15M, PT1H, P1D, FULL*. - * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself - * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. + * @param metricnames The names of the metrics (comma separated) to retrieve. * @param aggregation The list of aggregation types (comma separated) to retrieve. - * @param top The maximum number of records to retrieve. - * Valid only if $filter is specified. + * *Examples: average, minimum, maximum*. + * @param top The maximum number of records to retrieve per resource ID in the request. + * Valid only if filter is specified. * Defaults to 10. * @param orderBy The aggregation to use for sorting results and the direction of the sort. * Only one order can be specified. - * Examples: sum asc. - * @param filter The **$filter** is used to reduce the set of metric data returned. Example: Metric contains - * metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq - * 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = 'b2'** - * This is invalid because the logical or operator cannot separate two different metadata names. - Return all time - * series where A = a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return all time - * series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension name or - * dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using $filter= "dim - * (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' "** When dimension name is **dim (test) 3** and - * dimension value is **dim3 (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) val' " use - * **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "**. + * *Examples: sum asc*. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the * operation's description for details. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. + * @param rollupby Dimension name(s) to rollup results by. For example if you only want to see metric values with a + * filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can + * specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. @@ -301,10 +1032,12 @@ public Mono listAsync(String resourceUri, String timespan, Dura @ServiceMethod(returns = ReturnType.SINGLE) public Response listWithResponse(String resourceUri, String timespan, Duration interval, String metricnames, String aggregation, Integer top, String orderBy, String filter, ResultType resultType, - String metricnamespace, Context context) { + String metricnamespace, Boolean autoAdjustTimegrain, Boolean validateDimensions, String rollupby, + Context context) { final String accept = "application/json"; return service.listSync(this.client.getHost(), resourceUri, timespan, interval, metricnames, aggregation, top, - orderBy, filter, resultType, this.client.getApiVersion(), metricnamespace, accept, context); + orderBy, filter, resultType, this.client.getApiVersion(), metricnamespace, autoAdjustTimegrain, + validateDimensions, rollupby, accept, context); } /** @@ -316,28 +1049,33 @@ public Response listWithResponse(String resourceUri, String tim * @param interval The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special * case for 'FULL' value that returns single datapoint for entire time span requested. * *Examples: PT15M, PT1H, P1D, FULL*. - * @param metricnames The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself - * has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**. + * @param metricnames The names of the metrics (comma separated) to retrieve. * @param aggregation The list of aggregation types (comma separated) to retrieve. - * @param top The maximum number of records to retrieve. - * Valid only if $filter is specified. + * *Examples: average, minimum, maximum*. + * @param top The maximum number of records to retrieve per resource ID in the request. + * Valid only if filter is specified. * Defaults to 10. * @param orderBy The aggregation to use for sorting results and the direction of the sort. * Only one order can be specified. - * Examples: sum asc. - * @param filter The **$filter** is used to reduce the set of metric data returned. Example: Metric contains - * metadata A, B and C. - Return all time series of C where A = a1 and B = b1 or b2 **$filter=A eq 'a1' and B eq - * 'b1' or B eq 'b2' and C eq '*'** - Invalid variant: **$filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = 'b2'** - * This is invalid because the logical or operator cannot separate two different metadata names. - Return all time - * series where A = a1, B = b1 and C = c1: **$filter=A eq 'a1' and B eq 'b1' and C eq 'c1'** - Return all time - * series where A = a1 **$filter=A eq 'a1' and B eq '*' and C eq '*'**. Special case: When dimension name or - * dimension value uses round brackets. Eg: When dimension name is **dim (test) 1** Instead of using $filter= "dim - * (test) 1 eq '*' " use **$filter= "dim %2528test%2529 1 eq '*' "** When dimension name is **dim (test) 3** and - * dimension value is **dim3 (test) val** Instead of using $filter= "dim (test) 3 eq 'dim3 (test) val' " use - * **$filter= "dim %2528test%2529 3 eq 'dim3 %2528test%2529 val' "**. + * *Examples: sum asc*. + * @param filter The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all + * time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. * @param resultType Reduces the set of data collected. The syntax allowed depends on the operation. See the * operation's description for details. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param autoAdjustTimegrain When set to true, if the timespan passed in is not supported by this metric, the API + * will return the result using the closest supported timespan. When set to false, an error is returned for invalid + * timespan parameters. Defaults to false. + * @param validateDimensions When set to false, invalid filter parameter values will be ignored. When set to true, + * an error is returned for invalid filter parameters. Defaults to true. + * @param rollupby Dimension name(s) to rollup results by. For example if you only want to see metric values with a + * filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can + * specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -345,8 +1083,9 @@ public Response listWithResponse(String resourceUri, String tim */ @ServiceMethod(returns = ReturnType.SINGLE) public MetricsResponse list(String resourceUri, String timespan, Duration interval, String metricnames, - String aggregation, Integer top, String orderBy, String filter, ResultType resultType, String metricnamespace) { + String aggregation, Integer top, String orderBy, String filter, ResultType resultType, String metricnamespace, + Boolean autoAdjustTimegrain, Boolean validateDimensions, String rollupby) { return listWithResponse(resourceUri, timespan, interval, metricnames, aggregation, top, orderBy, filter, - resultType, metricnamespace, Context.NONE).getValue(); + resultType, metricnamespace, autoAdjustTimegrain, validateDimensions, rollupby, Context.NONE).getValue(); } } diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/MonitorManagementClientImpl.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/MonitorManagementClientImpl.java index 6f57dfa57fcef..af7604dabed16 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/MonitorManagementClientImpl.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/MonitorManagementClientImpl.java @@ -12,9 +12,23 @@ import com.azure.core.util.serializer.SerializerAdapter; /** - * Initializes a new instance of the MonitorManagementClient type. + * Initializes a new instance of the AzureMonitorMetricsDataAPI type. */ public final class MonitorManagementClientImpl { + /** + * The ID of the target subscription. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + /** * server parameter. */ @@ -86,39 +100,43 @@ public MetricsImpl getMetrics() { } /** - * Initializes an instance of MonitorManagementClient client. + * Initializes an instance of AzureMonitorMetricsDataAPI client. * + * @param subscriptionId The ID of the target subscription. * @param host server parameter. * @param apiVersion Api Version. */ - MonitorManagementClientImpl(String host, String apiVersion) { + MonitorManagementClientImpl(String subscriptionId, String host, String apiVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), host, apiVersion); + JacksonAdapter.createDefaultSerializerAdapter(), subscriptionId, host, apiVersion); } /** - * Initializes an instance of MonitorManagementClient client. + * Initializes an instance of AzureMonitorMetricsDataAPI client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param subscriptionId The ID of the target subscription. * @param host server parameter. * @param apiVersion Api Version. */ - MonitorManagementClientImpl(HttpPipeline httpPipeline, String host, String apiVersion) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), host, apiVersion); + MonitorManagementClientImpl(HttpPipeline httpPipeline, String subscriptionId, String host, String apiVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), subscriptionId, host, apiVersion); } /** - * Initializes an instance of MonitorManagementClient client. + * Initializes an instance of AzureMonitorMetricsDataAPI client. * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param subscriptionId The ID of the target subscription. * @param host server parameter. * @param apiVersion Api Version. */ - MonitorManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String host, - String apiVersion) { + MonitorManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String subscriptionId, + String host, String apiVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.subscriptionId = subscriptionId; this.host = host; this.apiVersion = apiVersion; this.metrics = new MetricsImpl(this); diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/MonitorManagementClientImplBuilder.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/MonitorManagementClientImplBuilder.java index 74ef08a9916c0..615c4ed9f3f7e 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/MonitorManagementClientImplBuilder.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/MonitorManagementClientImplBuilder.java @@ -40,7 +40,7 @@ import java.util.Objects; /** - * A builder for creating a new instance of the MonitorManagementClient type. + * A builder for creating a new instance of the AzureMonitorMetricsDataAPI type. */ @ServiceClientBuilder(serviceClients = { MonitorManagementClientImpl.class }) public final class MonitorManagementClientImplBuilder implements HttpTrait, @@ -58,7 +58,7 @@ public final class MonitorManagementClientImplBuilder implements HttpTrait pipelinePolicies; /** - * Create an instance of the MonitorManagementClientBuilder. + * Create an instance of the AzureMonitorMetricsDataAPIBuilder. */ @Generated public MonitorManagementClientImplBuilder() { @@ -188,6 +188,24 @@ public MonitorManagementClientImplBuilder credential(TokenCredential tokenCreden return this; } + /* + * The ID of the target subscription. + */ + @Generated + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the AzureMonitorMetricsDataAPIBuilder. + */ + @Generated + public MonitorManagementClientImplBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + /* * server parameter */ @@ -198,7 +216,7 @@ public MonitorManagementClientImplBuilder credential(TokenCredential tokenCreden * Sets server parameter. * * @param host the host value. - * @return the MonitorManagementClientBuilder. + * @return the AzureMonitorMetricsDataAPIBuilder. */ @Generated public MonitorManagementClientImplBuilder host(String host) { @@ -216,7 +234,7 @@ public MonitorManagementClientImplBuilder host(String host) { * Sets Api Version. * * @param apiVersion the apiVersion value. - * @return the MonitorManagementClientBuilder. + * @return the AzureMonitorMetricsDataAPIBuilder. */ @Generated public MonitorManagementClientImplBuilder apiVersion(String apiVersion) { @@ -234,7 +252,7 @@ public MonitorManagementClientImplBuilder apiVersion(String apiVersion) { * Sets The serializer to serialize an object into a string. * * @param serializerAdapter the serializerAdapter value. - * @return the MonitorManagementClientBuilder. + * @return the AzureMonitorMetricsDataAPIBuilder. */ @Generated public MonitorManagementClientImplBuilder serializerAdapter(SerializerAdapter serializerAdapter) { @@ -252,7 +270,7 @@ public MonitorManagementClientImplBuilder serializerAdapter(SerializerAdapter se * Sets The retry policy that will attempt to retry failed requests, if applicable. * * @param retryPolicy the retryPolicy value. - * @return the MonitorManagementClientBuilder. + * @return the AzureMonitorMetricsDataAPIBuilder. */ @Generated public MonitorManagementClientImplBuilder retryPolicy(RetryPolicy retryPolicy) { @@ -261,19 +279,19 @@ public MonitorManagementClientImplBuilder retryPolicy(RetryPolicy retryPolicy) { } /** - * Builds an instance of MonitorManagementClient with the provided parameters. + * Builds an instance of AzureMonitorMetricsDataAPI with the provided parameters. * - * @return an instance of MonitorManagementClient. + * @return an instance of AzureMonitorMetricsDataAPI. */ @Generated public MonitorManagementClientImpl buildClient() { HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); String localHost = (host != null) ? host : "https://management.azure.com"; - String localApiVersion = (apiVersion != null) ? apiVersion : "2018-01-01"; + String localApiVersion = (apiVersion != null) ? apiVersion : "2024-02-01"; SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter : JacksonAdapter.createDefaultSerializerAdapter(); - MonitorManagementClientImpl client - = new MonitorManagementClientImpl(localPipeline, localSerializerAdapter, localHost, localApiVersion); + MonitorManagementClientImpl client = new MonitorManagementClientImpl(localPipeline, localSerializerAdapter, + this.subscriptionId, localHost, localApiVersion); return client; } @@ -308,7 +326,7 @@ private HttpPipeline createHttpPipeline() { this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) .forEach(p -> policies.add(p)); HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); + policies.add(new HttpLoggingPolicy(localHttpLogOptions)); HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(httpClient).clientOptions(localClientOptions).build(); return httpPipeline; diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/ErrorAdditionalInfo.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/ErrorAdditionalInfo.java new file mode 100644 index 0000000000000..2f1abe1f2a0f5 --- /dev/null +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/ErrorAdditionalInfo.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.monitor.query.implementation.metrics.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource management error additional info. + */ +@Immutable +public final class ErrorAdditionalInfo { + /* + * The additional info type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The additional info. + */ + @JsonProperty(value = "info", access = JsonProperty.Access.WRITE_ONLY) + private Object info; + + /** + * Creates an instance of ErrorAdditionalInfo class. + */ + public ErrorAdditionalInfo() { + } + + /** + * Get the type property: The additional info type. + * + * @return the type value. + */ + public String getType() { + return this.type; + } + + /** + * Get the info property: The additional info. + * + * @return the info value. + */ + public Object getInfo() { + return this.info; + } +} diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/ErrorContract.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/ErrorContract.java new file mode 100644 index 0000000000000..68f0a9a8353b7 --- /dev/null +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/ErrorContract.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.monitor.query.implementation.metrics.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error Response + * + * Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also + * follows the OData error response format.). + */ +@Fluent +public final class ErrorContract { + /* + * Error Response + * + * The error object. + */ + @JsonProperty(value = "error") + private ErrorResponse error; + + /** + * Creates an instance of ErrorContract class. + */ + public ErrorContract() { + } + + /** + * Get the error property: Error Response + * + * The error object. + * + * @return the error value. + */ + public ErrorResponse getError() { + return this.error; + } + + /** + * Set the error property: Error Response + * + * The error object. + * + * @param error the error value to set. + * @return the ErrorContract object itself. + */ + public ErrorContract setError(ErrorResponse error) { + this.error = error; + return this; + } +} diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/ErrorContractException.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/ErrorContractException.java new file mode 100644 index 0000000000000..37c027bf88efa --- /dev/null +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/ErrorContractException.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.monitor.query.implementation.metrics.models; + +import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.HttpResponse; + +/** + * Exception thrown for an invalid response with ErrorContract information. + */ +public final class ErrorContractException extends HttpResponseException { + /** + * Initializes a new instance of the ErrorContractException class. + * + * @param message the exception message or the response content if a message is not available. + * @param response the HTTP response. + */ + public ErrorContractException(String message, HttpResponse response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorContractException 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 ErrorContractException(String message, HttpResponse response, ErrorContract value) { + super(message, response, value); + } + + /** + * {@inheritDoc} + */ + @Override + public ErrorContract getValue() { + return (ErrorContract) super.getValue(); + } +} diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/ErrorResponse.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/ErrorResponse.java index c9df6c4746ad9..a23875aa8b06b 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/ErrorResponse.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/ErrorResponse.java @@ -4,26 +4,48 @@ package com.azure.monitor.query.implementation.metrics.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; /** - * Describes the format of Error response. + * Error Response + * + * Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also + * follows the OData error response format.). */ -@Fluent +@Immutable public final class ErrorResponse { /* - * Error code + * The error code. */ - @JsonProperty(value = "code") + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) private String code; /* - * Error message indicating why the operation failed. + * The error message. */ - @JsonProperty(value = "message") + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) private String message; + /* + * The error target. + */ + @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /* + * The error details. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /* + * The error additional info. + */ + @JsonProperty(value = "additionalInfo", access = JsonProperty.Access.WRITE_ONLY) + private List additionalInfo; + /** * Creates an instance of ErrorResponse class. */ @@ -31,7 +53,7 @@ public ErrorResponse() { } /** - * Get the code property: Error code. + * Get the code property: The error code. * * @return the code value. */ @@ -40,33 +62,38 @@ public String getCode() { } /** - * Set the code property: Error code. + * Get the message property: The error message. + * + * @return the message value. + */ + public String getMessage() { + return this.message; + } + + /** + * Get the target property: The error target. * - * @param code the code value to set. - * @return the ErrorResponse object itself. + * @return the target value. */ - public ErrorResponse setCode(String code) { - this.code = code; - return this; + public String getTarget() { + return this.target; } /** - * Get the message property: Error message indicating why the operation failed. + * Get the details property: The error details. * - * @return the message value. + * @return the details value. */ - public String getMessage() { - return this.message; + public List getDetails() { + return this.details; } /** - * Set the message property: Error message indicating why the operation failed. + * Get the additionalInfo property: The error additional info. * - * @param message the message value to set. - * @return the ErrorResponse object itself. + * @return the additionalInfo value. */ - public ErrorResponse setMessage(String message) { - this.message = message; - return this; + public List getAdditionalInfo() { + return this.additionalInfo; } } diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/Metric.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/Metric.java index 7ca4b12d5d850..464bd837e1637 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/Metric.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/Metric.java @@ -15,19 +15,19 @@ @Fluent public final class Metric { /* - * the metric Id. + * The metric Id. */ @JsonProperty(value = "id", required = true) private String id; /* - * the resource type of the metric resource. + * The resource type of the metric resource. */ @JsonProperty(value = "type", required = true) private String type; /* - * the name and the display name of the metric, i.e. it is localizable string. + * The name and the display name of the metric, i.e. it is localizable string. */ @JsonProperty(value = "name", required = true) private LocalizableString name; @@ -57,7 +57,7 @@ public final class Metric { private MetricUnit unit; /* - * the time series returned when a data query is performed. + * The time series returned when a data query is performed. */ @JsonProperty(value = "timeseries", required = true) private List timeseries; @@ -85,7 +85,7 @@ public Metric(@JsonProperty(value = "id", required = true) String id, } /** - * Get the id property: the metric Id. + * Get the id property: The metric Id. * * @return the id value. */ @@ -94,7 +94,7 @@ public String getId() { } /** - * Get the type property: the resource type of the metric resource. + * Get the type property: The resource type of the metric resource. * * @return the type value. */ @@ -103,7 +103,7 @@ public String getType() { } /** - * Get the name property: the name and the display name of the metric, i.e. it is localizable string. + * Get the name property: The name and the display name of the metric, i.e. it is localizable string. * * @return the name value. */ @@ -181,7 +181,7 @@ public MetricUnit getUnit() { } /** - * Get the timeseries property: the time series returned when a data query is performed. + * Get the timeseries property: The time series returned when a data query is performed. * * @return the timeseries value. */ diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/MetricResultType.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/MetricResultType.java new file mode 100644 index 0000000000000..019de10230d24 --- /dev/null +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/MetricResultType.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.monitor.query.implementation.metrics.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for + * details. + */ +public final class MetricResultType extends ExpandableStringEnum { + /** + * Static value Data for MetricResultType. + */ + public static final MetricResultType DATA = fromString("Data"); + + /** + * Static value Metadata for MetricResultType. + */ + public static final MetricResultType METADATA = fromString("Metadata"); + + /** + * Creates a new instance of MetricResultType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MetricResultType() { + } + + /** + * Creates or finds a MetricResultType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MetricResultType. + */ + @JsonCreator + public static MetricResultType fromString(String name) { + return fromString(name, MetricResultType.class); + } + + /** + * Gets known MetricResultType values. + * + * @return known MetricResultType values. + */ + public static Collection values() { + return values(MetricResultType.class); + } +} diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/MetricUnit.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/MetricUnit.java index 49c07ffd2573b..f123c2a08e8d4 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/MetricUnit.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/MetricUnit.java @@ -13,67 +13,68 @@ */ public final class MetricUnit extends ExpandableStringEnum { /** - * Static value Count for MetricUnit. + * Unit of raw quantity. */ public static final MetricUnit COUNT = fromString("Count"); /** - * Static value Bytes for MetricUnit. + * Unit of memory in bytes. */ public static final MetricUnit BYTES = fromString("Bytes"); /** - * Static value Seconds for MetricUnit. + * Unit of time in seconds. */ public static final MetricUnit SECONDS = fromString("Seconds"); /** - * Static value CountPerSecond for MetricUnit. + * Rate unit of raw quantity per second. */ public static final MetricUnit COUNT_PER_SECOND = fromString("CountPerSecond"); /** - * Static value BytesPerSecond for MetricUnit. + * Rate unit of memory in bytes per second. */ public static final MetricUnit BYTES_PER_SECOND = fromString("BytesPerSecond"); /** - * Static value Percent for MetricUnit. + * Percentage unit. */ public static final MetricUnit PERCENT = fromString("Percent"); /** - * Static value MilliSeconds for MetricUnit. + * Unit of time in 1/1000th of a second. */ public static final MetricUnit MILLI_SECONDS = fromString("MilliSeconds"); /** - * Static value ByteSeconds for MetricUnit. + * Unit of data transfer or storage. It is the size of the data in bytes multiplied by the time it takes to transfer + * or store the data in seconds. */ public static final MetricUnit BYTE_SECONDS = fromString("ByteSeconds"); /** - * Static value Unspecified for MetricUnit. + * No specified unit. */ public static final MetricUnit UNSPECIFIED = fromString("Unspecified"); /** - * Static value Cores for MetricUnit. + * Unit of processing power. */ public static final MetricUnit CORES = fromString("Cores"); /** - * Static value MilliCores for MetricUnit. + * Unit of processing power in 1/1000th of a CPU core. */ public static final MetricUnit MILLI_CORES = fromString("MilliCores"); /** - * Static value NanoCores for MetricUnit. + * Unit of processing power in one billionth of a CPU core. */ public static final MetricUnit NANO_CORES = fromString("NanoCores"); /** - * Static value BitsPerSecond for MetricUnit. + * Rate unit of binary digits per second. */ public static final MetricUnit BITS_PER_SECOND = fromString("BitsPerSecond"); diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/MetricsHelper.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/MetricsHelper.java index a9557225cd07a..2e15ceb101e99 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/MetricsHelper.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/MetricsHelper.java @@ -217,7 +217,7 @@ public static MetricsQueryResult mapToMetricsQueryResult(MetricResultsResponseVa .collect(Collectors.toList()); MetricsQueryResult metricsQueryResult = new MetricsQueryResult(/* TODO (srnagar): fix this item.getCost() */ null, - new QueryTimeInterval(item.getInterval()), item.getInterval(), item.getNamespace(), item.getResourceregion(), metrics); + QueryTimeInterval.parse(item.getStarttime() + "/" + item.getEndtime()), Duration.parse(item.getInterval()), item.getNamespace(), item.getResourceregion(), metrics); return metricsQueryResult; } diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/MetricsResponse.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/MetricsResponse.java index a4a0bbc2de468..0b7676027c988 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/MetricsResponse.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/MetricsResponse.java @@ -51,7 +51,7 @@ public final class MetricsResponse { private String resourceregion; /* - * the value of the collection. + * The value of the collection. */ @JsonProperty(value = "value", required = true) private List value; @@ -169,7 +169,7 @@ public MetricsResponse setResourceregion(String resourceregion) { } /** - * Get the value property: the value of the collection. + * Get the value property: The value of the collection. * * @return the value value. */ diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/SubscriptionScopeMetricsRequestBodyParameters.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/SubscriptionScopeMetricsRequestBodyParameters.java new file mode 100644 index 0000000000000..36163baa1e910 --- /dev/null +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/SubscriptionScopeMetricsRequestBodyParameters.java @@ -0,0 +1,388 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.monitor.query.implementation.metrics.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Query parameters can also be specified in the body, specifying the same parameter in both the body and query + * parameters will result in an error. + */ +@Fluent +public final class SubscriptionScopeMetricsRequestBodyParameters { + /* + * The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'. + */ + @JsonProperty(value = "timespan") + private String timespan; + + /* + * The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special case for + * 'FULL' value that returns single datapoint for entire time span requested. + * *Examples: PT15M, PT1H, P1D, FULL* + */ + @JsonProperty(value = "interval") + private String interval; + + /* + * The names of the metrics (comma separated) to retrieve. + */ + @JsonProperty(value = "metricNames") + private String metricNames; + + /* + * The list of aggregation types (comma separated) to retrieve. + */ + @JsonProperty(value = "aggregation") + private String aggregation; + + /* + * The **$filter** is used to reduce the set of metric data returned.
Example:
Metric contains metadata A, B + * and C.
- Return all time series of C where A = a1 and B = b1 or b2
**$filter=A eq ‘a1’ and B eq ‘b1’ or B + * eq ‘b2’ and C eq ‘*’**
- Invalid variant:
**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = + * ‘b2’**
This is invalid because the logical or operator cannot separate two different metadata names.
- + * Return all time series where A = a1, B = b1 and C = c1:
**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq + * ‘c1’**
- Return all time series where A = a1
**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + */ + @JsonProperty(value = "filter") + private String filter; + + /* + * The maximum number of records to retrieve. + * Valid only if $filter is specified. + * Defaults to 10. + */ + @JsonProperty(value = "top") + private Integer top; + + /* + * The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * Examples: sum asc. + */ + @JsonProperty(value = "orderBy") + private String orderBy; + + /* + * Dimension name(s) to rollup results by. For example if you only want to see metric values with a filter like + * 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can specify + * 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. + */ + @JsonProperty(value = "rollUpBy") + private String rollUpBy; + + /* + * Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description + * for details. + */ + @JsonProperty(value = "resultType") + private MetricResultType resultType; + + /* + * Metric namespace where the metrics you want reside. + */ + @JsonProperty(value = "metricNamespace") + private String metricNamespace; + + /* + * When set to true, if the timespan passed in is not supported by this metric, the API will return the result + * using the closest supported timespan. When set to false, an error is returned for invalid timespan parameters. + * Defaults to false. + */ + @JsonProperty(value = "autoAdjustTimegrain") + private Boolean autoAdjustTimegrain; + + /* + * When set to false, invalid filter parameter values will be ignored. When set to true, an error is returned for + * invalid filter parameters. Defaults to true. + */ + @JsonProperty(value = "validateDimensions") + private Boolean validateDimensions; + + /** + * Creates an instance of SubscriptionScopeMetricsRequestBodyParameters class. + */ + public SubscriptionScopeMetricsRequestBodyParameters() { + } + + /** + * Get the timespan property: The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * + * @return the timespan value. + */ + public String getTimespan() { + return this.timespan; + } + + /** + * Set the timespan property: The timespan of the query. It is a string with the following format + * 'startDateTime_ISO/endDateTime_ISO'. + * + * @param timespan the timespan value to set. + * @return the SubscriptionScopeMetricsRequestBodyParameters object itself. + */ + public SubscriptionScopeMetricsRequestBodyParameters setTimespan(String timespan) { + this.timespan = timespan; + return this; + } + + /** + * Get the interval property: The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to + * PT1M. Special case for 'FULL' value that returns single datapoint for entire time span requested. + * *Examples: PT15M, PT1H, P1D, FULL*. + * + * @return the interval value. + */ + public String getInterval() { + return this.interval; + } + + /** + * Set the interval property: The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to + * PT1M. Special case for 'FULL' value that returns single datapoint for entire time span requested. + * *Examples: PT15M, PT1H, P1D, FULL*. + * + * @param interval the interval value to set. + * @return the SubscriptionScopeMetricsRequestBodyParameters object itself. + */ + public SubscriptionScopeMetricsRequestBodyParameters setInterval(String interval) { + this.interval = interval; + return this; + } + + /** + * Get the metricNames property: The names of the metrics (comma separated) to retrieve. + * + * @return the metricNames value. + */ + public String getMetricNames() { + return this.metricNames; + } + + /** + * Set the metricNames property: The names of the metrics (comma separated) to retrieve. + * + * @param metricNames the metricNames value to set. + * @return the SubscriptionScopeMetricsRequestBodyParameters object itself. + */ + public SubscriptionScopeMetricsRequestBodyParameters setMetricNames(String metricNames) { + this.metricNames = metricNames; + return this; + } + + /** + * Get the aggregation property: The list of aggregation types (comma separated) to retrieve. + * + * @return the aggregation value. + */ + public String getAggregation() { + return this.aggregation; + } + + /** + * Set the aggregation property: The list of aggregation types (comma separated) to retrieve. + * + * @param aggregation the aggregation value to set. + * @return the SubscriptionScopeMetricsRequestBodyParameters object itself. + */ + public SubscriptionScopeMetricsRequestBodyParameters setAggregation(String aggregation) { + this.aggregation = aggregation; + return this; + } + + /** + * Get the filter property: The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return + * all time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * + * @return the filter value. + */ + public String getFilter() { + return this.filter; + } + + /** + * Set the filter property: The **$filter** is used to reduce the set of metric data + * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C + * where A = a1 and B = b1 or b2<br>**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- + * Invalid variant:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid + * because the logical or operator cannot separate two different metadata names.<br>- Return all time series + * where A = a1, B = b1 and C = c1:<br>**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return + * all time series where A = a1<br>**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * + * @param filter the filter value to set. + * @return the SubscriptionScopeMetricsRequestBodyParameters object itself. + */ + public SubscriptionScopeMetricsRequestBodyParameters setFilter(String filter) { + this.filter = filter; + return this; + } + + /** + * Get the top property: The maximum number of records to retrieve. + * Valid only if $filter is specified. + * Defaults to 10. + * + * @return the top value. + */ + public Integer getTop() { + return this.top; + } + + /** + * Set the top property: The maximum number of records to retrieve. + * Valid only if $filter is specified. + * Defaults to 10. + * + * @param top the top value to set. + * @return the SubscriptionScopeMetricsRequestBodyParameters object itself. + */ + public SubscriptionScopeMetricsRequestBodyParameters setTop(Integer top) { + this.top = top; + return this; + } + + /** + * Get the orderBy property: The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * Examples: sum asc. + * + * @return the orderBy value. + */ + public String getOrderBy() { + return this.orderBy; + } + + /** + * Set the orderBy property: The aggregation to use for sorting results and the direction of the sort. + * Only one order can be specified. + * Examples: sum asc. + * + * @param orderBy the orderBy value to set. + * @return the SubscriptionScopeMetricsRequestBodyParameters object itself. + */ + public SubscriptionScopeMetricsRequestBodyParameters setOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + + /** + * Get the rollUpBy property: Dimension name(s) to rollup results by. For example if you only want to see metric + * values with a filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each + * city, you can specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. + * + * @return the rollUpBy value. + */ + public String getRollUpBy() { + return this.rollUpBy; + } + + /** + * Set the rollUpBy property: Dimension name(s) to rollup results by. For example if you only want to see metric + * values with a filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each + * city, you can specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. + * + * @param rollUpBy the rollUpBy value to set. + * @return the SubscriptionScopeMetricsRequestBodyParameters object itself. + */ + public SubscriptionScopeMetricsRequestBodyParameters setRollUpBy(String rollUpBy) { + this.rollUpBy = rollUpBy; + return this; + } + + /** + * Get the resultType property: Reduces the set of data collected. The syntax allowed depends on the operation. See + * the operation's description for details. + * + * @return the resultType value. + */ + public MetricResultType getResultType() { + return this.resultType; + } + + /** + * Set the resultType property: Reduces the set of data collected. The syntax allowed depends on the operation. See + * the operation's description for details. + * + * @param resultType the resultType value to set. + * @return the SubscriptionScopeMetricsRequestBodyParameters object itself. + */ + public SubscriptionScopeMetricsRequestBodyParameters setResultType(MetricResultType resultType) { + this.resultType = resultType; + return this; + } + + /** + * Get the metricNamespace property: Metric namespace where the metrics you want reside. + * + * @return the metricNamespace value. + */ + public String getMetricNamespace() { + return this.metricNamespace; + } + + /** + * Set the metricNamespace property: Metric namespace where the metrics you want reside. + * + * @param metricNamespace the metricNamespace value to set. + * @return the SubscriptionScopeMetricsRequestBodyParameters object itself. + */ + public SubscriptionScopeMetricsRequestBodyParameters setMetricNamespace(String metricNamespace) { + this.metricNamespace = metricNamespace; + return this; + } + + /** + * Get the autoAdjustTimegrain property: When set to true, if the timespan passed in is not supported by this + * metric, the API will return the result using the closest supported timespan. When set to false, an error is + * returned for invalid timespan parameters. Defaults to false. + * + * @return the autoAdjustTimegrain value. + */ + public Boolean isAutoAdjustTimegrain() { + return this.autoAdjustTimegrain; + } + + /** + * Set the autoAdjustTimegrain property: When set to true, if the timespan passed in is not supported by this + * metric, the API will return the result using the closest supported timespan. When set to false, an error is + * returned for invalid timespan parameters. Defaults to false. + * + * @param autoAdjustTimegrain the autoAdjustTimegrain value to set. + * @return the SubscriptionScopeMetricsRequestBodyParameters object itself. + */ + public SubscriptionScopeMetricsRequestBodyParameters setAutoAdjustTimegrain(Boolean autoAdjustTimegrain) { + this.autoAdjustTimegrain = autoAdjustTimegrain; + return this; + } + + /** + * Get the validateDimensions property: When set to false, invalid filter parameter values will be ignored. When + * set to true, an error is returned for invalid filter parameters. Defaults to true. + * + * @return the validateDimensions value. + */ + public Boolean isValidateDimensions() { + return this.validateDimensions; + } + + /** + * Set the validateDimensions property: When set to false, invalid filter parameter values will be ignored. When + * set to true, an error is returned for invalid filter parameters. Defaults to true. + * + * @param validateDimensions the validateDimensions value to set. + * @return the SubscriptionScopeMetricsRequestBodyParameters object itself. + */ + public SubscriptionScopeMetricsRequestBodyParameters setValidateDimensions(Boolean validateDimensions) { + this.validateDimensions = validateDimensions; + return this; + } +} diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/TimeSeriesElement.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/TimeSeriesElement.java index 7be6be29a237a..5fdfb128fca7c 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/TimeSeriesElement.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/TimeSeriesElement.java @@ -14,7 +14,7 @@ @Fluent public final class TimeSeriesElement { /* - * the metadata values returned if $filter was specified in the call. + * The metadata values returned if $filter was specified in the call. */ @JsonProperty(value = "metadatavalues") private List metadatavalues; @@ -33,7 +33,7 @@ public TimeSeriesElement() { } /** - * Get the metadatavalues property: the metadata values returned if $filter was specified in the call. + * Get the metadatavalues property: The metadata values returned if $filter was specified in the call. * * @return the metadatavalues value. */ @@ -42,7 +42,7 @@ public List getMetadatavalues() { } /** - * Set the metadatavalues property: the metadata values returned if $filter was specified in the call. + * Set the metadatavalues property: The metadata values returned if $filter was specified in the call. * * @param metadatavalues the metadatavalues value to set. * @return the TimeSeriesElement object itself. diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/package-info.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/package-info.java index e918845ebbc27..b1b97e76a4fb6 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/package-info.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/models/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the data models for MonitorManagementClient. - * null. + * Package containing the data models for AzureMonitorMetricsDataAPI. + * Provides APIs for getting the metric data for Azure resources. */ package com.azure.monitor.query.implementation.metrics.models; diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/package-info.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/package-info.java index 8b18437ec6ab6..5699ec985b350 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/package-info.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metrics/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the classes for MonitorManagementClient. - * null. + * Package containing the classes for AzureMonitorMetricsDataAPI. + * Provides APIs for getting the metric data for Azure resources. */ package com.azure.monitor.query.implementation.metrics; diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/AzureMonitorMetricBatchBuilder.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/AzureMonitorMetricBatchBuilder.java index 95beda1631faf..2527c27549058 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/AzureMonitorMetricBatchBuilder.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/AzureMonitorMetricBatchBuilder.java @@ -214,7 +214,7 @@ public AzureMonitorMetricBatchBuilder endpoint(String endpoint) { /** * Sets Api Version. - * + * * @param apiVersion the apiVersion value. * @return the AzureMonitorMetricBatchBuilder. */ @@ -232,7 +232,7 @@ public AzureMonitorMetricBatchBuilder apiVersion(String apiVersion) { /** * Sets The serializer to serialize an object into a string. - * + * * @param serializerAdapter the serializerAdapter value. * @return the AzureMonitorMetricBatchBuilder. */ @@ -250,7 +250,7 @@ public AzureMonitorMetricBatchBuilder serializerAdapter(SerializerAdapter serial /** * Sets The retry policy that will attempt to retry failed requests, if applicable. - * + * * @param retryPolicy the retryPolicy value. * @return the AzureMonitorMetricBatchBuilder. */ @@ -262,13 +262,13 @@ public AzureMonitorMetricBatchBuilder retryPolicy(RetryPolicy retryPolicy) { /** * Builds an instance of AzureMonitorMetricBatch with the provided parameters. - * + * * @return an instance of AzureMonitorMetricBatch. */ @Generated public AzureMonitorMetricBatch buildClient() { HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - String localApiVersion = (apiVersion != null) ? apiVersion : "2023-05-01-preview"; + String localApiVersion = (apiVersion != null) ? apiVersion : "2024-02-01"; SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter : JacksonAdapter.createDefaultSerializerAdapter(); AzureMonitorMetricBatch client @@ -306,7 +306,7 @@ private HttpPipeline createHttpPipeline() { this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) .forEach(p -> policies.add(p)); HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); + policies.add(new HttpLoggingPolicy(localHttpLogOptions)); HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(httpClient).clientOptions(localClientOptions).build(); return httpPipeline; diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/MetricsBatches.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/MetricsBatches.java index 29ae890175a01..b4f4b17680753 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/MetricsBatches.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/MetricsBatches.java @@ -20,7 +20,7 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.monitor.query.implementation.metricsbatch.models.AdditionalInfoErrorResponseException; +import com.azure.monitor.query.implementation.metricsbatch.models.ErrorResponseException; import com.azure.monitor.query.implementation.metricsbatch.models.MetricResultsResponse; import com.azure.monitor.query.implementation.metricsbatch.models.ResourceIdList; import java.time.Duration; @@ -63,27 +63,29 @@ public final class MetricsBatches { public interface MetricsBatchesService { @Post("/subscriptions/{subscriptionId}/metrics:getBatch") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(AdditionalInfoErrorResponseException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Mono> batch(@HostParam("endpoint") String endpoint, @PathParam("subscriptionId") String subscriptionId, @QueryParam("starttime") String starttime, @QueryParam("endtime") String endtime, @QueryParam("interval") Duration interval, @QueryParam("metricnamespace") String metricnamespace, @QueryParam("metricnames") String metricnames, @QueryParam("aggregation") String aggregation, @QueryParam("top") Integer top, @QueryParam("orderby") String orderBy, @QueryParam("filter") String filter, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ResourceIdList resourceIds, - @HeaderParam("Accept") String accept, Context context); + @QueryParam("rollupby") String rollupby, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ResourceIdList batchRequest, @HeaderParam("Accept") String accept, + Context context); @Post("/subscriptions/{subscriptionId}/metrics:getBatch") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(AdditionalInfoErrorResponseException.class) + @UnexpectedResponseExceptionType(ErrorResponseException.class) Response batchSync(@HostParam("endpoint") String endpoint, @PathParam("subscriptionId") String subscriptionId, @QueryParam("starttime") String starttime, @QueryParam("endtime") String endtime, @QueryParam("interval") Duration interval, @QueryParam("metricnamespace") String metricnamespace, @QueryParam("metricnames") String metricnames, @QueryParam("aggregation") String aggregation, @QueryParam("top") Integer top, @QueryParam("orderby") String orderBy, @QueryParam("filter") String filter, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ResourceIdList resourceIds, - @HeaderParam("Accept") String accept, Context context); + @QueryParam("rollupby") String rollupby, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ResourceIdList batchRequest, @HeaderParam("Accept") String accept, + Context context); } /** @@ -92,14 +94,15 @@ Response batchSync(@HostParam("endpoint") String endpoint * @param subscriptionId The subscription identifier for the resources in this batch. * @param metricnamespace Metric namespace that contains the requested metric names. * @param metricnames The names of the metrics (comma separated) to retrieve. - * @param resourceIds The comma separated list of resource IDs to query metrics for. + * @param batchRequest Metrics batch body including the list of resource ids. * @param starttime The start time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. If you * have specified the endtime parameter, then this parameter is required. * If only starttime is specified, then endtime defaults to the current time. * If no time interval is specified, the default is 1 hour. * @param endtime The end time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. - * @param interval The interval (i.e. timegrain) of the query. - * *Examples: PT15M, PT1H, P1D*. + * @param interval The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special + * case for 'FULL' value that returns single datapoint for entire time span requested. + * *Examples: PT15M, PT1H, P1D, FULL*. * @param aggregation The list of aggregation types (comma separated) to retrieve. * *Examples: average, minimum, maximum*. * @param top The maximum number of records to retrieve per resource ID in the request. @@ -115,21 +118,24 @@ Response batchSync(@HostParam("endpoint") String endpoint * the logical or operator cannot separate two different metadata names.<br>- Return all time series where A = * a1, B = b1 and C = c1:<br>**filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all time * series where A = a1<br>**filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * @param rollupby Dimension name(s) to rollup results by. For example if you only want to see metric values with a + * filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can + * specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws AdditionalInfoErrorResponseException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the metrics result for a resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> batchWithResponseAsync(String subscriptionId, String metricnamespace, - List metricnames, ResourceIdList resourceIds, String starttime, String endtime, Duration interval, - String aggregation, Integer top, String orderBy, String filter) { + List metricnames, ResourceIdList batchRequest, String starttime, String endtime, Duration interval, + String aggregation, Integer top, String orderBy, String filter, String rollupby) { final String accept = "application/json"; String metricnamesConverted = metricnames.stream().map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); return FluxUtil.withContext(context -> service.batch(this.client.getEndpoint(), subscriptionId, starttime, - endtime, interval, metricnamespace, metricnamesConverted, aggregation, top, orderBy, filter, - this.client.getApiVersion(), resourceIds, accept, context)); + endtime, interval, metricnamespace, metricnamesConverted, aggregation, top, orderBy, filter, rollupby, + this.client.getApiVersion(), batchRequest, accept, context)); } /** @@ -138,14 +144,15 @@ public Mono> batchWithResponseAsync(String subsc * @param subscriptionId The subscription identifier for the resources in this batch. * @param metricnamespace Metric namespace that contains the requested metric names. * @param metricnames The names of the metrics (comma separated) to retrieve. - * @param resourceIds The comma separated list of resource IDs to query metrics for. + * @param batchRequest Metrics batch body including the list of resource ids. * @param starttime The start time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. If you * have specified the endtime parameter, then this parameter is required. * If only starttime is specified, then endtime defaults to the current time. * If no time interval is specified, the default is 1 hour. * @param endtime The end time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. - * @param interval The interval (i.e. timegrain) of the query. - * *Examples: PT15M, PT1H, P1D*. + * @param interval The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special + * case for 'FULL' value that returns single datapoint for entire time span requested. + * *Examples: PT15M, PT1H, P1D, FULL*. * @param aggregation The list of aggregation types (comma separated) to retrieve. * *Examples: average, minimum, maximum*. * @param top The maximum number of records to retrieve per resource ID in the request. @@ -161,22 +168,25 @@ public Mono> batchWithResponseAsync(String subsc * the logical or operator cannot separate two different metadata names.<br>- Return all time series where A = * a1, B = b1 and C = c1:<br>**filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all time * series where A = a1<br>**filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * @param rollupby Dimension name(s) to rollup results by. For example if you only want to see metric values with a + * filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can + * specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws AdditionalInfoErrorResponseException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the metrics result for a resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> batchWithResponseAsync(String subscriptionId, String metricnamespace, - List metricnames, ResourceIdList resourceIds, String starttime, String endtime, Duration interval, - String aggregation, Integer top, String orderBy, String filter, Context context) { + List metricnames, ResourceIdList batchRequest, String starttime, String endtime, Duration interval, + String aggregation, Integer top, String orderBy, String filter, String rollupby, Context context) { final String accept = "application/json"; String metricnamesConverted = metricnames.stream().map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); return service.batch(this.client.getEndpoint(), subscriptionId, starttime, endtime, interval, metricnamespace, - metricnamesConverted, aggregation, top, orderBy, filter, this.client.getApiVersion(), resourceIds, accept, - context); + metricnamesConverted, aggregation, top, orderBy, filter, rollupby, this.client.getApiVersion(), + batchRequest, accept, context); } /** @@ -185,14 +195,15 @@ public Mono> batchWithResponseAsync(String subsc * @param subscriptionId The subscription identifier for the resources in this batch. * @param metricnamespace Metric namespace that contains the requested metric names. * @param metricnames The names of the metrics (comma separated) to retrieve. - * @param resourceIds The comma separated list of resource IDs to query metrics for. + * @param batchRequest Metrics batch body including the list of resource ids. * @param starttime The start time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. If you * have specified the endtime parameter, then this parameter is required. * If only starttime is specified, then endtime defaults to the current time. * If no time interval is specified, the default is 1 hour. * @param endtime The end time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. - * @param interval The interval (i.e. timegrain) of the query. - * *Examples: PT15M, PT1H, P1D*. + * @param interval The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special + * case for 'FULL' value that returns single datapoint for entire time span requested. + * *Examples: PT15M, PT1H, P1D, FULL*. * @param aggregation The list of aggregation types (comma separated) to retrieve. * *Examples: average, minimum, maximum*. * @param top The maximum number of records to retrieve per resource ID in the request. @@ -208,17 +219,20 @@ public Mono> batchWithResponseAsync(String subsc * the logical or operator cannot separate two different metadata names.<br>- Return all time series where A = * a1, B = b1 and C = c1:<br>**filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all time * series where A = a1<br>**filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * @param rollupby Dimension name(s) to rollup results by. For example if you only want to see metric values with a + * filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can + * specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws AdditionalInfoErrorResponseException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the metrics result for a resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono batchAsync(String subscriptionId, String metricnamespace, - List metricnames, ResourceIdList resourceIds, String starttime, String endtime, Duration interval, - String aggregation, Integer top, String orderBy, String filter) { - return batchWithResponseAsync(subscriptionId, metricnamespace, metricnames, resourceIds, starttime, endtime, - interval, aggregation, top, orderBy, filter).flatMap(res -> Mono.justOrEmpty(res.getValue())); + List metricnames, ResourceIdList batchRequest, String starttime, String endtime, Duration interval, + String aggregation, Integer top, String orderBy, String filter, String rollupby) { + return batchWithResponseAsync(subscriptionId, metricnamespace, metricnames, batchRequest, starttime, endtime, + interval, aggregation, top, orderBy, filter, rollupby).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -227,14 +241,15 @@ public Mono batchAsync(String subscriptionId, String metr * @param subscriptionId The subscription identifier for the resources in this batch. * @param metricnamespace Metric namespace that contains the requested metric names. * @param metricnames The names of the metrics (comma separated) to retrieve. - * @param resourceIds The comma separated list of resource IDs to query metrics for. + * @param batchRequest Metrics batch body including the list of resource ids. * @param starttime The start time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. If you * have specified the endtime parameter, then this parameter is required. * If only starttime is specified, then endtime defaults to the current time. * If no time interval is specified, the default is 1 hour. * @param endtime The end time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. - * @param interval The interval (i.e. timegrain) of the query. - * *Examples: PT15M, PT1H, P1D*. + * @param interval The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special + * case for 'FULL' value that returns single datapoint for entire time span requested. + * *Examples: PT15M, PT1H, P1D, FULL*. * @param aggregation The list of aggregation types (comma separated) to retrieve. * *Examples: average, minimum, maximum*. * @param top The maximum number of records to retrieve per resource ID in the request. @@ -250,18 +265,22 @@ public Mono batchAsync(String subscriptionId, String metr * the logical or operator cannot separate two different metadata names.<br>- Return all time series where A = * a1, B = b1 and C = c1:<br>**filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all time * series where A = a1<br>**filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * @param rollupby Dimension name(s) to rollup results by. For example if you only want to see metric values with a + * filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can + * specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws AdditionalInfoErrorResponseException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the metrics result for a resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono batchAsync(String subscriptionId, String metricnamespace, - List metricnames, ResourceIdList resourceIds, String starttime, String endtime, Duration interval, - String aggregation, Integer top, String orderBy, String filter, Context context) { - return batchWithResponseAsync(subscriptionId, metricnamespace, metricnames, resourceIds, starttime, endtime, - interval, aggregation, top, orderBy, filter, context).flatMap(res -> Mono.justOrEmpty(res.getValue())); + List metricnames, ResourceIdList batchRequest, String starttime, String endtime, Duration interval, + String aggregation, Integer top, String orderBy, String filter, String rollupby, Context context) { + return batchWithResponseAsync(subscriptionId, metricnamespace, metricnames, batchRequest, starttime, endtime, + interval, aggregation, top, orderBy, filter, rollupby, context) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -270,14 +289,15 @@ public Mono batchAsync(String subscriptionId, String metr * @param subscriptionId The subscription identifier for the resources in this batch. * @param metricnamespace Metric namespace that contains the requested metric names. * @param metricnames The names of the metrics (comma separated) to retrieve. - * @param resourceIds The comma separated list of resource IDs to query metrics for. + * @param batchRequest Metrics batch body including the list of resource ids. * @param starttime The start time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. If you * have specified the endtime parameter, then this parameter is required. * If only starttime is specified, then endtime defaults to the current time. * If no time interval is specified, the default is 1 hour. * @param endtime The end time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. - * @param interval The interval (i.e. timegrain) of the query. - * *Examples: PT15M, PT1H, P1D*. + * @param interval The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special + * case for 'FULL' value that returns single datapoint for entire time span requested. + * *Examples: PT15M, PT1H, P1D, FULL*. * @param aggregation The list of aggregation types (comma separated) to retrieve. * *Examples: average, minimum, maximum*. * @param top The maximum number of records to retrieve per resource ID in the request. @@ -293,22 +313,25 @@ public Mono batchAsync(String subscriptionId, String metr * the logical or operator cannot separate two different metadata names.<br>- Return all time series where A = * a1, B = b1 and C = c1:<br>**filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all time * series where A = a1<br>**filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * @param rollupby Dimension name(s) to rollup results by. For example if you only want to see metric values with a + * filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can + * specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws AdditionalInfoErrorResponseException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the metrics result for a resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response batchWithResponse(String subscriptionId, String metricnamespace, - List metricnames, ResourceIdList resourceIds, String starttime, String endtime, Duration interval, - String aggregation, Integer top, String orderBy, String filter, Context context) { + List metricnames, ResourceIdList batchRequest, String starttime, String endtime, Duration interval, + String aggregation, Integer top, String orderBy, String filter, String rollupby, Context context) { final String accept = "application/json"; String metricnamesConverted = metricnames.stream().map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); return service.batchSync(this.client.getEndpoint(), subscriptionId, starttime, endtime, interval, - metricnamespace, metricnamesConverted, aggregation, top, orderBy, filter, this.client.getApiVersion(), - resourceIds, accept, context); + metricnamespace, metricnamesConverted, aggregation, top, orderBy, filter, rollupby, + this.client.getApiVersion(), batchRequest, accept, context); } /** @@ -317,14 +340,15 @@ public Response batchWithResponse(String subscriptionId, * @param subscriptionId The subscription identifier for the resources in this batch. * @param metricnamespace Metric namespace that contains the requested metric names. * @param metricnames The names of the metrics (comma separated) to retrieve. - * @param resourceIds The comma separated list of resource IDs to query metrics for. + * @param batchRequest Metrics batch body including the list of resource ids. * @param starttime The start time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. If you * have specified the endtime parameter, then this parameter is required. * If only starttime is specified, then endtime defaults to the current time. * If no time interval is specified, the default is 1 hour. * @param endtime The end time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. - * @param interval The interval (i.e. timegrain) of the query. - * *Examples: PT15M, PT1H, P1D*. + * @param interval The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special + * case for 'FULL' value that returns single datapoint for entire time span requested. + * *Examples: PT15M, PT1H, P1D, FULL*. * @param aggregation The list of aggregation types (comma separated) to retrieve. * *Examples: average, minimum, maximum*. * @param top The maximum number of records to retrieve per resource ID in the request. @@ -340,16 +364,19 @@ public Response batchWithResponse(String subscriptionId, * the logical or operator cannot separate two different metadata names.<br>- Return all time series where A = * a1, B = b1 and C = c1:<br>**filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**<br>- Return all time * series where A = a1<br>**filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. + * @param rollupby Dimension name(s) to rollup results by. For example if you only want to see metric values with a + * filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can + * specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws AdditionalInfoErrorResponseException thrown if the request is rejected by server. + * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the metrics result for a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) public MetricResultsResponse batch(String subscriptionId, String metricnamespace, List metricnames, - ResourceIdList resourceIds, String starttime, String endtime, Duration interval, String aggregation, - Integer top, String orderBy, String filter) { - return batchWithResponse(subscriptionId, metricnamespace, metricnames, resourceIds, starttime, endtime, - interval, aggregation, top, orderBy, filter, Context.NONE).getValue(); + ResourceIdList batchRequest, String starttime, String endtime, Duration interval, String aggregation, + Integer top, String orderBy, String filter, String rollupby) { + return batchWithResponse(subscriptionId, metricnamespace, metricnames, batchRequest, starttime, endtime, + interval, aggregation, top, orderBy, filter, rollupby, Context.NONE).getValue(); } } diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/AdditionalInfoErrorResponse.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/AdditionalInfoErrorResponse.java deleted file mode 100644 index 46bcf865b2ef5..0000000000000 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/AdditionalInfoErrorResponse.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.monitor.query.implementation.metricsbatch.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The response to a metrics query that results in a bad request, with optional additional information. - */ -@Immutable -public final class AdditionalInfoErrorResponse { - /* - * Top level error object that contains all relevant information. - */ - @JsonProperty(value = "error", required = true) - private AdditionalInfoErrorResponseError error; - - /** - * Creates an instance of AdditionalInfoErrorResponse class. - * - * @param error the error value to set. - */ - @JsonCreator - public AdditionalInfoErrorResponse( - @JsonProperty(value = "error", required = true) AdditionalInfoErrorResponseError error) { - this.error = error; - } - - /** - * Get the error property: Top level error object that contains all relevant information. - * - * @return the error value. - */ - public AdditionalInfoErrorResponseError getError() { - return this.error; - } -} diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/AdditionalInfoErrorResponseError.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/AdditionalInfoErrorResponseError.java deleted file mode 100644 index c57ced759000f..0000000000000 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/AdditionalInfoErrorResponseError.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.monitor.query.implementation.metricsbatch.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Top level error object that contains all relevant information. - */ -@Fluent -public final class AdditionalInfoErrorResponseError { - /* - * Additional information about the error - */ - @JsonProperty(value = "additionalInfo") - private List additionalInfo; - - /* - * Error code - */ - @JsonProperty(value = "code", required = true) - private String code; - - /* - * Error message indicating why the operation failed. - */ - @JsonProperty(value = "message", required = true) - private String message; - - /** - * Creates an instance of AdditionalInfoErrorResponseError class. - * - * @param code the code value to set. - * @param message the message value to set. - */ - @JsonCreator - public AdditionalInfoErrorResponseError(@JsonProperty(value = "code", required = true) String code, - @JsonProperty(value = "message", required = true) String message) { - this.code = code; - this.message = message; - } - - /** - * Get the additionalInfo property: Additional information about the error. - * - * @return the additionalInfo value. - */ - public List getAdditionalInfo() { - return this.additionalInfo; - } - - /** - * Set the additionalInfo property: Additional information about the error. - * - * @param additionalInfo the additionalInfo value to set. - * @return the AdditionalInfoErrorResponseError object itself. - */ - public AdditionalInfoErrorResponseError - setAdditionalInfo(List additionalInfo) { - this.additionalInfo = additionalInfo; - return this; - } - - /** - * Get the code property: Error code. - * - * @return the code value. - */ - public String getCode() { - return this.code; - } - - /** - * Get the message property: Error message indicating why the operation failed. - * - * @return the message value. - */ - public String getMessage() { - return this.message; - } -} diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/AdditionalInfoErrorResponseErrorAdditionalInfoItem.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/AdditionalInfoErrorResponseErrorAdditionalInfoItem.java deleted file mode 100644 index 8ee700fb2390f..0000000000000 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/AdditionalInfoErrorResponseErrorAdditionalInfoItem.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.monitor.query.implementation.metricsbatch.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The AdditionalInfoErrorResponseErrorAdditionalInfoItem model. - */ -@Fluent -public final class AdditionalInfoErrorResponseErrorAdditionalInfoItem { - /* - * The type of the info property (e.g. string). - */ - @JsonProperty(value = "type") - private String type; - - /* - * Additional information related to the error. - */ - @JsonProperty(value = "info") - private String info; - - /** - * Creates an instance of AdditionalInfoErrorResponseErrorAdditionalInfoItem class. - */ - public AdditionalInfoErrorResponseErrorAdditionalInfoItem() { - } - - /** - * Get the type property: The type of the info property (e.g. string). - * - * @return the type value. - */ - public String getType() { - return this.type; - } - - /** - * Set the type property: The type of the info property (e.g. string). - * - * @param type the type value to set. - * @return the AdditionalInfoErrorResponseErrorAdditionalInfoItem object itself. - */ - public AdditionalInfoErrorResponseErrorAdditionalInfoItem setType(String type) { - this.type = type; - return this; - } - - /** - * Get the info property: Additional information related to the error. - * - * @return the info value. - */ - public String getInfo() { - return this.info; - } - - /** - * Set the info property: Additional information related to the error. - * - * @param info the info value to set. - * @return the AdditionalInfoErrorResponseErrorAdditionalInfoItem object itself. - */ - public AdditionalInfoErrorResponseErrorAdditionalInfoItem setInfo(String info) { - this.info = info; - return this; - } -} diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/ErrorAdditionalInfo.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/ErrorAdditionalInfo.java new file mode 100644 index 0000000000000..620a7435209ae --- /dev/null +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/ErrorAdditionalInfo.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.monitor.query.implementation.metricsbatch.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource management error additional info. + */ +@Immutable +public final class ErrorAdditionalInfo { + /* + * The additional info type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The additional info. + */ + @JsonProperty(value = "info", access = JsonProperty.Access.WRITE_ONLY) + private Object info; + + /** + * Creates an instance of ErrorAdditionalInfo class. + */ + public ErrorAdditionalInfo() { + } + + /** + * Get the type property: The additional info type. + * + * @return the type value. + */ + public String getType() { + return this.type; + } + + /** + * Get the info property: The additional info. + * + * @return the info value. + */ + public Object getInfo() { + return this.info; + } +} diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/ErrorDetail.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/ErrorDetail.java new file mode 100644 index 0000000000000..8019cc8b910f2 --- /dev/null +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/ErrorDetail.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.monitor.query.implementation.metricsbatch.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The error detail. + */ +@Immutable +public final class ErrorDetail { + /* + * The error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * The error message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * The error target. + */ + @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /* + * The error details. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /* + * The error additional info. + */ + @JsonProperty(value = "additionalInfo", access = JsonProperty.Access.WRITE_ONLY) + private List additionalInfo; + + /** + * Creates an instance of ErrorDetail class. + */ + public ErrorDetail() { + } + + /** + * Get the code property: The error code. + * + * @return the code value. + */ + public String getCode() { + return this.code; + } + + /** + * Get the message property: The error message. + * + * @return the message value. + */ + public String getMessage() { + return this.message; + } + + /** + * Get the target property: The error target. + * + * @return the target value. + */ + public String getTarget() { + return this.target; + } + + /** + * Get the details property: The error details. + * + * @return the details value. + */ + public List getDetails() { + return this.details; + } + + /** + * Get the additionalInfo property: The error additional info. + * + * @return the additionalInfo value. + */ + public List getAdditionalInfo() { + return this.additionalInfo; + } +} diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/ErrorResponse.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/ErrorResponse.java new file mode 100644 index 0000000000000..c9d4fd4924f94 --- /dev/null +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/ErrorResponse.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.monitor.query.implementation.metricsbatch.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error response + * + * Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also + * follows the OData error response format.). + */ +@Fluent +public final class ErrorResponse { + /* + * The error object. + */ + @JsonProperty(value = "error") + private ErrorDetail error; + + /** + * Creates an instance of ErrorResponse class. + */ + public ErrorResponse() { + } + + /** + * Get the error property: The error object. + * + * @return the error value. + */ + public ErrorDetail getError() { + return this.error; + } + + /** + * Set the error property: The error object. + * + * @param error the error value to set. + * @return the ErrorResponse object itself. + */ + public ErrorResponse setError(ErrorDetail error) { + this.error = error; + return this; + } +} diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/AdditionalInfoErrorResponseException.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/ErrorResponseException.java similarity index 55% rename from sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/AdditionalInfoErrorResponseException.java rename to sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/ErrorResponseException.java index 1a3a7975b72f9..c9bac001a4e46 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/AdditionalInfoErrorResponseException.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/ErrorResponseException.java @@ -8,28 +8,27 @@ import com.azure.core.http.HttpResponse; /** - * Exception thrown for an invalid response with AdditionalInfoErrorResponse information. + * Exception thrown for an invalid response with ErrorResponse information. */ -public final class AdditionalInfoErrorResponseException extends HttpResponseException { +public final class ErrorResponseException extends HttpResponseException { /** - * Initializes a new instance of the AdditionalInfoErrorResponseException class. + * Initializes a new instance of the ErrorResponseException class. * * @param message the exception message or the response content if a message is not available. * @param response the HTTP response. */ - public AdditionalInfoErrorResponseException(String message, HttpResponse response) { + public ErrorResponseException(String message, HttpResponse response) { super(message, response); } /** - * Initializes a new instance of the AdditionalInfoErrorResponseException class. + * Initializes a new instance of the ErrorResponseException 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 AdditionalInfoErrorResponseException(String message, HttpResponse response, - AdditionalInfoErrorResponse value) { + public ErrorResponseException(String message, HttpResponse response, ErrorResponse value) { super(message, response, value); } @@ -37,7 +36,7 @@ public AdditionalInfoErrorResponseException(String message, HttpResponse respons * {@inheritDoc} */ @Override - public AdditionalInfoErrorResponse getValue() { - return (AdditionalInfoErrorResponse) super.getValue(); + public ErrorResponse getValue() { + return (ErrorResponse) super.getValue(); } } diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/Metric.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/Metric.java index 4472f20132677..c2c30abc84c40 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/Metric.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/Metric.java @@ -15,19 +15,19 @@ @Fluent public final class Metric { /* - * the metric Id. + * The metric Id. */ @JsonProperty(value = "id", required = true) private String id; /* - * the resource type of the metric resource. + * The resource type of the metric resource. */ @JsonProperty(value = "type", required = true) private String type; /* - * the name and the display name of the metric, i.e. it is localizable string. + * The name and the display name of the metric, i.e. it is localizable string. */ @JsonProperty(value = "name", required = true) private LocalizableString name; @@ -57,7 +57,7 @@ public final class Metric { private MetricUnit unit; /* - * the time series returned when a data query is performed. + * The time series returned when a data query is performed. */ @JsonProperty(value = "timeseries", required = true) private List timeseries; @@ -85,7 +85,7 @@ public Metric(@JsonProperty(value = "id", required = true) String id, } /** - * Get the id property: the metric Id. + * Get the id property: The metric Id. * * @return the id value. */ @@ -94,7 +94,7 @@ public String getId() { } /** - * Get the type property: the resource type of the metric resource. + * Get the type property: The resource type of the metric resource. * * @return the type value. */ @@ -103,7 +103,7 @@ public String getType() { } /** - * Get the name property: the name and the display name of the metric, i.e. it is localizable string. + * Get the name property: The name and the display name of the metric, i.e. it is localizable string. * * @return the name value. */ @@ -181,7 +181,7 @@ public MetricUnit getUnit() { } /** - * Get the timeseries property: the time series returned when a data query is performed. + * Get the timeseries property: The time series returned when a data query is performed. * * @return the timeseries value. */ diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/MetricResultsResponseValuesItem.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/MetricResultsResponseValuesItem.java index f46ebedf2bc89..86c68f456510d 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/MetricResultsResponseValuesItem.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/MetricResultsResponseValuesItem.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.Duration; import java.util.List; /** @@ -28,12 +27,13 @@ public final class MetricResultsResponseValuesItem { private String endtime; /* - * The interval (window size) for which the metric data was returned in. Follows the IS8601/RFC3339 duration format - * (e.g. 'P1D' for 1 day). This may be adjusted in the future and returned back from what was originally requested. - * This is not present if a metadata request was made. + * The interval (window size) for which the metric data was returned in ISO 8601 duration format with a special + * case for 'FULL' value that returns single datapoint for entire time span requested (*Examples: PT15M, PT1H, P1D, + * FULL*). + * This may be adjusted and different from what was originally requested if AutoAdjustTimegrain=true is specified. */ @JsonProperty(value = "interval") - private Duration interval; + private String interval; /* * The namespace of the metrics been queried @@ -94,25 +94,27 @@ public String getEndtime() { } /** - * Get the interval property: The interval (window size) for which the metric data was returned in. Follows the - * IS8601/RFC3339 duration format (e.g. 'P1D' for 1 day). This may be adjusted in the future and returned back from - * what was originally requested. This is not present if a metadata request was made. + * Get the interval property: The interval (window size) for which the metric data was returned in ISO 8601 + * duration format with a special case for 'FULL' value that returns single datapoint for entire time span + * requested (*Examples: PT15M, PT1H, P1D, FULL*). + * This may be adjusted and different from what was originally requested if AutoAdjustTimegrain=true is specified. * * @return the interval value. */ - public Duration getInterval() { + public String getInterval() { return this.interval; } /** - * Set the interval property: The interval (window size) for which the metric data was returned in. Follows the - * IS8601/RFC3339 duration format (e.g. 'P1D' for 1 day). This may be adjusted in the future and returned back from - * what was originally requested. This is not present if a metadata request was made. + * Set the interval property: The interval (window size) for which the metric data was returned in ISO 8601 + * duration format with a special case for 'FULL' value that returns single datapoint for entire time span + * requested (*Examples: PT15M, PT1H, P1D, FULL*). + * This may be adjusted and different from what was originally requested if AutoAdjustTimegrain=true is specified. * * @param interval the interval value to set. * @return the MetricResultsResponseValuesItem object itself. */ - public MetricResultsResponseValuesItem setInterval(Duration interval) { + public MetricResultsResponseValuesItem setInterval(String interval) { this.interval = interval; return this; } diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/MetricUnit.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/MetricUnit.java index ead67897d6489..5d58242b7d679 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/MetricUnit.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/MetricUnit.java @@ -13,67 +13,68 @@ */ public final class MetricUnit extends ExpandableStringEnum { /** - * Static value Count for MetricUnit. + * Unit of raw quantity. */ public static final MetricUnit COUNT = fromString("Count"); /** - * Static value Bytes for MetricUnit. + * Unit of memory in bytes. */ public static final MetricUnit BYTES = fromString("Bytes"); /** - * Static value Seconds for MetricUnit. + * Unit of time in seconds. */ public static final MetricUnit SECONDS = fromString("Seconds"); /** - * Static value CountPerSecond for MetricUnit. + * Rate unit of raw quantity per second. */ public static final MetricUnit COUNT_PER_SECOND = fromString("CountPerSecond"); /** - * Static value BytesPerSecond for MetricUnit. + * Rate unit of memory in bytes per second. */ public static final MetricUnit BYTES_PER_SECOND = fromString("BytesPerSecond"); /** - * Static value Percent for MetricUnit. + * Percentage unit. */ public static final MetricUnit PERCENT = fromString("Percent"); /** - * Static value MilliSeconds for MetricUnit. + * Unit of time in 1/1000th of a second. */ public static final MetricUnit MILLI_SECONDS = fromString("MilliSeconds"); /** - * Static value ByteSeconds for MetricUnit. + * Unit of data transfer or storage. It is the size of the data in bytes multiplied by the time it takes to transfer + * or store the data in seconds. */ public static final MetricUnit BYTE_SECONDS = fromString("ByteSeconds"); /** - * Static value Unspecified for MetricUnit. + * No specified unit. */ public static final MetricUnit UNSPECIFIED = fromString("Unspecified"); /** - * Static value Cores for MetricUnit. + * Unit of processing power. */ public static final MetricUnit CORES = fromString("Cores"); /** - * Static value MilliCores for MetricUnit. + * Unit of processing power in 1/1000th of a CPU core. */ public static final MetricUnit MILLI_CORES = fromString("MilliCores"); /** - * Static value NanoCores for MetricUnit. + * Unit of processing power in one billionth of a CPU core. */ public static final MetricUnit NANO_CORES = fromString("NanoCores"); /** - * Static value BitsPerSecond for MetricUnit. + * Rate unit of binary digits per second. */ public static final MetricUnit BITS_PER_SECOND = fromString("BitsPerSecond"); diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/TimeSeriesElement.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/TimeSeriesElement.java index becd31d59a11b..ba1c1c52f13ec 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/TimeSeriesElement.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/models/TimeSeriesElement.java @@ -14,7 +14,7 @@ @Fluent public final class TimeSeriesElement { /* - * the metadata values returned if $filter was specified in the call. + * The metadata values returned if $filter was specified in the call. */ @JsonProperty(value = "metadatavalues") private List metadatavalues; @@ -33,7 +33,7 @@ public TimeSeriesElement() { } /** - * Get the metadatavalues property: the metadata values returned if $filter was specified in the call. + * Get the metadatavalues property: The metadata values returned if $filter was specified in the call. * * @return the metadatavalues value. */ @@ -42,7 +42,7 @@ public List getMetadatavalues() { } /** - * Set the metadatavalues property: the metadata values returned if $filter was specified in the call. + * Set the metadatavalues property: The metadata values returned if $filter was specified in the call. * * @param metadatavalues the metadatavalues value to set. * @return the TimeSeriesElement object itself. diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/MetricDefinitionsImpl.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/MetricDefinitionsImpl.java index 02f92573777a1..335a4bf1547a1 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/MetricDefinitionsImpl.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/MetricDefinitionsImpl.java @@ -23,9 +23,12 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.monitor.query.implementation.metricsdefinitions.models.ErrorContractException; import com.azure.monitor.query.implementation.metricsdefinitions.models.ErrorResponseException; import com.azure.monitor.query.implementation.metricsdefinitions.models.MetricDefinition; import com.azure.monitor.query.implementation.metricsdefinitions.models.MetricDefinitionCollection; +import com.azure.monitor.query.implementation.metricsdefinitions.models.SubscriptionScopeMetricDefinition; +import com.azure.monitor.query.implementation.metricsdefinitions.models.SubscriptionScopeMetricDefinitionCollection; import reactor.core.publisher.Mono; /** @@ -54,12 +57,30 @@ public final class MetricDefinitionsImpl { } /** - * The interface defining all the services for MonitorManagementClientMetricDefinitions to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for AzureMonitorMetricsDefinitionsAPIMetricDefinitions to be used by the + * proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "MonitorManagementCli") + @ServiceInterface(name = "AzureMonitorMetricsD") public interface MetricDefinitionsService { + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metricDefinitions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ErrorContractException.class) + Mono> listAtSubscriptionScope( + @HostParam("$host") String host, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @QueryParam("region") String region, + @QueryParam("metricnamespace") String metricnamespace, @HeaderParam("Accept") String accept, + Context context); + + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metricDefinitions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ErrorContractException.class) + Response listAtSubscriptionScopeSync( + @HostParam("$host") String host, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @QueryParam("region") String region, + @QueryParam("metricnamespace") String metricnamespace, @HeaderParam("Accept") String accept, + Context context); + @Get("/{resourceUri}/providers/Microsoft.Insights/metricDefinitions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ErrorResponseException.class) @@ -77,11 +98,165 @@ Response listSync(@HostParam("$host") String host, @HeaderParam("Accept") String accept, Context context); } + /** + * Lists the metric definitions for the subscription. + * + * @param region The region where the metrics you want reside. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorContractException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents collection of metric definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listAtSubscriptionScopeSinglePageAsync(String region, + String metricnamespace) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listAtSubscriptionScope(this.client.getHost(), + this.client.getSubscriptionId(), this.client.getApiVersion(), region, metricnamespace, accept, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getValue(), null, null)); + } + + /** + * Lists the metric definitions for the subscription. + * + * @param region The region where the metrics you want reside. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorContractException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents collection of metric definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listAtSubscriptionScopeSinglePageAsync(String region, + String metricnamespace, Context context) { + final String accept = "application/json"; + return service + .listAtSubscriptionScope(this.client.getHost(), this.client.getSubscriptionId(), + this.client.getApiVersion(), region, metricnamespace, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getValue(), null, null)); + } + + /** + * Lists the metric definitions for the subscription. + * + * @param region The region where the metrics you want reside. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorContractException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents collection of metric definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAtSubscriptionScopeAsync(String region, + String metricnamespace) { + return new PagedFlux<>(() -> listAtSubscriptionScopeSinglePageAsync(region, metricnamespace)); + } + + /** + * Lists the metric definitions for the subscription. + * + * @param region The region where the metrics you want reside. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorContractException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents collection of metric definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAtSubscriptionScopeAsync(String region, + String metricnamespace, Context context) { + return new PagedFlux<>(() -> listAtSubscriptionScopeSinglePageAsync(region, metricnamespace, context)); + } + + /** + * Lists the metric definitions for the subscription. + * + * @param region The region where the metrics you want reside. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorContractException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents collection of metric definitions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PagedResponse listAtSubscriptionScopeSinglePage(String region, + String metricnamespace) { + final String accept = "application/json"; + Response res + = service.listAtSubscriptionScopeSync(this.client.getHost(), this.client.getSubscriptionId(), + this.client.getApiVersion(), region, metricnamespace, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getValue(), null, null); + } + + /** + * Lists the metric definitions for the subscription. + * + * @param region The region where the metrics you want reside. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorContractException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents collection of metric definitions along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PagedResponse listAtSubscriptionScopeSinglePage(String region, + String metricnamespace, Context context) { + final String accept = "application/json"; + Response res + = service.listAtSubscriptionScopeSync(this.client.getHost(), this.client.getSubscriptionId(), + this.client.getApiVersion(), region, metricnamespace, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getValue(), null, null); + } + + /** + * Lists the metric definitions for the subscription. + * + * @param region The region where the metrics you want reside. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorContractException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents collection of metric definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAtSubscriptionScope(String region, + String metricnamespace) { + return new PagedIterable<>(() -> listAtSubscriptionScopeSinglePage(region, metricnamespace, Context.NONE)); + } + + /** + * Lists the metric definitions for the subscription. + * + * @param region The region where the metrics you want reside. + * @param metricnamespace Metric namespace where the metrics you want reside. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorContractException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents collection of metric definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAtSubscriptionScope(String region, + String metricnamespace, Context context) { + return new PagedIterable<>(() -> listAtSubscriptionScopeSinglePage(region, metricnamespace, context)); + } + /** * Lists the metric definitions for the resource. * * @param resourceUri The identifier of the resource. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace where the metrics you want reside. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -102,7 +277,7 @@ public Mono> listSinglePageAsync(String resource * Lists the metric definitions for the resource. * * @param resourceUri The identifier of the resource. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace where the metrics you want reside. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. @@ -124,7 +299,7 @@ public Mono> listSinglePageAsync(String resource * Lists the metric definitions for the resource. * * @param resourceUri The identifier of the resource. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace where the metrics you want reside. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -139,7 +314,7 @@ public PagedFlux listAsync(String resourceUri, String metricna * Lists the metric definitions for the resource. * * @param resourceUri The identifier of the resource. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace where the metrics you want reside. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. @@ -155,7 +330,7 @@ public PagedFlux listAsync(String resourceUri, String metricna * Lists the metric definitions for the resource. * * @param resourceUri The identifier of the resource. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace where the metrics you want reside. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -174,7 +349,7 @@ public PagedResponse listSinglePage(String resourceUri, String * Lists the metric definitions for the resource. * * @param resourceUri The identifier of the resource. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace where the metrics you want reside. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. @@ -194,7 +369,7 @@ public PagedResponse listSinglePage(String resourceUri, String * Lists the metric definitions for the resource. * * @param resourceUri The identifier of the resource. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace where the metrics you want reside. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -209,7 +384,7 @@ public PagedIterable list(String resourceUri, String metricnam * Lists the metric definitions for the resource. * * @param resourceUri The identifier of the resource. - * @param metricnamespace Metric namespace to query metric definitions for. + * @param metricnamespace Metric namespace where the metrics you want reside. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/MetricsDefinitionsClientImpl.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/MetricsDefinitionsClientImpl.java index 496d6f7db5524..6c537e0f058ae 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/MetricsDefinitionsClientImpl.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/MetricsDefinitionsClientImpl.java @@ -12,9 +12,23 @@ import com.azure.core.util.serializer.SerializerAdapter; /** - * Initializes a new instance of the MonitorManagementClient type. + * Initializes a new instance of the AzureMonitorMetricsDefinitionsAPI type. */ public final class MetricsDefinitionsClientImpl { + /** + * The ID of the target subscription. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + /** * server parameter. */ @@ -86,39 +100,43 @@ public MetricDefinitionsImpl getMetricDefinitions() { } /** - * Initializes an instance of MonitorManagementClient client. + * Initializes an instance of AzureMonitorMetricsDefinitionsAPI client. * + * @param subscriptionId The ID of the target subscription. * @param host server parameter. * @param apiVersion Api Version. */ - MetricsDefinitionsClientImpl(String host, String apiVersion) { + MetricsDefinitionsClientImpl(String subscriptionId, String host, String apiVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), host, apiVersion); + JacksonAdapter.createDefaultSerializerAdapter(), subscriptionId, host, apiVersion); } /** - * Initializes an instance of MonitorManagementClient client. + * Initializes an instance of AzureMonitorMetricsDefinitionsAPI client. * * @param httpPipeline The HTTP pipeline to send requests through. + * @param subscriptionId The ID of the target subscription. * @param host server parameter. * @param apiVersion Api Version. */ - MetricsDefinitionsClientImpl(HttpPipeline httpPipeline, String host, String apiVersion) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), host, apiVersion); + MetricsDefinitionsClientImpl(HttpPipeline httpPipeline, String subscriptionId, String host, String apiVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), subscriptionId, host, apiVersion); } /** - * Initializes an instance of MonitorManagementClient client. + * Initializes an instance of AzureMonitorMetricsDefinitionsAPI client. * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. + * @param subscriptionId The ID of the target subscription. * @param host server parameter. * @param apiVersion Api Version. */ - MetricsDefinitionsClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String host, - String apiVersion) { + MetricsDefinitionsClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String subscriptionId, + String host, String apiVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; + this.subscriptionId = subscriptionId; this.host = host; this.apiVersion = apiVersion; this.metricDefinitions = new MetricDefinitionsImpl(this); diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/MetricsDefinitionsClientImplBuilder.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/MetricsDefinitionsClientImplBuilder.java index 075e5f4ca1e6c..39d006ce111db 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/MetricsDefinitionsClientImplBuilder.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/MetricsDefinitionsClientImplBuilder.java @@ -40,7 +40,7 @@ import java.util.Objects; /** - * A builder for creating a new instance of the MonitorManagementClient type. + * A builder for creating a new instance of the AzureMonitorMetricsDefinitionsAPI type. */ @ServiceClientBuilder(serviceClients = { MetricsDefinitionsClientImpl.class }) public final class MetricsDefinitionsClientImplBuilder implements HttpTrait, @@ -58,7 +58,7 @@ public final class MetricsDefinitionsClientImplBuilder implements HttpTrait pipelinePolicies; /** - * Create an instance of the MonitorManagementClientBuilder. + * Create an instance of the AzureMonitorMetricsDefinitionsAPIBuilder. */ @Generated public MetricsDefinitionsClientImplBuilder() { @@ -188,6 +188,24 @@ public MetricsDefinitionsClientImplBuilder credential(TokenCredential tokenCrede return this; } + /* + * The ID of the target subscription. + */ + @Generated + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the AzureMonitorMetricsDefinitionsAPIBuilder. + */ + @Generated + public MetricsDefinitionsClientImplBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + /* * server parameter */ @@ -198,7 +216,7 @@ public MetricsDefinitionsClientImplBuilder credential(TokenCredential tokenCrede * Sets server parameter. * * @param host the host value. - * @return the MonitorManagementClientBuilder. + * @return the AzureMonitorMetricsDefinitionsAPIBuilder. */ @Generated public MetricsDefinitionsClientImplBuilder host(String host) { @@ -216,7 +234,7 @@ public MetricsDefinitionsClientImplBuilder host(String host) { * Sets Api Version. * * @param apiVersion the apiVersion value. - * @return the MonitorManagementClientBuilder. + * @return the AzureMonitorMetricsDefinitionsAPIBuilder. */ @Generated public MetricsDefinitionsClientImplBuilder apiVersion(String apiVersion) { @@ -234,7 +252,7 @@ public MetricsDefinitionsClientImplBuilder apiVersion(String apiVersion) { * Sets The serializer to serialize an object into a string. * * @param serializerAdapter the serializerAdapter value. - * @return the MonitorManagementClientBuilder. + * @return the AzureMonitorMetricsDefinitionsAPIBuilder. */ @Generated public MetricsDefinitionsClientImplBuilder serializerAdapter(SerializerAdapter serializerAdapter) { @@ -252,7 +270,7 @@ public MetricsDefinitionsClientImplBuilder serializerAdapter(SerializerAdapter s * Sets The retry policy that will attempt to retry failed requests, if applicable. * * @param retryPolicy the retryPolicy value. - * @return the MonitorManagementClientBuilder. + * @return the AzureMonitorMetricsDefinitionsAPIBuilder. */ @Generated public MetricsDefinitionsClientImplBuilder retryPolicy(RetryPolicy retryPolicy) { @@ -261,19 +279,19 @@ public MetricsDefinitionsClientImplBuilder retryPolicy(RetryPolicy retryPolicy) } /** - * Builds an instance of MonitorManagementClient with the provided parameters. + * Builds an instance of AzureMonitorMetricsDefinitionsAPI with the provided parameters. * - * @return an instance of MonitorManagementClient. + * @return an instance of AzureMonitorMetricsDefinitionsAPI. */ @Generated public MetricsDefinitionsClientImpl buildClient() { HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); String localHost = (host != null) ? host : "https://management.azure.com"; - String localApiVersion = (apiVersion != null) ? apiVersion : "2018-01-01"; + String localApiVersion = (apiVersion != null) ? apiVersion : "2024-02-01"; SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter : JacksonAdapter.createDefaultSerializerAdapter(); - MetricsDefinitionsClientImpl client - = new MetricsDefinitionsClientImpl(localPipeline, localSerializerAdapter, localHost, localApiVersion); + MetricsDefinitionsClientImpl client = new MetricsDefinitionsClientImpl(localPipeline, localSerializerAdapter, + this.subscriptionId, localHost, localApiVersion); return client; } @@ -308,7 +326,7 @@ private HttpPipeline createHttpPipeline() { this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) .forEach(p -> policies.add(p)); HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); + policies.add(new HttpLoggingPolicy(localHttpLogOptions)); HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(httpClient).clientOptions(localClientOptions).build(); return httpPipeline; diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/AggregationType.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/AggregationType.java index 1e5818c577868..2e86fead7678c 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/AggregationType.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/AggregationType.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue; /** - * the aggregation type of the metric. + * The aggregation type of the metric. */ public enum AggregationType { /** diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/ErrorAdditionalInfo.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/ErrorAdditionalInfo.java new file mode 100644 index 0000000000000..9f6ba2c8c962f --- /dev/null +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/ErrorAdditionalInfo.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.monitor.query.implementation.metricsdefinitions.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource management error additional info. + */ +@Immutable +public final class ErrorAdditionalInfo { + /* + * The additional info type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The additional info. + */ + @JsonProperty(value = "info", access = JsonProperty.Access.WRITE_ONLY) + private Object info; + + /** + * Creates an instance of ErrorAdditionalInfo class. + */ + public ErrorAdditionalInfo() { + } + + /** + * Get the type property: The additional info type. + * + * @return the type value. + */ + public String getType() { + return this.type; + } + + /** + * Get the info property: The additional info. + * + * @return the info value. + */ + public Object getInfo() { + return this.info; + } +} diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/ErrorContract.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/ErrorContract.java new file mode 100644 index 0000000000000..d9d8f73ab79ca --- /dev/null +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/ErrorContract.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.monitor.query.implementation.metricsdefinitions.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error Response + * + * Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also + * follows the OData error response format.). + */ +@Fluent +public final class ErrorContract { + /* + * Error Response + * + * The error object. + */ + @JsonProperty(value = "error") + private ErrorResponse error; + + /** + * Creates an instance of ErrorContract class. + */ + public ErrorContract() { + } + + /** + * Get the error property: Error Response + * + * The error object. + * + * @return the error value. + */ + public ErrorResponse getError() { + return this.error; + } + + /** + * Set the error property: Error Response + * + * The error object. + * + * @param error the error value to set. + * @return the ErrorContract object itself. + */ + public ErrorContract setError(ErrorResponse error) { + this.error = error; + return this; + } +} diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/ErrorContractException.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/ErrorContractException.java new file mode 100644 index 0000000000000..dcd035b844294 --- /dev/null +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/ErrorContractException.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.monitor.query.implementation.metricsdefinitions.models; + +import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.HttpResponse; + +/** + * Exception thrown for an invalid response with ErrorContract information. + */ +public final class ErrorContractException extends HttpResponseException { + /** + * Initializes a new instance of the ErrorContractException class. + * + * @param message the exception message or the response content if a message is not available. + * @param response the HTTP response. + */ + public ErrorContractException(String message, HttpResponse response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorContractException 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 ErrorContractException(String message, HttpResponse response, ErrorContract value) { + super(message, response, value); + } + + /** + * {@inheritDoc} + */ + @Override + public ErrorContract getValue() { + return (ErrorContract) super.getValue(); + } +} diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/ErrorResponse.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/ErrorResponse.java index 929e91c4b5624..75bc7e57022b1 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/ErrorResponse.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/ErrorResponse.java @@ -4,26 +4,48 @@ package com.azure.monitor.query.implementation.metricsdefinitions.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; /** - * Describes the format of Error response. + * Error Response + * + * Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also + * follows the OData error response format.). */ -@Fluent +@Immutable public final class ErrorResponse { /* - * Error code + * The error code. */ - @JsonProperty(value = "code") + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) private String code; /* - * Error message indicating why the operation failed. + * The error message. */ - @JsonProperty(value = "message") + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) private String message; + /* + * The error target. + */ + @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /* + * The error details. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /* + * The error additional info. + */ + @JsonProperty(value = "additionalInfo", access = JsonProperty.Access.WRITE_ONLY) + private List additionalInfo; + /** * Creates an instance of ErrorResponse class. */ @@ -31,7 +53,7 @@ public ErrorResponse() { } /** - * Get the code property: Error code. + * Get the code property: The error code. * * @return the code value. */ @@ -40,33 +62,38 @@ public String getCode() { } /** - * Set the code property: Error code. + * Get the message property: The error message. + * + * @return the message value. + */ + public String getMessage() { + return this.message; + } + + /** + * Get the target property: The error target. * - * @param code the code value to set. - * @return the ErrorResponse object itself. + * @return the target value. */ - public ErrorResponse setCode(String code) { - this.code = code; - return this; + public String getTarget() { + return this.target; } /** - * Get the message property: Error message indicating why the operation failed. + * Get the details property: The error details. * - * @return the message value. + * @return the details value. */ - public String getMessage() { - return this.message; + public List getDetails() { + return this.details; } /** - * Set the message property: Error message indicating why the operation failed. + * Get the additionalInfo property: The error additional info. * - * @param message the message value to set. - * @return the ErrorResponse object itself. + * @return the additionalInfo value. */ - public ErrorResponse setMessage(String message) { - this.message = message; - return this; + public List getAdditionalInfo() { + return this.additionalInfo; } } diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/MetricAggregationType.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/MetricAggregationType.java new file mode 100644 index 0000000000000..83e35056f7dde --- /dev/null +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/MetricAggregationType.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.monitor.query.implementation.metricsdefinitions.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The aggregation type of the metric. + */ +public final class MetricAggregationType extends ExpandableStringEnum { + /** + * Static value None for MetricAggregationType. + */ + public static final MetricAggregationType NONE = fromString("None"); + + /** + * Static value Average for MetricAggregationType. + */ + public static final MetricAggregationType AVERAGE = fromString("Average"); + + /** + * Static value Count for MetricAggregationType. + */ + public static final MetricAggregationType COUNT = fromString("Count"); + + /** + * Static value Minimum for MetricAggregationType. + */ + public static final MetricAggregationType MINIMUM = fromString("Minimum"); + + /** + * Static value Maximum for MetricAggregationType. + */ + public static final MetricAggregationType MAXIMUM = fromString("Maximum"); + + /** + * Static value Total for MetricAggregationType. + */ + public static final MetricAggregationType TOTAL = fromString("Total"); + + /** + * Creates a new instance of MetricAggregationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MetricAggregationType() { + } + + /** + * Creates or finds a MetricAggregationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MetricAggregationType. + */ + @JsonCreator + public static MetricAggregationType fromString(String name) { + return fromString(name, MetricAggregationType.class); + } + + /** + * Gets known MetricAggregationType values. + * + * @return known MetricAggregationType values. + */ + public static Collection values() { + return values(MetricAggregationType.class); + } +} diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/MetricAvailability.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/MetricAvailability.java index 4fe6f0024118a..47525c2910e4c 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/MetricAvailability.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/MetricAvailability.java @@ -15,13 +15,14 @@ @Fluent public final class MetricAvailability { /* - * the time grain specifies the aggregation interval for the metric. Expressed as a duration 'PT1M', 'P1D', etc. + * The time grain specifies a supported aggregation interval for the metric. Expressed as a duration 'PT1M', 'P1D', + * etc. */ @JsonProperty(value = "timeGrain") private Duration timeGrain; /* - * the retention period for the metric at the specified timegrain. Expressed as a duration 'PT1M', 'P1D', etc. + * The retention period for the metric at the specified timegrain. Expressed as a duration 'PT1M', 'P1D', etc. */ @JsonProperty(value = "retention") private Duration retention; @@ -33,8 +34,8 @@ public MetricAvailability() { } /** - * Get the timeGrain property: the time grain specifies the aggregation interval for the metric. Expressed as a - * duration 'PT1M', 'P1D', etc. + * Get the timeGrain property: The time grain specifies a supported aggregation interval for the metric. Expressed + * as a duration 'PT1M', 'P1D', etc. * * @return the timeGrain value. */ @@ -43,8 +44,8 @@ public Duration getTimeGrain() { } /** - * Set the timeGrain property: the time grain specifies the aggregation interval for the metric. Expressed as a - * duration 'PT1M', 'P1D', etc. + * Set the timeGrain property: The time grain specifies a supported aggregation interval for the metric. Expressed + * as a duration 'PT1M', 'P1D', etc. * * @param timeGrain the timeGrain value to set. * @return the MetricAvailability object itself. @@ -55,7 +56,7 @@ public MetricAvailability setTimeGrain(Duration timeGrain) { } /** - * Get the retention property: the retention period for the metric at the specified timegrain. Expressed as a + * Get the retention property: The retention period for the metric at the specified timegrain. Expressed as a * duration 'PT1M', 'P1D', etc. * * @return the retention value. @@ -65,7 +66,7 @@ public Duration getRetention() { } /** - * Set the retention property: the retention period for the metric at the specified timegrain. Expressed as a + * Set the retention property: The retention period for the metric at the specified timegrain. Expressed as a * duration 'PT1M', 'P1D', etc. * * @param retention the retention value to set. diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/MetricDefinition.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/MetricDefinition.java index 68837e45af612..1a4bad2171f00 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/MetricDefinition.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/MetricDefinition.java @@ -20,19 +20,19 @@ public final class MetricDefinition { private Boolean isDimensionRequired; /* - * the resource identifier of the resource that emitted the metric. + * The resource identifier of the resource that emitted the metric. */ @JsonProperty(value = "resourceId") private String resourceId; /* - * the namespace the metric belongs to. + * The namespace the metric belongs to. */ @JsonProperty(value = "namespace") private String namespace; /* - * the name and the display name of the metric, i.e. it is a localizable string. + * The name and the display name of the metric, i.e. it is a localizable string. */ @JsonProperty(value = "name") private LocalizableString name; @@ -62,31 +62,31 @@ public final class MetricDefinition { private MetricUnit unit; /* - * the primary aggregation type value defining how to use the values for display. + * The primary aggregation type value defining how to use the values for display. */ @JsonProperty(value = "primaryAggregationType") private AggregationType primaryAggregationType; /* - * the collection of what aggregation types are supported. + * The collection of what aggregation types are supported. */ @JsonProperty(value = "supportedAggregationTypes") private List supportedAggregationTypes; /* - * the collection of what aggregation intervals are available to be queried. + * The collection of what aggregation intervals are available to be queried. */ @JsonProperty(value = "metricAvailabilities") private List metricAvailabilities; /* - * the resource identifier of the metric definition. + * The resource identifier of the metric definition. */ @JsonProperty(value = "id") private String id; /* - * the name and the display name of the dimension, i.e. it is a localizable string. + * The name and the display name of the dimension, i.e. it is a localizable string. */ @JsonProperty(value = "dimensions") private List dimensions; @@ -118,7 +118,7 @@ public MetricDefinition setIsDimensionRequired(Boolean isDimensionRequired) { } /** - * Get the resourceId property: the resource identifier of the resource that emitted the metric. + * Get the resourceId property: The resource identifier of the resource that emitted the metric. * * @return the resourceId value. */ @@ -127,7 +127,7 @@ public String getResourceId() { } /** - * Set the resourceId property: the resource identifier of the resource that emitted the metric. + * Set the resourceId property: The resource identifier of the resource that emitted the metric. * * @param resourceId the resourceId value to set. * @return the MetricDefinition object itself. @@ -138,7 +138,7 @@ public MetricDefinition setResourceId(String resourceId) { } /** - * Get the namespace property: the namespace the metric belongs to. + * Get the namespace property: The namespace the metric belongs to. * * @return the namespace value. */ @@ -147,7 +147,7 @@ public String getNamespace() { } /** - * Set the namespace property: the namespace the metric belongs to. + * Set the namespace property: The namespace the metric belongs to. * * @param namespace the namespace value to set. * @return the MetricDefinition object itself. @@ -158,7 +158,7 @@ public MetricDefinition setNamespace(String namespace) { } /** - * Get the name property: the name and the display name of the metric, i.e. it is a localizable string. + * Get the name property: The name and the display name of the metric, i.e. it is a localizable string. * * @return the name value. */ @@ -167,7 +167,7 @@ public LocalizableString getName() { } /** - * Set the name property: the name and the display name of the metric, i.e. it is a localizable string. + * Set the name property: The name and the display name of the metric, i.e. it is a localizable string. * * @param name the name value to set. * @return the MetricDefinition object itself. @@ -258,7 +258,7 @@ public MetricDefinition setUnit(MetricUnit unit) { } /** - * Get the primaryAggregationType property: the primary aggregation type value defining how to use the values for + * Get the primaryAggregationType property: The primary aggregation type value defining how to use the values for * display. * * @return the primaryAggregationType value. @@ -268,7 +268,7 @@ public AggregationType getPrimaryAggregationType() { } /** - * Set the primaryAggregationType property: the primary aggregation type value defining how to use the values for + * Set the primaryAggregationType property: The primary aggregation type value defining how to use the values for * display. * * @param primaryAggregationType the primaryAggregationType value to set. @@ -280,7 +280,7 @@ public MetricDefinition setPrimaryAggregationType(AggregationType primaryAggrega } /** - * Get the supportedAggregationTypes property: the collection of what aggregation types are supported. + * Get the supportedAggregationTypes property: The collection of what aggregation types are supported. * * @return the supportedAggregationTypes value. */ @@ -289,7 +289,7 @@ public List getSupportedAggregationTypes() { } /** - * Set the supportedAggregationTypes property: the collection of what aggregation types are supported. + * Set the supportedAggregationTypes property: The collection of what aggregation types are supported. * * @param supportedAggregationTypes the supportedAggregationTypes value to set. * @return the MetricDefinition object itself. @@ -300,7 +300,7 @@ public MetricDefinition setSupportedAggregationTypes(List suppo } /** - * Get the metricAvailabilities property: the collection of what aggregation intervals are available to be queried. + * Get the metricAvailabilities property: The collection of what aggregation intervals are available to be queried. * * @return the metricAvailabilities value. */ @@ -309,7 +309,7 @@ public List getMetricAvailabilities() { } /** - * Set the metricAvailabilities property: the collection of what aggregation intervals are available to be queried. + * Set the metricAvailabilities property: The collection of what aggregation intervals are available to be queried. * * @param metricAvailabilities the metricAvailabilities value to set. * @return the MetricDefinition object itself. @@ -320,7 +320,7 @@ public MetricDefinition setMetricAvailabilities(List metricA } /** - * Get the id property: the resource identifier of the metric definition. + * Get the id property: The resource identifier of the metric definition. * * @return the id value. */ @@ -329,7 +329,7 @@ public String getId() { } /** - * Set the id property: the resource identifier of the metric definition. + * Set the id property: The resource identifier of the metric definition. * * @param id the id value to set. * @return the MetricDefinition object itself. @@ -340,7 +340,7 @@ public MetricDefinition setId(String id) { } /** - * Get the dimensions property: the name and the display name of the dimension, i.e. it is a localizable string. + * Get the dimensions property: The name and the display name of the dimension, i.e. it is a localizable string. * * @return the dimensions value. */ @@ -349,7 +349,7 @@ public List getDimensions() { } /** - * Set the dimensions property: the name and the display name of the dimension, i.e. it is a localizable string. + * Set the dimensions property: The name and the display name of the dimension, i.e. it is a localizable string. * * @param dimensions the dimensions value to set. * @return the MetricDefinition object itself. diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/MetricDefinitionCollection.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/MetricDefinitionCollection.java index 1fd268298a7e2..4aaf3984bf461 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/MetricDefinitionCollection.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/MetricDefinitionCollection.java @@ -15,7 +15,7 @@ @Immutable public final class MetricDefinitionCollection { /* - * the values for the metric definitions. + * The values for the metric definitions. */ @JsonProperty(value = "value", required = true) private List value; @@ -31,7 +31,7 @@ public MetricDefinitionCollection(@JsonProperty(value = "value", required = true } /** - * Get the value property: the values for the metric definitions. + * Get the value property: The values for the metric definitions. * * @return the value value. */ diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/MetricUnit.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/MetricUnit.java index a17abb6e296e1..6058126d403dd 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/MetricUnit.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/MetricUnit.java @@ -13,67 +13,68 @@ */ public final class MetricUnit extends ExpandableStringEnum { /** - * Static value Count for MetricUnit. + * Unit of raw quantity. */ public static final MetricUnit COUNT = fromString("Count"); /** - * Static value Bytes for MetricUnit. + * Unit of memory in bytes. */ public static final MetricUnit BYTES = fromString("Bytes"); /** - * Static value Seconds for MetricUnit. + * Unit of time in seconds. */ public static final MetricUnit SECONDS = fromString("Seconds"); /** - * Static value CountPerSecond for MetricUnit. + * Rate unit of raw quantity per second. */ public static final MetricUnit COUNT_PER_SECOND = fromString("CountPerSecond"); /** - * Static value BytesPerSecond for MetricUnit. + * Rate unit of memory in bytes per second. */ public static final MetricUnit BYTES_PER_SECOND = fromString("BytesPerSecond"); /** - * Static value Percent for MetricUnit. + * Percentage unit. */ public static final MetricUnit PERCENT = fromString("Percent"); /** - * Static value MilliSeconds for MetricUnit. + * Unit of time in 1/1000th of a second. */ public static final MetricUnit MILLI_SECONDS = fromString("MilliSeconds"); /** - * Static value ByteSeconds for MetricUnit. + * Unit of data transfer or storage. It is the size of the data in bytes multiplied by the time it takes to transfer + * or store the data in seconds. */ public static final MetricUnit BYTE_SECONDS = fromString("ByteSeconds"); /** - * Static value Unspecified for MetricUnit. + * No specified unit. */ public static final MetricUnit UNSPECIFIED = fromString("Unspecified"); /** - * Static value Cores for MetricUnit. + * Unit of processing power. */ public static final MetricUnit CORES = fromString("Cores"); /** - * Static value MilliCores for MetricUnit. + * Unit of processing power in 1/1000th of a CPU core. */ public static final MetricUnit MILLI_CORES = fromString("MilliCores"); /** - * Static value NanoCores for MetricUnit. + * Unit of processing power in one billionth of a CPU core. */ public static final MetricUnit NANO_CORES = fromString("NanoCores"); /** - * Static value BitsPerSecond for MetricUnit. + * Rate unit of binary digits per second. */ public static final MetricUnit BITS_PER_SECOND = fromString("BitsPerSecond"); diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/SubscriptionScopeMetricDefinition.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/SubscriptionScopeMetricDefinition.java new file mode 100644 index 0000000000000..127fded5ca4ae --- /dev/null +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/SubscriptionScopeMetricDefinition.java @@ -0,0 +1,362 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.monitor.query.implementation.metricsdefinitions.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Metric definition class specifies the metadata for a metric. + */ +@Fluent +public final class SubscriptionScopeMetricDefinition { + /* + * Flag to indicate whether the dimension is required. + */ + @JsonProperty(value = "isDimensionRequired") + private Boolean isDimensionRequired; + + /* + * The resource identifier of the resource that emitted the metric. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * The namespace the metric belongs to. + */ + @JsonProperty(value = "namespace") + private String namespace; + + /* + * The name and the display name of the metric, i.e. it is a localizable string. + */ + @JsonProperty(value = "name") + private LocalizableString name; + + /* + * Detailed description of this metric. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /* + * Custom category name for this metric. + */ + @JsonProperty(value = "category") + private String category; + + /* + * The class of the metric. + */ + @JsonProperty(value = "metricClass") + private MetricClass metricClass; + + /* + * The unit of the metric. + */ + @JsonProperty(value = "unit") + private MetricUnit unit; + + /* + * The primary aggregation type value defining how to use the values for display. + */ + @JsonProperty(value = "primaryAggregationType") + private MetricAggregationType primaryAggregationType; + + /* + * The collection of what aggregation types are supported. + */ + @JsonProperty(value = "supportedAggregationTypes") + private List supportedAggregationTypes; + + /* + * The collection of what aggregation intervals are available to be queried. + */ + @JsonProperty(value = "metricAvailabilities") + private List metricAvailabilities; + + /* + * The resource identifier of the metric definition. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The name and the display name of the dimension, i.e. it is a localizable string. + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /** + * Creates an instance of SubscriptionScopeMetricDefinition class. + */ + public SubscriptionScopeMetricDefinition() { + } + + /** + * Get the isDimensionRequired property: Flag to indicate whether the dimension is required. + * + * @return the isDimensionRequired value. + */ + public Boolean isDimensionRequired() { + return this.isDimensionRequired; + } + + /** + * Set the isDimensionRequired property: Flag to indicate whether the dimension is required. + * + * @param isDimensionRequired the isDimensionRequired value to set. + * @return the SubscriptionScopeMetricDefinition object itself. + */ + public SubscriptionScopeMetricDefinition setIsDimensionRequired(Boolean isDimensionRequired) { + this.isDimensionRequired = isDimensionRequired; + return this; + } + + /** + * Get the resourceId property: The resource identifier of the resource that emitted the metric. + * + * @return the resourceId value. + */ + public String getResourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The resource identifier of the resource that emitted the metric. + * + * @param resourceId the resourceId value to set. + * @return the SubscriptionScopeMetricDefinition object itself. + */ + public SubscriptionScopeMetricDefinition setResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the namespace property: The namespace the metric belongs to. + * + * @return the namespace value. + */ + public String getNamespace() { + return this.namespace; + } + + /** + * Set the namespace property: The namespace the metric belongs to. + * + * @param namespace the namespace value to set. + * @return the SubscriptionScopeMetricDefinition object itself. + */ + public SubscriptionScopeMetricDefinition setNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Get the name property: The name and the display name of the metric, i.e. it is a localizable string. + * + * @return the name value. + */ + public LocalizableString getName() { + return this.name; + } + + /** + * Set the name property: The name and the display name of the metric, i.e. it is a localizable string. + * + * @param name the name value to set. + * @return the SubscriptionScopeMetricDefinition object itself. + */ + public SubscriptionScopeMetricDefinition setName(LocalizableString name) { + this.name = name; + return this; + } + + /** + * Get the displayDescription property: Detailed description of this metric. + * + * @return the displayDescription value. + */ + public String getDisplayDescription() { + return this.displayDescription; + } + + /** + * Set the displayDescription property: Detailed description of this metric. + * + * @param displayDescription the displayDescription value to set. + * @return the SubscriptionScopeMetricDefinition object itself. + */ + public SubscriptionScopeMetricDefinition setDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get the category property: Custom category name for this metric. + * + * @return the category value. + */ + public String getCategory() { + return this.category; + } + + /** + * Set the category property: Custom category name for this metric. + * + * @param category the category value to set. + * @return the SubscriptionScopeMetricDefinition object itself. + */ + public SubscriptionScopeMetricDefinition setCategory(String category) { + this.category = category; + return this; + } + + /** + * Get the metricClass property: The class of the metric. + * + * @return the metricClass value. + */ + public MetricClass getMetricClass() { + return this.metricClass; + } + + /** + * Set the metricClass property: The class of the metric. + * + * @param metricClass the metricClass value to set. + * @return the SubscriptionScopeMetricDefinition object itself. + */ + public SubscriptionScopeMetricDefinition setMetricClass(MetricClass metricClass) { + this.metricClass = metricClass; + return this; + } + + /** + * Get the unit property: The unit of the metric. + * + * @return the unit value. + */ + public MetricUnit getUnit() { + return this.unit; + } + + /** + * Set the unit property: The unit of the metric. + * + * @param unit the unit value to set. + * @return the SubscriptionScopeMetricDefinition object itself. + */ + public SubscriptionScopeMetricDefinition setUnit(MetricUnit unit) { + this.unit = unit; + return this; + } + + /** + * Get the primaryAggregationType property: The primary aggregation type value defining how to use the values for + * display. + * + * @return the primaryAggregationType value. + */ + public MetricAggregationType getPrimaryAggregationType() { + return this.primaryAggregationType; + } + + /** + * Set the primaryAggregationType property: The primary aggregation type value defining how to use the values for + * display. + * + * @param primaryAggregationType the primaryAggregationType value to set. + * @return the SubscriptionScopeMetricDefinition object itself. + */ + public SubscriptionScopeMetricDefinition setPrimaryAggregationType(MetricAggregationType primaryAggregationType) { + this.primaryAggregationType = primaryAggregationType; + return this; + } + + /** + * Get the supportedAggregationTypes property: The collection of what aggregation types are supported. + * + * @return the supportedAggregationTypes value. + */ + public List getSupportedAggregationTypes() { + return this.supportedAggregationTypes; + } + + /** + * Set the supportedAggregationTypes property: The collection of what aggregation types are supported. + * + * @param supportedAggregationTypes the supportedAggregationTypes value to set. + * @return the SubscriptionScopeMetricDefinition object itself. + */ + public SubscriptionScopeMetricDefinition + setSupportedAggregationTypes(List supportedAggregationTypes) { + this.supportedAggregationTypes = supportedAggregationTypes; + return this; + } + + /** + * Get the metricAvailabilities property: The collection of what aggregation intervals are available to be queried. + * + * @return the metricAvailabilities value. + */ + public List getMetricAvailabilities() { + return this.metricAvailabilities; + } + + /** + * Set the metricAvailabilities property: The collection of what aggregation intervals are available to be queried. + * + * @param metricAvailabilities the metricAvailabilities value to set. + * @return the SubscriptionScopeMetricDefinition object itself. + */ + public SubscriptionScopeMetricDefinition setMetricAvailabilities(List metricAvailabilities) { + this.metricAvailabilities = metricAvailabilities; + return this; + } + + /** + * Get the id property: The resource identifier of the metric definition. + * + * @return the id value. + */ + public String getId() { + return this.id; + } + + /** + * Set the id property: The resource identifier of the metric definition. + * + * @param id the id value to set. + * @return the SubscriptionScopeMetricDefinition object itself. + */ + public SubscriptionScopeMetricDefinition setId(String id) { + this.id = id; + return this; + } + + /** + * Get the dimensions property: The name and the display name of the dimension, i.e. it is a localizable string. + * + * @return the dimensions value. + */ + public List getDimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: The name and the display name of the dimension, i.e. it is a localizable string. + * + * @param dimensions the dimensions value to set. + * @return the SubscriptionScopeMetricDefinition object itself. + */ + public SubscriptionScopeMetricDefinition setDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } +} diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/SubscriptionScopeMetricDefinitionCollection.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/SubscriptionScopeMetricDefinitionCollection.java new file mode 100644 index 0000000000000..d057beb8b0a2d --- /dev/null +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/SubscriptionScopeMetricDefinitionCollection.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.monitor.query.implementation.metricsdefinitions.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Represents collection of metric definitions. + */ +@Immutable +public final class SubscriptionScopeMetricDefinitionCollection { + /* + * The values for the metric definitions. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Creates an instance of SubscriptionScopeMetricDefinitionCollection class. + * + * @param value the value value to set. + */ + @JsonCreator + public SubscriptionScopeMetricDefinitionCollection( + @JsonProperty(value = "value", required = true) List value) { + this.value = value; + } + + /** + * Get the value property: The values for the metric definitions. + * + * @return the value value. + */ + public List getValue() { + return this.value; + } +} diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/package-info.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/package-info.java index 5b0e43e7860af..0e3344ce35ff6 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/package-info.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/models/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the data models for MonitorManagementClient. - * null. + * Package containing the data models for AzureMonitorMetricsDefinitionsAPI. + * Provides APIs for getting the metric metadata for Azure resources. */ package com.azure.monitor.query.implementation.metricsdefinitions.models; diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/package-info.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/package-info.java index 9ef6e69c5faca..e33af1f7b2b46 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/package-info.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsdefinitions/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the classes for MonitorManagementClient. - * null. + * Package containing the classes for AzureMonitorMetricsDefinitionsAPI. + * Provides APIs for getting the metric metadata for Azure resources. */ package com.azure.monitor.query.implementation.metricsdefinitions; diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsnamespaces/MetricsNamespacesClientImplBuilder.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsnamespaces/MetricsNamespacesClientImplBuilder.java index 32cad800892f1..bf881c5c6cc98 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsnamespaces/MetricsNamespacesClientImplBuilder.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsnamespaces/MetricsNamespacesClientImplBuilder.java @@ -269,7 +269,7 @@ public MetricsNamespacesClientImplBuilder retryPolicy(RetryPolicy retryPolicy) { public MetricsNamespacesClientImpl buildClient() { HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); String localHost = (host != null) ? host : "https://management.azure.com"; - String localApiVersion = (apiVersion != null) ? apiVersion : "2017-12-01-preview"; + String localApiVersion = (apiVersion != null) ? apiVersion : "2024-02-01"; SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter : JacksonAdapter.createDefaultSerializerAdapter(); MetricsNamespacesClientImpl client @@ -308,7 +308,7 @@ private HttpPipeline createHttpPipeline() { this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) .forEach(p -> policies.add(p)); HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); + policies.add(new HttpLoggingPolicy(localHttpLogOptions)); HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(httpClient).clientOptions(localClientOptions).build(); return httpPipeline; diff --git a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricsBatchQueryOptions.java b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricsBatchQueryOptions.java index d3470a871eff2..108ebb5b57f38 100644 --- a/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricsBatchQueryOptions.java +++ b/sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/models/MetricsBatchQueryOptions.java @@ -20,6 +20,8 @@ public final class MetricsBatchQueryOptions { private String orderBy; private String filter; + private String rollupBy; + /** * Returns the time span for which the metrics data is queried. @@ -133,4 +135,32 @@ public MetricsBatchQueryOptions setFilter(String filter) { this.filter = filter; return this; } + + /** + * Gets the dimension name(s) to rollup results by. For example if you only want to see metric values with a + * filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can + * specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. + * + * @return the dimension name(s) to rollup results by. For example if you only want to see metric values with a + * filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can + * specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. + */ + public String getRollupBy() { + return rollupBy; + } + + /** + * Sets the dimension name(s) to rollup results by. For example if you only want to see metric values with a + * filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can + * specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. + * + * @param rollupBy the dimension name(s) to rollup results by. For example if you only want to see metric values with a + * filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can + * specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries. + * @return The updated options instance + */ + public MetricsBatchQueryOptions setRollupBy(String rollupBy) { + this.rollupBy = rollupBy; + return this; + } } diff --git a/sdk/monitor/azure-monitor-query/src/samples/java/com/azure/monitor/query/MetricsBatchQuerySample.java b/sdk/monitor/azure-monitor-query/src/samples/java/com/azure/monitor/query/MetricsBatchQuerySample.java index 4b800a15fc1cd..6ef22212bcbfc 100644 --- a/sdk/monitor/azure-monitor-query/src/samples/java/com/azure/monitor/query/MetricsBatchQuerySample.java +++ b/sdk/monitor/azure-monitor-query/src/samples/java/com/azure/monitor/query/MetricsBatchQuerySample.java @@ -21,7 +21,7 @@ public class MetricsBatchQuerySample { * @param args Unused. Arguments to the program. */ public static void main(String[] args) { - MetricsBatchQueryClient metricsBatchQueryClient = new MetricsBatchQueryClientBuilder() + MetricsClient metricsBatchQueryClient = new MetricsClientBuilder() .credential(new DefaultAzureCredentialBuilder().build()) .endpoint("https://westus2.monitoring.azure.com") .buildClient(); diff --git a/sdk/monitor/azure-monitor-query/src/samples/java/com/azure/monitor/query/ReadmeSamples.java b/sdk/monitor/azure-monitor-query/src/samples/java/com/azure/monitor/query/ReadmeSamples.java index 70c58a87cc8c5..9d2ea302797a3 100644 --- a/sdk/monitor/azure-monitor-query/src/samples/java/com/azure/monitor/query/ReadmeSamples.java +++ b/sdk/monitor/azure-monitor-query/src/samples/java/com/azure/monitor/query/ReadmeSamples.java @@ -74,14 +74,14 @@ public void createMetricsClients() { public void createMetricsBatchClients() { // BEGIN: readme-sample-createMetricsBatchQueryClient - MetricsBatchQueryClient metricsBatchQueryClient = new MetricsBatchQueryClientBuilder() + MetricsClient metricsBatchQueryClient = new MetricsClientBuilder() .credential(new DefaultAzureCredentialBuilder().build()) .endpoint("{endpoint}") .buildClient(); // END: readme-sample-createMetricsBatchQueryClient // BEGIN: readme-sample-createMetricsBatchQueryAsyncClient - MetricsBatchQueryAsyncClient metricsBatchQueryAsyncClient = new MetricsBatchQueryClientBuilder() + MetricsAsyncClient metricsAsyncClient = new MetricsClientBuilder() .credential(new DefaultAzureCredentialBuilder().build()) .endpoint("{endpoint}") .buildAsyncClient(); @@ -448,7 +448,7 @@ public void createMetricsClientWithSovereignCloud() { */ public void getMetricsBatch() { // BEGIN: readme-sample-metricsquerybatch - MetricsBatchQueryClient metricsBatchQueryClient = new MetricsBatchQueryClientBuilder() + MetricsClient metricsBatchQueryClient = new MetricsClientBuilder() .credential(new DefaultAzureCredentialBuilder().build()) .endpoint("{endpoint}") .buildClient(); diff --git a/sdk/monitor/azure-monitor-query/src/samples/java/com/azure/monitor/query/codesnippets/MetricsBatchQueryClientJavaDocCodeSnippets.java b/sdk/monitor/azure-monitor-query/src/samples/java/com/azure/monitor/query/codesnippets/MetricsBatchQueryClientJavaDocCodeSnippets.java index 5b574c42b1198..1f0d2dfc6260a 100644 --- a/sdk/monitor/azure-monitor-query/src/samples/java/com/azure/monitor/query/codesnippets/MetricsBatchQueryClientJavaDocCodeSnippets.java +++ b/sdk/monitor/azure-monitor-query/src/samples/java/com/azure/monitor/query/codesnippets/MetricsBatchQueryClientJavaDocCodeSnippets.java @@ -4,9 +4,9 @@ package com.azure.monitor.query.codesnippets; import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.monitor.query.MetricsBatchQueryAsyncClient; -import com.azure.monitor.query.MetricsBatchQueryClient; -import com.azure.monitor.query.MetricsBatchQueryClientBuilder; +import com.azure.monitor.query.MetricsAsyncClient; +import com.azure.monitor.query.MetricsClient; +import com.azure.monitor.query.MetricsClientBuilder; import com.azure.monitor.query.models.MetricResult; import com.azure.monitor.query.models.MetricsBatchQueryResult; import com.azure.monitor.query.models.MetricsQueryResult; @@ -16,15 +16,15 @@ /** * This class contains code samples for generating javadocs through doclets - * for {@link com.azure.monitor.query.MetricsBatchQueryClient} + * for {@link MetricsClient} */ public class MetricsBatchQueryClientJavaDocCodeSnippets { /** - * Generates code sample for creating a {@link MetricsBatchQueryClient}. + * Generates code sample for creating a {@link MetricsClient}. */ public void createClient() { // BEGIN: com.azure.monitor.query.MetricsBatchQueryClient.instantiation - MetricsBatchQueryClient metricsBatchQueryClient = new MetricsBatchQueryClientBuilder() + MetricsClient metricsBatchQueryClient = new MetricsClientBuilder() .endpoint("{endpoint}") .credential(new DefaultAzureCredentialBuilder().build()) .buildClient(); @@ -33,7 +33,7 @@ public void createClient() { public void createAsyncClient() { // BEGIN: com.azure.monitor.query.MetricsBatchQueryAsyncClient.instantiation - MetricsBatchQueryAsyncClient metricsBatchQueryAsyncClient = new MetricsBatchQueryClientBuilder() + MetricsAsyncClient metricsAsyncClient = new MetricsClientBuilder() .endpoint("{endpoint}") .credential(new DefaultAzureCredentialBuilder().build()) .buildAsyncClient(); @@ -41,10 +41,10 @@ public void createAsyncClient() { } /** - * Generates a code sample for using {@link MetricsBatchQueryClient#queryBatch(List, List, String)}. + * Generates a code sample for using {@link MetricsClient#queryBatch(List, List, String)}. */ public void queryBatch() { - MetricsBatchQueryClient metricsBatchQueryClient = new MetricsBatchQueryClientBuilder() + MetricsClient metricsBatchQueryClient = new MetricsClientBuilder() .endpoint("{endpoint}") .credential(new DefaultAzureCredentialBuilder().build()) .buildClient(); @@ -76,13 +76,13 @@ public void queryBatch() { } public void queryBatchAsync() { - MetricsBatchQueryAsyncClient metricsBatchQueryAsyncClient = new MetricsBatchQueryClientBuilder() + MetricsAsyncClient metricsAsyncClient = new MetricsClientBuilder() .endpoint("{endpoint}") .credential(new DefaultAzureCredentialBuilder().build()) .buildAsyncClient(); // BEGIN: com.azure.monitor.query.MetricsBatchQueryAsyncClient.queryBatch#List-List-String - metricsBatchQueryAsyncClient.queryBatch( + metricsAsyncClient.queryBatch( Arrays.asList("{resourceId1}", "{resourceId2}"), Arrays.asList("{metricId}"), "{metricNamespace}") .subscribe(metricsBatchResult -> { diff --git a/sdk/monitor/azure-monitor-query/src/test/java/com/azure/monitor/query/LogsQueryAsyncClientTest.java b/sdk/monitor/azure-monitor-query/src/test/java/com/azure/monitor/query/LogsQueryAsyncClientTest.java index 90a88324a7503..13345d836838e 100644 --- a/sdk/monitor/azure-monitor-query/src/test/java/com/azure/monitor/query/LogsQueryAsyncClientTest.java +++ b/sdk/monitor/azure-monitor-query/src/test/java/com/azure/monitor/query/LogsQueryAsyncClientTest.java @@ -11,6 +11,7 @@ import com.azure.core.http.policy.RetryStrategy; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.test.annotation.DoNotRecord; import com.azure.core.test.http.AssertingHttpClientBuilder; import com.azure.core.util.Context; import com.azure.core.util.serializer.TypeReference; @@ -21,10 +22,12 @@ import com.azure.monitor.query.models.LogsQueryOptions; import com.azure.monitor.query.models.LogsQueryResult; import com.azure.monitor.query.models.LogsQueryResultStatus; +import com.azure.monitor.query.models.LogsTableCell; import com.azure.monitor.query.models.QueryTimeInterval; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; +import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; @@ -32,12 +35,14 @@ import java.time.LocalDateTime; import java.time.OffsetDateTime; import java.time.ZoneOffset; -import java.util.Arrays; +import java.util.Collections; import java.util.LinkedHashMap; import java.util.List; -import static com.azure.monitor.query.MonitorQueryTestUtils.*; +import static com.azure.monitor.query.MonitorQueryTestUtils.QUERY_STRING; +import static com.azure.monitor.query.MonitorQueryTestUtils.getAdditionalLogWorkspaceId; import static com.azure.monitor.query.MonitorQueryTestUtils.getLogResourceId; +import static com.azure.monitor.query.MonitorQueryTestUtils.getLogWorkspaceId; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; @@ -52,11 +57,14 @@ public class LogsQueryAsyncClientTest extends TestProxyTestBase { private String workspaceId; + private String additionalWorkspaceId; + private String resourceId; @BeforeEach public void setup() { workspaceId = getLogWorkspaceId(interceptorManager.isPlaybackMode()); + additionalWorkspaceId = getAdditionalLogWorkspaceId(interceptorManager.isPlaybackMode()); resourceId = getLogResourceId(interceptorManager.isPlaybackMode()); LogsQueryClientBuilder clientBuilder = new LogsQueryClientBuilder() .retryPolicy(new RetryPolicy(new RetryStrategy() { @@ -123,6 +131,7 @@ public void testLogsResourceQuery() { } @Test + @DoNotRecord(skipInPlayback = true) public void testLogsQueryAllowPartialSuccess() { // Arrange final String query = "let dt = datatable (DateTime: datetime, Bool:bool, Guid: guid, Int: " @@ -205,26 +214,33 @@ public void testLogsQueryBatchWithServerTimeout() { } @Test - @DisabledIfEnvironmentVariable(named = "AZURE_TEST_MODE", matches = "LIVE", disabledReason = "multi-workspace " - + "queries require sending logs to Azure Monitor first. So, run this test in playback or record mode only.") public void testMultipleWorkspaces() { + + final String multipleWorkspacesQuery = "let dt = datatable (DateTime: datetime, Bool:bool, Guid: guid, Int: " + + "int, Long:long, Double: double, String: string, Timespan: timespan, Decimal: decimal, Dynamic: dynamic, TenantId: string)\n" + + "[datetime(2015-12-31 23:59:59.9), false, guid(74be27de-1e4e-49d9-b579-fe0b331d3642), 12345, 1, 12345.6789," + + " 'string value', 10s, decimal(0.10101), dynamic({\"a\":123, \"b\":\"hello\", \"c\":[1,2,3], \"d\":{}}), \"" + workspaceId + "\"" + + ", datetime(2015-12-31 23:59:59.9), false, guid(74be27de-1e4e-49d9-b579-fe0b331d3642), 12345, 1, 12345.6789," + + " 'string value', 10s, decimal(0.10101), dynamic({\"a\":123, \"b\":\"hello\", \"c\":[1,2,3], \"d\":{}}), \"" + additionalWorkspaceId + "\"];" + + "range x from 1 to 2 step 1 | extend y=1 | join kind=fullouter dt on $left.y == $right.Long"; StepVerifier.create(client.queryWorkspaceWithResponse(workspaceId, - "union * | where TimeGenerated > ago(100d) | project TenantId | summarize count() by TenantId", null, - new LogsQueryOptions() - .setAdditionalWorkspaces(Arrays.asList("9dad0092-fd13-403a-b367-a189a090a541")), - Context.NONE)) - .assertNext(response -> { - LogsQueryResult queryResults = response.getValue(); - assertEquals(1, queryResults.getAllTables().size()); - assertEquals(2, queryResults - .getAllTables() - .get(0) - .getRows() - .stream() - .map(row -> row.getColumnValue("TenantId").get()) - .distinct() - .count()); - }).verifyComplete(); + multipleWorkspacesQuery, null, + new LogsQueryOptions() + .setAdditionalWorkspaces(Collections.singletonList(additionalWorkspaceId)), + Context.NONE)) + .assertNext(response -> { + LogsQueryResult queryResults = response.getValue(); + assertEquals(1, queryResults.getAllTables().size()); + assertEquals(2, queryResults + .getAllTables() + .get(0) + .getRows() + .stream() + .map(row -> row.getColumnValue("TenantId").get()) + .map(LogsTableCell::getValueAsString) + .distinct() + .count()); + }).verifyComplete(); } @Test @@ -234,31 +250,31 @@ public void testBatchQueryPartialSuccess() { logsBatchQuery.addWorkspaceQuery(workspaceId, QUERY_STRING + " | take", null); StepVerifier.create(client - .queryBatchWithResponse(logsBatchQuery, Context.NONE)) - .assertNext(response -> { - LogsBatchQueryResultCollection batchResultCollection = response.getValue(); - List responses = batchResultCollection.getBatchResults(); - - assertEquals(2, responses.size()); - assertEquals(LogsQueryResultStatus.SUCCESS, responses.get(0).getQueryResultStatus()); - assertNull(responses.get(0).getError()); - assertEquals(LogsQueryResultStatus.FAILURE, responses.get(1).getQueryResultStatus()); - assertNotNull(responses.get(1).getError()); - assertEquals("BadArgumentError", responses.get(1).getError().getCode()); - }) - .verifyComplete(); + .queryBatchWithResponse(logsBatchQuery, Context.NONE)) + .assertNext(response -> { + LogsBatchQueryResultCollection batchResultCollection = response.getValue(); + List responses = batchResultCollection.getBatchResults(); + + assertEquals(2, responses.size()); + assertEquals(LogsQueryResultStatus.SUCCESS, responses.get(0).getQueryResultStatus()); + assertNull(responses.get(0).getError()); + assertEquals(LogsQueryResultStatus.FAILURE, responses.get(1).getQueryResultStatus()); + assertNotNull(responses.get(1).getError()); + assertEquals("BadArgumentError", responses.get(1).getError().getCode()); + }) + .verifyComplete(); } @Test public void testStatistics() { StepVerifier.create(client.queryWorkspaceWithResponse(workspaceId, - QUERY_STRING, null, new LogsQueryOptions().setIncludeStatistics(true), Context.NONE)) - .assertNext(response -> { - LogsQueryResult queryResults = response.getValue(); - assertEquals(1, queryResults.getAllTables().size()); - assertNotNull(queryResults.getStatistics()); - }) - .verifyComplete(); + QUERY_STRING, null, new LogsQueryOptions().setIncludeStatistics(true), Context.NONE)) + .assertNext(response -> { + LogsQueryResult queryResults = response.getValue(); + assertEquals(1, queryResults.getAllTables().size()); + assertNotNull(queryResults.getStatistics()); + }) + .verifyComplete(); } @Test @@ -274,6 +290,7 @@ QUERY_STRING, null, new LogsQueryOptions().setIncludeStatistics(true), Context.N } @Test + @Disabled public void testBatchStatistics() { LogsBatchQuery logsBatchQuery = new LogsBatchQuery(); logsBatchQuery.addWorkspaceQuery(workspaceId, QUERY_STRING, null); @@ -298,7 +315,7 @@ public void testBatchStatistics() { } @Test - @DisabledIfEnvironmentVariable(named = "AZURE_TEST_MODE", matches = "LIVE", disabledReason = "server timeout is " + @EnabledIfEnvironmentVariable(named = "AZURE_TEST_MODE", matches = "LIVE", disabledReason = "server timeout is " + " not readily reproducible and because the service caches query results, the queries that require extended time " + "to complete if run the first time can return immediately if a cached result is available. So, this test can " + " wait for a long time before succeeding. So, disabling this in LIVE test mode") @@ -377,7 +394,5 @@ query, null, new LogsQueryOptions().setIncludeStatistics(true).setIncludeVisuali }) .verifyComplete(); - - } } diff --git a/sdk/monitor/azure-monitor-query/src/test/java/com/azure/monitor/query/LogsQueryClientTest.java b/sdk/monitor/azure-monitor-query/src/test/java/com/azure/monitor/query/LogsQueryClientTest.java index 24f9ad09bdca9..8748da3d2679e 100644 --- a/sdk/monitor/azure-monitor-query/src/test/java/com/azure/monitor/query/LogsQueryClientTest.java +++ b/sdk/monitor/azure-monitor-query/src/test/java/com/azure/monitor/query/LogsQueryClientTest.java @@ -12,6 +12,7 @@ import com.azure.core.http.rest.Response; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; +import com.azure.core.test.annotation.DoNotRecord; import com.azure.core.test.http.AssertingHttpClientBuilder; import com.azure.core.util.Context; import com.azure.core.util.serializer.TypeReference; @@ -22,23 +23,26 @@ import com.azure.monitor.query.models.LogsQueryOptions; import com.azure.monitor.query.models.LogsQueryResult; import com.azure.monitor.query.models.LogsQueryResultStatus; +import com.azure.monitor.query.models.LogsTableCell; import com.azure.monitor.query.models.QueryTimeInterval; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; +import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; import reactor.core.publisher.Mono; import java.time.Duration; import java.time.LocalDateTime; import java.time.OffsetDateTime; import java.time.ZoneOffset; -import java.util.Arrays; +import java.util.Collections; import java.util.LinkedHashMap; import java.util.List; import static com.azure.monitor.query.MonitorQueryTestUtils.QUERY_STRING; -import static com.azure.monitor.query.MonitorQueryTestUtils.getLogWorkspaceId; +import static com.azure.monitor.query.MonitorQueryTestUtils.getAdditionalLogWorkspaceId; import static com.azure.monitor.query.MonitorQueryTestUtils.getLogResourceId; +import static com.azure.monitor.query.MonitorQueryTestUtils.getLogWorkspaceId; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; @@ -54,11 +58,14 @@ public class LogsQueryClientTest extends TestProxyTestBase { private String workspaceId; + private String additionalWorkspaceId; + private String resourceId; @BeforeEach public void setup() { workspaceId = getLogWorkspaceId(interceptorManager.isPlaybackMode()); + additionalWorkspaceId = getAdditionalLogWorkspaceId(interceptorManager.isPlaybackMode()); resourceId = getLogResourceId(interceptorManager.isPlaybackMode()); LogsQueryClientBuilder clientBuilder = new LogsQueryClientBuilder() .retryPolicy(new RetryPolicy(new RetryStrategy() { @@ -120,8 +127,8 @@ public void testLogsQueryResource() { } @Test + @DoNotRecord(skipInPlayback = true) public void testLogsQueryAllowPartialSuccess() { - // Arrange final String query = "let dt = datatable (DateTime: datetime, Bool:bool, Guid: guid, Int: " + "int, Long:long, Double: double, String: string, Timespan: timespan, Decimal: decimal, Dynamic: dynamic)\n" @@ -197,13 +204,19 @@ public void testLogsQueryBatchWithServerTimeout() { } @Test - @DisabledIfEnvironmentVariable(named = "AZURE_TEST_MODE", matches = "LIVE", disabledReason = "multi-workspace " - + "queries require sending logs to Azure Monitor first. So, run this test in playback or record mode only.") public void testMultipleWorkspaces() { + final String multipleWorkspacesQuery = "let dt = datatable (DateTime: datetime, Bool:bool, Guid: guid, Int: " + + "int, Long:long, Double: double, String: string, Timespan: timespan, Decimal: decimal, Dynamic: dynamic, TenantId: string)\n" + + "[datetime(2015-12-31 23:59:59.9), false, guid(74be27de-1e4e-49d9-b579-fe0b331d3642), 12345, 1, 12345.6789," + + " 'string value', 10s, decimal(0.10101), dynamic({\"a\":123, \"b\":\"hello\", \"c\":[1,2,3], \"d\":{}}), \"" + workspaceId + "\"" + + ", datetime(2015-12-31 23:59:59.9), false, guid(74be27de-1e4e-49d9-b579-fe0b331d3642), 12345, 1, 12345.6789," + + " 'string value', 10s, decimal(0.10101), dynamic({\"a\":123, \"b\":\"hello\", \"c\":[1,2,3], \"d\":{}}), \"" + additionalWorkspaceId + "\"];" + + "range x from 1 to 2 step 1 | extend y=1 | join kind=fullouter dt on $left.y == $right.Long"; + LogsQueryResult queryResults = client.queryWorkspaceWithResponse(workspaceId, - "union * | where TimeGenerated > ago(100d) | project TenantId | summarize count() by TenantId", null, + multipleWorkspacesQuery, null, new LogsQueryOptions() - .setAdditionalWorkspaces(Arrays.asList("9dad0092-fd13-403a-b367-a189a090a541")), Context.NONE) + .setAdditionalWorkspaces(Collections.singletonList(additionalWorkspaceId)), Context.NONE) .getValue(); assertEquals(1, queryResults.getAllTables().size()); assertEquals(2, queryResults @@ -211,9 +224,8 @@ public void testMultipleWorkspaces() { .get(0) .getRows() .stream() - .map(row -> { - return row.getColumnValue("TenantId").get(); - }) + .map(row -> row.getColumnValue("TenantId").get()) + .map(LogsTableCell::getValueAsString) .distinct() .count()); } @@ -256,6 +268,7 @@ QUERY_STRING, null, new LogsQueryOptions().setIncludeStatistics(true), Context.N } @Test + @Disabled public void testBatchStatistics() { LogsBatchQuery logsBatchQuery = new LogsBatchQuery(); logsBatchQuery.addWorkspaceQuery(workspaceId, QUERY_STRING, null); @@ -277,7 +290,7 @@ public void testBatchStatistics() { } @Test - @DisabledIfEnvironmentVariable(named = "AZURE_TEST_MODE", matches = "LIVE", disabledReason = "server timeout is " + @EnabledIfEnvironmentVariable(named = "AZURE_TEST_MODE", matches = "LIVE", disabledReason = "server timeout is " + " not readily reproducible and because the service caches query results, the queries that require extended time " + "to complete if run the first time can return immediately if a cached result is available. So, this test can " + " wait for a long time before succeeding. So, disabling this in LIVE test mode") diff --git a/sdk/monitor/azure-monitor-query/src/test/java/com/azure/monitor/query/MetricsBatchQueryClientTest.java b/sdk/monitor/azure-monitor-query/src/test/java/com/azure/monitor/query/MetricsClientTest.java similarity index 89% rename from sdk/monitor/azure-monitor-query/src/test/java/com/azure/monitor/query/MetricsBatchQueryClientTest.java rename to sdk/monitor/azure-monitor-query/src/test/java/com/azure/monitor/query/MetricsClientTest.java index e813567b4a77a..ce1ea8d3540ec 100644 --- a/sdk/monitor/azure-monitor-query/src/test/java/com/azure/monitor/query/MetricsBatchQueryClientTest.java +++ b/sdk/monitor/azure-monitor-query/src/test/java/com/azure/monitor/query/MetricsClientTest.java @@ -22,13 +22,13 @@ import static org.junit.jupiter.api.Assertions.*; /** - * Unit tests for {@link MetricsBatchQueryClient}. + * Unit tests for {@link MetricsClient}. */ -public class MetricsBatchQueryClientTest extends MetricsBatchQueryTestBase { +public class MetricsClientTest extends MetricsClientTestBase { @Test public void testMetricsBatchQuery() { - MetricsBatchQueryClient metricsBatchQueryClient = clientBuilder + MetricsClient metricsClient = clientBuilder .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)) .buildClient(); String resourceId = Configuration.getGlobalConfiguration().get("AZURE_MONITOR_METRICS_RESOURCE_URI_2", FAKE_RESOURCE_ID); @@ -45,7 +45,7 @@ public void testMetricsBatchQuery() { .setTop(10) .setTimeInterval(new QueryTimeInterval(OffsetDateTime.now().minusDays(1), OffsetDateTime.now())); - MetricsBatchQueryResult metricsQueryResults = metricsBatchQueryClient.queryBatchWithResponse( + MetricsBatchQueryResult metricsQueryResults = metricsClient.queryBatchWithResponse( Arrays.asList(resourceId), Arrays.asList("HttpIncomingRequestCount"), "microsoft.appconfiguration/configurationstores", options, Context.NONE) .getValue(); @@ -58,7 +58,7 @@ public void testMetricsBatchQuery() { @Test public void testMetricsBatchQueryDifferentResourceTypes() { - MetricsBatchQueryClient metricsBatchQueryClient = clientBuilder + MetricsClient metricsBatchQueryClient = clientBuilder .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)) .buildClient(); String resourceId1 = Configuration.getGlobalConfiguration().get("AZURE_MONITOR_METRICS_RESOURCE_URI_1", FAKE_RESOURCE_ID); diff --git a/sdk/monitor/azure-monitor-query/src/test/java/com/azure/monitor/query/MetricsBatchQueryTestBase.java b/sdk/monitor/azure-monitor-query/src/test/java/com/azure/monitor/query/MetricsClientTestBase.java similarity index 93% rename from sdk/monitor/azure-monitor-query/src/test/java/com/azure/monitor/query/MetricsBatchQueryTestBase.java rename to sdk/monitor/azure-monitor-query/src/test/java/com/azure/monitor/query/MetricsClientTestBase.java index da9882f8bc05e..41baabcb4bb9d 100644 --- a/sdk/monitor/azure-monitor-query/src/test/java/com/azure/monitor/query/MetricsBatchQueryTestBase.java +++ b/sdk/monitor/azure-monitor-query/src/test/java/com/azure/monitor/query/MetricsClientTestBase.java @@ -14,18 +14,18 @@ import java.util.Arrays; -public class MetricsBatchQueryTestBase extends TestProxyTestBase { +public class MetricsClientTestBase extends TestProxyTestBase { static final String FAKE_RESOURCE_ID = "/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourceGroups/rg/providers/Microsoft.Compute/virtualMachines/vm"; protected String metricEndpoint; - protected MetricsBatchQueryClientBuilder clientBuilder; + protected MetricsClientBuilder clientBuilder; protected ConfigurationClient configClient; @Override public void beforeTest() { metricEndpoint = Configuration.getGlobalConfiguration().get("AZURE_MONITOR_METRICS_ENDPOINT", "https://westus.metrics.monitor.azure.com"); - MetricsBatchQueryClientBuilder clientBuilder = new MetricsBatchQueryClientBuilder(); + MetricsClientBuilder clientBuilder = new MetricsClientBuilder(); ConfigurationClientBuilder configClientBuilder = new ConfigurationClientBuilder(); if (getTestMode() == TestMode.PLAYBACK) { interceptorManager.addMatchers(new CustomMatcher() diff --git a/sdk/monitor/azure-monitor-query/src/test/java/com/azure/monitor/query/MonitorQueryTestUtils.java b/sdk/monitor/azure-monitor-query/src/test/java/com/azure/monitor/query/MonitorQueryTestUtils.java index 145c126c3be86..67eecd56aeec5 100644 --- a/sdk/monitor/azure-monitor-query/src/test/java/com/azure/monitor/query/MonitorQueryTestUtils.java +++ b/sdk/monitor/azure-monitor-query/src/test/java/com/azure/monitor/query/MonitorQueryTestUtils.java @@ -15,6 +15,9 @@ private MonitorQueryTestUtils() { private static final String LOG_WORKSPACE_ID = Configuration.getGlobalConfiguration() .get("AZURE_MONITOR_LOGS_WORKSPACE_ID"); + private static final String ADDITIONAL_LOG_WORKSPACE_ID = Configuration.getGlobalConfiguration() + .get("AZURE_MONITOR_LOGS_ADDITIONAL_WORKSPACE_ID"); + private static final String LOG_RESOURCE_ID = Configuration.getGlobalConfiguration() .get("AZURE_MONITOR_LOGS_RESOURCE_ID"); @@ -38,25 +41,33 @@ private MonitorQueryTestUtils() { public static String getLogWorkspaceId(boolean isPlaybackMode) { if (isPlaybackMode) { - return "d2d0e126-fa1e-4b0a-b647-250cdd471e68"; + return "f87c198a-4353-4612-ae3c-9fe34076b771"; } else { return LOG_WORKSPACE_ID; } } + public static String getAdditionalLogWorkspaceId(boolean isPlaybackMode) { + if (isPlaybackMode) { + return "e9512cff-dd93-4a96-8583-e614eacda4fd"; + } else { + return ADDITIONAL_LOG_WORKSPACE_ID; + } + } + public static String getLogResourceId(boolean isPlaybackMode) { if (isPlaybackMode) { - return "subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourceGroups/srnagar-azuresdkgroup/providers/Microsoft.Storage/storageAccounts/srnagarstorage"; + return "/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourceGroups/rg-marchtest7/providers/Microsoft.OperationalInsights/workspaces/marchtest7-azmonitorlogsws"; } else { - return LOG_RESOURCE_ID; + return LOG_RESOURCE_ID.substring(LOG_RESOURCE_ID.indexOf("/subscriptions")); } } public static String getMetricResourceUri(boolean isPlaybackMode) { if (isPlaybackMode) { - return "/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourceGroups/rg-jairmyree-test/providers/Microsoft.EventHub/namespaces/eventhubt9a76fe3bdd7263f8"; + return "/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourceGroups/rg-marchtest7/providers/Microsoft.Eventhub/Namespaces/eventhubmarchtest7"; } else { - return METRIC_RESOURCE_URI; + return METRIC_RESOURCE_URI.substring(METRIC_RESOURCE_URI.indexOf("/subscriptions")); } } diff --git a/sdk/monitor/azure-monitor-query/swagger/README.md b/sdk/monitor/azure-monitor-query/swagger/README.md index b9b295e27d004..2cb2eb67213b8 100644 --- a/sdk/monitor/azure-monitor-query/swagger/README.md +++ b/sdk/monitor/azure-monitor-query/swagger/README.md @@ -1,11 +1,11 @@ ## Generate autorest code ## input-file: https://dev.loganalytics.io/swagger/api.loganalytics.io/v1/swagger.json -## Log Query +## Log Query These settings apply only when `--tag=package-log` is specified on the command line. ```yaml $(tag) == 'package-log' -use: '@autorest/java@4.1.23' +use: '@autorest/java@4.1.27' input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/21f5332f2dc7437d1446edf240e9a3d4c90c6431/specification/operationalinsights/data-plane/Microsoft.OperationalInsights/stable/2022-10-27/OperationalInsights.json java: true output-folder: ../ @@ -16,7 +16,7 @@ sync-methods: all license-header: MICROSOFT_MIT_SMALL add-context-parameter: true context-client-method-parameter: true -required-parameter-client-methods: false +required-parameter-client-methods: false required-fields-as-ctor-args: true model-override-setter-from-superclass: true credential-types: tokencredential @@ -29,8 +29,8 @@ enable-sync-stack: true These settings apply only when `--tag=package-metrics` is specified on the command line. ```yaml $(tag) == 'package-metrics' -use: '@autorest/java@4.1.23' -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/21f5332f2dc7437d1446edf240e9a3d4c90c6431/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/metrics_API.json +use: '@autorest/java@4.1.27' +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/0b64ca7cbe3af8cd13228dfb783a16b8272b8be2/specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/metrics_API.json java: true output-folder: ../ namespace: com.azure.monitor.query.implementation.metrics @@ -75,9 +75,9 @@ directive: These settings apply only when `--tag=package-metrics-namespaces` is specified on the command line. ```yaml $(tag) == 'package-metrics-namespaces' -use: '@autorest/java@4.1.23' +use: '@autorest/java@4.1.27' service-name: MetricsNamespaces -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/21f5332f2dc7437d1446edf240e9a3d4c90c6431/specification/monitor/resource-manager/Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/0b64ca7cbe3af8cd13228dfb783a16b8272b8be2/specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/metricNamespaces_API.json java: true output-folder: ../ namespace: com.azure.monitor.query.implementation.metricsnamespaces @@ -100,8 +100,8 @@ enable-sync-stack: true These settings apply only when `--tag=package-metrics-definitions` is specified on the command line. ```yaml $(tag) == 'package-metrics-definitions' -use: '@autorest/java@4.1.23' -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/21f5332f2dc7437d1446edf240e9a3d4c90c6431/specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/metricDefinitions_API.json +use: '@autorest/java@4.1.27' +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/0b64ca7cbe3af8cd13228dfb783a16b8272b8be2/specification/monitor/resource-manager/Microsoft.Insights/stable/2024-02-01/metricDefinitions_API.json service-name: MetricsDefinitions java: true output-folder: ../ @@ -125,9 +125,9 @@ enable-sync-stack: true These settings apply only when `--tag=package-metrics-batch` is specified on the command line. ```yaml $(tag) == 'package-metrics-batch' -use: '@autorest/java@4.1.23' -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/21f5332f2dc7437d1446edf240e9a3d4c90c6431/specification/monitor/data-plane/Microsoft.Insights/preview/2023-05-01-preview/metricBatch.json -service-name: MetricsDefinitions +use: '@autorest/java@4.1.27' +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/0550754fb421cd3a5859abf6713a542b682f626c/specification/monitor/data-plane/Microsoft.Insights/stable/2024-02-01/metricBatch.json +service-name: MetricsBatch java: true output-folder: ../ namespace: com.azure.monitor.query.implementation.metricsbatch @@ -137,7 +137,7 @@ sync-methods: all license-header: MICROSOFT_MIT_SMALL add-context-parameter: true context-client-method-parameter: true -required-parameter-client-methods: false +required-parameter-client-methods: false required-fields-as-ctor-args: true model-override-setter-from-superclass: true credential-types: tokencredential @@ -149,8 +149,17 @@ enable-sync-stack: true ```yaml $(tag) == 'package-metrics-batch' directive: -- from: swagger-document - where: $.parameters.IntervalParameter - transform: > - $["format"] = "duration"; + - from: swagger-document + where: $.parameters.IntervalParameter + transform: > + $["format"] = "duration"; +``` + +### Change subscriptionId to type 'String' +```yaml $(tag) == 'package-metrics-batch' +directive: + - from: swagger-document + where: $.parameters.SubscriptionIdParameter + transform: > + $["format"] = ""; ``` diff --git a/sdk/monitor/azure-monitor-query/swagger/src/main/java/MetricsCustomization.java b/sdk/monitor/azure-monitor-query/swagger/src/main/java/MetricsCustomization.java index 4fc75e6a4e8ea..c16e65c2eb26b 100644 --- a/sdk/monitor/azure-monitor-query/swagger/src/main/java/MetricsCustomization.java +++ b/sdk/monitor/azure-monitor-query/swagger/src/main/java/MetricsCustomization.java @@ -11,11 +11,11 @@ public void customize(LibraryCustomization libraryCustomization, Logger logger) metrics.rename("MetricsImpl"); ClassCustomization metricsClient = libraryCustomization - .getClass("com.azure.monitor.query.implementation.metrics", "MonitorManagementClient"); + .getClass("com.azure.monitor.query.implementation.metrics", "AzureMonitorMetricsDataAPI"); metricsClient.rename("MonitorManagementClientImpl"); ClassCustomization metricsClientBuilder = libraryCustomization - .getClass("com.azure.monitor.query.implementation.metrics", "MonitorManagementClientBuilder"); + .getClass("com.azure.monitor.query.implementation.metrics", "AzureMonitorMetricsDataAPIBuilder"); metricsClientBuilder.rename("MonitorManagementClientImplBuilder"); String replace = libraryCustomization.getRawEditor().getFileContent("src/main/java/com/azure/monitor/query/implementation" + diff --git a/sdk/monitor/azure-monitor-query/swagger/src/main/java/MetricsDefinitionsCustomization.java b/sdk/monitor/azure-monitor-query/swagger/src/main/java/MetricsDefinitionsCustomization.java index 2a33804f046f5..9dc3e339e8040 100644 --- a/sdk/monitor/azure-monitor-query/swagger/src/main/java/MetricsDefinitionsCustomization.java +++ b/sdk/monitor/azure-monitor-query/swagger/src/main/java/MetricsDefinitionsCustomization.java @@ -7,16 +7,20 @@ public class MetricsDefinitionsCustomization extends Customization { @Override public void customize(LibraryCustomization libraryCustomization, Logger logger) { + libraryCustomization.getPackage("com.azure.monitor.query.implementation.metricsdefinitions") + .listClasses() + .forEach(cu -> logger.info("Class name " + cu.getFileName())); + ClassCustomization metricsDefinitions = libraryCustomization .getClass("com.azure.monitor.query.implementation.metricsdefinitions", "MetricDefinitions"); metricsDefinitions.rename("MetricDefinitionsImpl"); ClassCustomization metricsDefinitionsClient = libraryCustomization - .getClass("com.azure.monitor.query.implementation.metricsdefinitions", "MonitorManagementClient"); + .getClass("com.azure.monitor.query.implementation.metricsdefinitions", "AzureMonitorMetricsDefinitionsAPI"); metricsDefinitionsClient.rename("MetricsDefinitionsClientImpl"); ClassCustomization metricsDefinitionsClientBuilder = libraryCustomization - .getClass("com.azure.monitor.query.implementation.metricsdefinitions", "MonitorManagementClientBuilder"); + .getClass("com.azure.monitor.query.implementation.metricsdefinitions", "AzureMonitorMetricsDefinitionsAPIBuilder"); metricsDefinitionsClientBuilder.rename("MetricsDefinitionsClientImplBuilder"); String replace = libraryCustomization.getRawEditor().getFileContent("src/main/java/com/azure/monitor/query/implementation" + diff --git a/sdk/monitor/test-resources.json b/sdk/monitor/test-resources.json index 350ff258b15c1..c77d6d5739332 100644 --- a/sdk/monitor/test-resources.json +++ b/sdk/monitor/test-resources.json @@ -88,7 +88,8 @@ "dcrRoleName": "[concat('dcrrole', parameters('baseName'))]", "dataCollectionRuleName": "[concat(parameters('baseName'), '-', 'azmonitordcr')]", "dataCollectionEndpointName": "[concat(parameters('baseName'), '-', 'azmonitordce')]", - "workspaceName": "[concat(parameters('baseName'), '-', 'azmonitorlogsws')]" + "workspaceName": "[concat(parameters('baseName'), '-', 'azmonitorlogsws')]", + "additionalWorkspaceName": "[concat(parameters('baseName'), '-', 'azmonitorlogsws2')]" }, "resources": [ { @@ -275,6 +276,26 @@ "publicNetworkAccessForQuery": "Enabled" } }, + { + "type": "microsoft.operationalinsights/workspaces", + "apiVersion": "2021-12-01-preview", + "name": "[variables('additionalWorkspaceName')]", + "location": "[variables('location')]", + "properties": { + "sku": { + "name": "pergb2018" + }, + "retentionInDays": 30, + "features": { + "enableLogAccessUsingOnlyResourcePermissions": true + }, + "workspaceCapping": { + "dailyQuotaGb": -1 + }, + "publicNetworkAccessForIngestion": "Enabled", + "publicNetworkAccessForQuery": "Enabled" + } + }, { "type": "Microsoft.OperationalInsights/workspaces/tables", "apiVersion": "2021-12-01-preview", @@ -358,6 +379,10 @@ "type": "string", "value": "[reference(resourceId('Microsoft.OperationalInsights/workspaces', variables('workspaceName'))).customerId]" }, + "AZURE_MONITOR_LOGS_ADDITIONAL_WORKSPACE_ID": { + "type": "string", + "value": "[reference(resourceId('Microsoft.OperationalInsights/workspaces', variables('additionalWorkspaceName'))).customerId]" + }, "AZURE_MONITOR_LOGS_RESOURCE_ID": { "type": "string", "value": "[resourceId('Microsoft.OperationalInsights/workspaces', variables('workspaceName'))]" From aaa2fb5baf635efb688b3c296d476b870c46f47a Mon Sep 17 00:00:00 2001 From: Bill Wert Date: Mon, 11 Mar 2024 17:25:53 -0700 Subject: [PATCH 18/90] Prepare March 2023 EventGrid Release (#39167) * Prepare March 2023 EventGrid Release * update version_client.txt --- eng/versioning/version_client.txt | 2 +- sdk/eventgrid/azure-messaging-eventgrid/CHANGELOG.md | 10 ++++++---- sdk/eventgrid/azure-messaging-eventgrid/README.md | 2 +- sdk/eventgrid/azure-messaging-eventgrid/pom.xml | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index f13fd61a0212c..e97bdcb86c10b 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -146,7 +146,7 @@ com.azure:azure-maps-render;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-maps-route;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-maps-search;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-media-videoanalyzer-edge;1.0.0-beta.6;1.0.0-beta.7 -com.azure:azure-messaging-eventgrid;4.21.0;4.22.0-beta.1 +com.azure:azure-messaging-eventgrid;4.21.0;4.22.0 com.azure:azure-messaging-eventgrid-cloudnative-cloudevents;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-messaging-eventhubs;5.18.1;5.19.0-beta.1 com.azure:azure-messaging-eventhubs-checkpointstore-blob;1.19.1;1.20.0-beta.1 diff --git a/sdk/eventgrid/azure-messaging-eventgrid/CHANGELOG.md b/sdk/eventgrid/azure-messaging-eventgrid/CHANGELOG.md index 760aa19131afa..ad545476221db 100644 --- a/sdk/eventgrid/azure-messaging-eventgrid/CHANGELOG.md +++ b/sdk/eventgrid/azure-messaging-eventgrid/CHANGELOG.md @@ -1,14 +1,16 @@ # Release History -## 4.22.0-beta.1 (Unreleased) +## 4.22.0 (2024-03-11) ### Features Added +- New System Events for API Center -### Breaking Changes +### Other Changes -### Bugs Fixed +#### Dependency Updates -### Other Changes +- Upgraded `azure-core-http-netty` from `1.14.0` to version `1.14.1`. +- Upgraded `azure-core` from `1.46.0` to version `1.47.0`. ## 4.21.0 (2024-02-13) diff --git a/sdk/eventgrid/azure-messaging-eventgrid/README.md b/sdk/eventgrid/azure-messaging-eventgrid/README.md index e695b34e64225..79a5be2902a4b 100644 --- a/sdk/eventgrid/azure-messaging-eventgrid/README.md +++ b/sdk/eventgrid/azure-messaging-eventgrid/README.md @@ -81,7 +81,7 @@ add the direct dependency to your project as follows. com.azure azure-messaging-eventgrid - 4.21.0 + 4.22.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/eventgrid/azure-messaging-eventgrid/pom.xml b/sdk/eventgrid/azure-messaging-eventgrid/pom.xml index edb80ee0d7fa6..fcfb726735ebe 100644 --- a/sdk/eventgrid/azure-messaging-eventgrid/pom.xml +++ b/sdk/eventgrid/azure-messaging-eventgrid/pom.xml @@ -12,7 +12,7 @@ com.azure azure-messaging-eventgrid - 4.22.0-beta.1 + 4.22.0 jar Microsoft Azure SDK for eventgrid From 569c3f02d18cc84f1b0f5d07e4bfda3311de270e Mon Sep 17 00:00:00 2001 From: Sanjana Kapur Date: Mon, 11 Mar 2024 17:30:40 -0700 Subject: [PATCH 19/90] Add Spotbug exception for AutoRest generated files (#39098) --- .../src/main/resources/spotbugs/spotbugs-exclude.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml b/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml index 5d9ca85246ebc..9bde85c9ae28c 100644 --- a/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml +++ b/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml @@ -363,6 +363,11 @@
+ + + + + From b9b26d23ea1799575c9ef0d208b65b9cc2358381 Mon Sep 17 00:00:00 2001 From: Anu Thomas Chandy Date: Mon, 11 Mar 2024 17:51:02 -0700 Subject: [PATCH 20/90] aligning code owners of SB with EH (#39168) --- .github/CODEOWNERS | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 70099f5a2fa05..7c1df387f5353 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -692,7 +692,7 @@ # ServiceOwners: @amirkeren # ServiceLabel: %Service Bus -# AzureSdkOwners: @anuchandy +# AzureSdkOwners: @anuchandy @conniey @lmolkova # ServiceOwners: @EldertGrootenboer # PRLabel: %Service Bus @@ -704,10 +704,6 @@ # ServiceLabel: %Service Bus %Track 1 # AzureSdkOwners: @shankarsama @yvgopal -# ServiceLabel: %Service Bus -# AzureSdkOwners: @anuchandy -# ServiceOwners: @EldertGrootenboer - # ServiceLabel: %Service Fabric # ServiceOwners: @QingChenmsft @vaishnavk @juhacket From d1560b269a579bc557ba5a7685845bd57f243694 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 12 Mar 2024 00:24:26 -0400 Subject: [PATCH 21/90] Increment package versions for cosmos releases (#39081) --- eng/versioning/version_client.txt | 8 ++++---- sdk/cosmos/azure-cosmos-spark_3-1_2-12/CHANGELOG.md | 10 ++++++++++ sdk/cosmos/azure-cosmos-spark_3-1_2-12/pom.xml | 2 +- sdk/cosmos/azure-cosmos-spark_3-2_2-12/CHANGELOG.md | 10 ++++++++++ sdk/cosmos/azure-cosmos-spark_3-2_2-12/pom.xml | 2 +- sdk/cosmos/azure-cosmos-spark_3-3_2-12/CHANGELOG.md | 10 ++++++++++ sdk/cosmos/azure-cosmos-spark_3-3_2-12/pom.xml | 2 +- sdk/cosmos/azure-cosmos-spark_3-4_2-12/CHANGELOG.md | 10 ++++++++++ sdk/cosmos/azure-cosmos-spark_3-4_2-12/pom.xml | 2 +- 9 files changed, 48 insertions(+), 8 deletions(-) diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index e97bdcb86c10b..c0689ffd36434 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -105,10 +105,10 @@ com.azure:azure-cosmos;4.56.0;4.57.0-beta.1 com.azure:azure-cosmos-benchmark;4.0.1-beta.1;4.0.1-beta.1 com.azure:azure-cosmos-dotnet-benchmark;4.0.1-beta.1;4.0.1-beta.1 com.azure.cosmos.spark:azure-cosmos-spark_3_2-12;1.0.0-beta.1;1.0.0-beta.1 -com.azure.cosmos.spark:azure-cosmos-spark_3-1_2-12;4.28.1;4.28.2 -com.azure.cosmos.spark:azure-cosmos-spark_3-2_2-12;4.28.1;4.28.2 -com.azure.cosmos.spark:azure-cosmos-spark_3-3_2-12;4.28.1;4.28.2 -com.azure.cosmos.spark:azure-cosmos-spark_3-4_2-12;4.28.1;4.28.2 +com.azure.cosmos.spark:azure-cosmos-spark_3-1_2-12;4.28.2;4.29.0-beta.1 +com.azure.cosmos.spark:azure-cosmos-spark_3-2_2-12;4.28.2;4.29.0-beta.1 +com.azure.cosmos.spark:azure-cosmos-spark_3-3_2-12;4.28.2;4.29.0-beta.1 +com.azure.cosmos.spark:azure-cosmos-spark_3-4_2-12;4.28.2;4.29.0-beta.1 com.azure:azure-cosmos-encryption;2.8.0;2.9.0-beta.1 com.azure:azure-cosmos-test;1.0.0-beta.6;1.0.0-beta.7 com.azure:azure-cosmos-tests;1.0.0-beta.1;1.0.0-beta.1 diff --git a/sdk/cosmos/azure-cosmos-spark_3-1_2-12/CHANGELOG.md b/sdk/cosmos/azure-cosmos-spark_3-1_2-12/CHANGELOG.md index 63cb85ff0cd8c..f5cca589c1e83 100644 --- a/sdk/cosmos/azure-cosmos-spark_3-1_2-12/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos-spark_3-1_2-12/CHANGELOG.md @@ -1,5 +1,15 @@ ## Release History +### 4.29.0-beta.1 (Unreleased) + +#### Features Added + +#### Breaking Changes + +#### Bugs Fixed + +#### Other Changes + ### 4.28.2 (2024-03-05) #### Other Changes diff --git a/sdk/cosmos/azure-cosmos-spark_3-1_2-12/pom.xml b/sdk/cosmos/azure-cosmos-spark_3-1_2-12/pom.xml index 0a8e45cb4215f..999ae9d2e0cd8 100644 --- a/sdk/cosmos/azure-cosmos-spark_3-1_2-12/pom.xml +++ b/sdk/cosmos/azure-cosmos-spark_3-1_2-12/pom.xml @@ -11,7 +11,7 @@ com.azure.cosmos.spark azure-cosmos-spark_3-1_2-12 - 4.28.2 + 4.29.0-beta.1 jar https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/cosmos/azure-cosmos-spark_3-1_2-12 OLTP Spark 3.1 Connector for Azure Cosmos DB SQL API diff --git a/sdk/cosmos/azure-cosmos-spark_3-2_2-12/CHANGELOG.md b/sdk/cosmos/azure-cosmos-spark_3-2_2-12/CHANGELOG.md index c8702e93e49ff..5247f11da4b1e 100644 --- a/sdk/cosmos/azure-cosmos-spark_3-2_2-12/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos-spark_3-2_2-12/CHANGELOG.md @@ -1,5 +1,15 @@ ## Release History +### 4.29.0-beta.1 (Unreleased) + +#### Features Added + +#### Breaking Changes + +#### Bugs Fixed + +#### Other Changes + ### 4.28.2 (2024-03-05) #### Other Changes diff --git a/sdk/cosmos/azure-cosmos-spark_3-2_2-12/pom.xml b/sdk/cosmos/azure-cosmos-spark_3-2_2-12/pom.xml index 49b5e351d9d2b..2f3371d4d9921 100644 --- a/sdk/cosmos/azure-cosmos-spark_3-2_2-12/pom.xml +++ b/sdk/cosmos/azure-cosmos-spark_3-2_2-12/pom.xml @@ -11,7 +11,7 @@ com.azure.cosmos.spark azure-cosmos-spark_3-2_2-12 - 4.28.2 + 4.29.0-beta.1 jar https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/cosmos/azure-cosmos-spark_3-2_2-12 OLTP Spark 3.2 Connector for Azure Cosmos DB SQL API diff --git a/sdk/cosmos/azure-cosmos-spark_3-3_2-12/CHANGELOG.md b/sdk/cosmos/azure-cosmos-spark_3-3_2-12/CHANGELOG.md index 289691e4132e2..9238b1b0d59a3 100644 --- a/sdk/cosmos/azure-cosmos-spark_3-3_2-12/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos-spark_3-3_2-12/CHANGELOG.md @@ -1,5 +1,15 @@ ## Release History +### 4.29.0-beta.1 (Unreleased) + +#### Features Added + +#### Breaking Changes + +#### Bugs Fixed + +#### Other Changes + ### 4.28.2 (2024-03-05) #### Other Changes diff --git a/sdk/cosmos/azure-cosmos-spark_3-3_2-12/pom.xml b/sdk/cosmos/azure-cosmos-spark_3-3_2-12/pom.xml index 82c32565af952..05d3d29bb7e20 100644 --- a/sdk/cosmos/azure-cosmos-spark_3-3_2-12/pom.xml +++ b/sdk/cosmos/azure-cosmos-spark_3-3_2-12/pom.xml @@ -11,7 +11,7 @@ com.azure.cosmos.spark azure-cosmos-spark_3-3_2-12 - 4.28.2 + 4.29.0-beta.1 jar https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/cosmos/azure-cosmos-spark_3-3_2-12 OLTP Spark 3.3 Connector for Azure Cosmos DB SQL API diff --git a/sdk/cosmos/azure-cosmos-spark_3-4_2-12/CHANGELOG.md b/sdk/cosmos/azure-cosmos-spark_3-4_2-12/CHANGELOG.md index 3312cbad6f5ee..05d98692786f7 100644 --- a/sdk/cosmos/azure-cosmos-spark_3-4_2-12/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos-spark_3-4_2-12/CHANGELOG.md @@ -1,5 +1,15 @@ ## Release History +### 4.29.0-beta.1 (Unreleased) + +#### Features Added + +#### Breaking Changes + +#### Bugs Fixed + +#### Other Changes + ### 4.28.2 (2024-03-05) #### Other Changes diff --git a/sdk/cosmos/azure-cosmos-spark_3-4_2-12/pom.xml b/sdk/cosmos/azure-cosmos-spark_3-4_2-12/pom.xml index ded2271c0cd92..261372acd86e0 100644 --- a/sdk/cosmos/azure-cosmos-spark_3-4_2-12/pom.xml +++ b/sdk/cosmos/azure-cosmos-spark_3-4_2-12/pom.xml @@ -11,7 +11,7 @@ com.azure.cosmos.spark azure-cosmos-spark_3-4_2-12 - 4.28.2 + 4.29.0-beta.1 jar https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/cosmos/azure-cosmos-spark_3-4_2-12 OLTP Spark 3.4 Connector for Azure Cosmos DB SQL API From 1d3a2cb2e21c8361411779e48166bb02dd7f8b53 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Tue, 12 Mar 2024 14:06:59 +0800 Subject: [PATCH 22/90] eng, auto-patch for azure-messaging-webpubsub-client (#39113) --- eng/pipelines/patch_release_client.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/pipelines/patch_release_client.txt b/eng/pipelines/patch_release_client.txt index f629409dd4244..71b587f0a1683 100644 --- a/eng/pipelines/patch_release_client.txt +++ b/eng/pipelines/patch_release_client.txt @@ -47,6 +47,7 @@ com.azure:azure-messaging-eventhubs # Tests owner: conniey com.azure:azure-messaging-eventhubs-checkpointstore-blob # Tests owner: conniey com.azure:azure-messaging-servicebus # Tests owner: ki1729 com.azure:azure-messaging-webpubsub # Tests owner: weidongxu-microsoft +com.azure:azure-messaging-webpubsub-client # Tests owner: weidongxu-microsoft com.azure:azure-mixedreality-authentication # Tests owner: craigktreasure, RamonArguelles com.azure:azure-mixedreality-remoterendering # Tests owner: FlorianBorn71, MichaelZp0, jloehr com.azure:azure-monitor-query # Tests owner: srnagar From bb072ec1c17dfb9eb4fb740177af1b57dd9cd70c Mon Sep 17 00:00:00 2001 From: Fabian Meiswinkel Date: Tue, 12 Mar 2024 10:12:30 +0100 Subject: [PATCH 23/90] azure-cosmos-spark: release 2024-03-12 - Reducing noisy logs in WARN but adding more verbose logs when retries have been re-enqueued. (#39169) * azure-cosmos-spark: Reducing noisy logs in WARN but adding more verbose logs when retries have been re-enqueued. * Reacting to code review feedback * Changelogs --- eng/versioning/version_client.txt | 8 +- .../azure-cosmos-spark_3-1_2-12/CHANGELOG.md | 9 +- .../azure-cosmos-spark_3-1_2-12/README.md | 8 +- .../azure-cosmos-spark_3-1_2-12/pom.xml | 2 +- .../azure-cosmos-spark_3-2_2-12/CHANGELOG.md | 9 +- .../azure-cosmos-spark_3-2_2-12/README.md | 8 +- .../azure-cosmos-spark_3-2_2-12/pom.xml | 2 +- .../azure-cosmos-spark_3-3_2-12/CHANGELOG.md | 9 +- .../azure-cosmos-spark_3-3_2-12/README.md | 8 +- .../azure-cosmos-spark_3-3_2-12/pom.xml | 2 +- .../azure-cosmos-spark_3-4_2-12/CHANGELOG.md | 9 +- .../azure-cosmos-spark_3-4_2-12/README.md | 8 +- .../azure-cosmos-spark_3-4_2-12/pom.xml | 2 +- .../docs/quick-start.md | 8 +- .../SparkBridgeImplementationInternal.scala | 57 ++++++++- .../com/azure/cosmos/spark/BulkWriter.scala | 113 +++++++++++------- .../cosmos/spark/CosmosClientCache.scala | 2 +- .../azure/cosmos/spark/CosmosConstants.scala | 2 +- .../com/azure/cosmos/spark/PointWriter.scala | 4 +- .../com/azure/cosmos/CosmosClientBuilder.java | 2 +- .../implementation/RxDocumentClientImpl.java | 2 +- .../implementation/batch/BulkExecutor.java | 107 ++++++++++------- .../batch/BulkExecutorDiagnosticsTracker.java | 1 + 23 files changed, 240 insertions(+), 142 deletions(-) diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index c0689ffd36434..966553551deaf 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -105,10 +105,10 @@ com.azure:azure-cosmos;4.56.0;4.57.0-beta.1 com.azure:azure-cosmos-benchmark;4.0.1-beta.1;4.0.1-beta.1 com.azure:azure-cosmos-dotnet-benchmark;4.0.1-beta.1;4.0.1-beta.1 com.azure.cosmos.spark:azure-cosmos-spark_3_2-12;1.0.0-beta.1;1.0.0-beta.1 -com.azure.cosmos.spark:azure-cosmos-spark_3-1_2-12;4.28.2;4.29.0-beta.1 -com.azure.cosmos.spark:azure-cosmos-spark_3-2_2-12;4.28.2;4.29.0-beta.1 -com.azure.cosmos.spark:azure-cosmos-spark_3-3_2-12;4.28.2;4.29.0-beta.1 -com.azure.cosmos.spark:azure-cosmos-spark_3-4_2-12;4.28.2;4.29.0-beta.1 +com.azure.cosmos.spark:azure-cosmos-spark_3-1_2-12;4.28.2;4.28.3 +com.azure.cosmos.spark:azure-cosmos-spark_3-2_2-12;4.28.2;4.28.3 +com.azure.cosmos.spark:azure-cosmos-spark_3-3_2-12;4.28.2;4.28.3 +com.azure.cosmos.spark:azure-cosmos-spark_3-4_2-12;4.28.2;4.28.3 com.azure:azure-cosmos-encryption;2.8.0;2.9.0-beta.1 com.azure:azure-cosmos-test;1.0.0-beta.6;1.0.0-beta.7 com.azure:azure-cosmos-tests;1.0.0-beta.1;1.0.0-beta.1 diff --git a/sdk/cosmos/azure-cosmos-spark_3-1_2-12/CHANGELOG.md b/sdk/cosmos/azure-cosmos-spark_3-1_2-12/CHANGELOG.md index f5cca589c1e83..73b2b33b19fe5 100644 --- a/sdk/cosmos/azure-cosmos-spark_3-1_2-12/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos-spark_3-1_2-12/CHANGELOG.md @@ -1,14 +1,9 @@ ## Release History -### 4.29.0-beta.1 (Unreleased) - -#### Features Added - -#### Breaking Changes - -#### Bugs Fixed +### 4.28.3 (2024-03-12) #### Other Changes +* Reduced noise level in logs with WARN level but added more verbose logs when retries have been re-enqueued. - See [PR 39169](https://github.com/Azure/azure-sdk-for-java/pull/39169) ### 4.28.2 (2024-03-05) diff --git a/sdk/cosmos/azure-cosmos-spark_3-1_2-12/README.md b/sdk/cosmos/azure-cosmos-spark_3-1_2-12/README.md index cca9ad96c1dcb..416a6d3cca486 100644 --- a/sdk/cosmos/azure-cosmos-spark_3-1_2-12/README.md +++ b/sdk/cosmos/azure-cosmos-spark_3-1_2-12/README.md @@ -29,6 +29,7 @@ https://github.com/Azure/azure-sdk-for-java/issues/new #### azure-cosmos-spark_3-1_2-12 | Connector | Supported Spark Versions | Supported JVM Versions | Supported Scala Versions | Supported Databricks Runtimes | |--------------|--------------------------|------------------------|--------------------------|-------------------------------| +| 4.28.3 | 3.1.1 - 3.1.2 | [8, 11] | 2.12 | 8.\*, 9.\* | | 4.28.2 | 3.1.1 - 3.1.2 | [8, 11] | 2.12 | 8.\*, 9.\* | | 4.28.1 | 3.1.1 - 3.1.2 | [8, 11] | 2.12 | 8.\*, 9.\* | | 4.28.0 | 3.1.1 - 3.1.2 | [8, 11] | 2.12 | 8.\*, 9.\* | @@ -90,6 +91,7 @@ https://github.com/Azure/azure-sdk-for-java/issues/new #### azure-cosmos-spark_3-2_2-12 | Connector | Supported Spark Versions | Supported JVM Versions | Supported Scala Versions | Supported Databricks Runtimes | |-----------|--------------------------|------------------------|--------------------------|-------------------------------| +| 4.28.3 | 3.2.0 - 3.2.1 | [8, 11] | 2.12 | 10.\* | | 4.28.2 | 3.2.0 - 3.2.1 | [8, 11] | 2.12 | 10.\* | | 4.28.1 | 3.2.0 - 3.2.1 | [8, 11] | 2.12 | 10.\* | | 4.28.0 | 3.2.0 - 3.2.1 | [8, 11] | 2.12 | 10.\* | @@ -136,6 +138,7 @@ https://github.com/Azure/azure-sdk-for-java/issues/new #### azure-cosmos-spark_3-3_2-12 | Connector | Supported Spark Versions | Supported JVM Versions | Supported Scala Versions | Supported Databricks Runtimes | |-----------|--------------------------|------------------------|--------------------------|-------------------------------| +| 4.28.3 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | | 4.28.2 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | | 4.28.1 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | | 4.28.0 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | @@ -164,6 +167,7 @@ https://github.com/Azure/azure-sdk-for-java/issues/new #### azure-cosmos-spark_3-4_2-12 | Connector | Supported Spark Versions | Supported JVM Versions | Supported Scala Versions | Supported Databricks Runtimes | |-----------|--------------------------|------------------------|--------------------------|-------------------------------| +| 4.28.3 | 3.4.0 | [8, 11] | 2.12 | 13.\* | | 4.28.2 | 3.4.0 | [8, 11] | 2.12 | 13.\* | | 4.28.1 | 3.4.0 | [8, 11] | 2.12 | 13.\* | | 4.28.0 | 3.4.0 | [8, 11] | 2.12 | 13.\* | @@ -184,11 +188,11 @@ https://github.com/Azure/azure-sdk-for-java/issues/new ### Download You can use the maven coordinate of the jar to auto install the Spark Connector to your Databricks Runtime 8 from Maven: -`com.azure.cosmos.spark:azure-cosmos-spark_3-1_2-12:4.28.2` +`com.azure.cosmos.spark:azure-cosmos-spark_3-1_2-12:4.28.3` You can also integrate against Cosmos DB Spark Connector in your SBT project: ```scala -libraryDependencies += "com.azure.cosmos.spark" % "azure-cosmos-spark_3-1_2-12" % "4.28.2" +libraryDependencies += "com.azure.cosmos.spark" % "azure-cosmos-spark_3-1_2-12" % "4.28.3" ``` Cosmos DB Spark Connector is available on [Maven Central Repo](https://central.sonatype.com/search?namespace=com.azure.cosmos.spark). diff --git a/sdk/cosmos/azure-cosmos-spark_3-1_2-12/pom.xml b/sdk/cosmos/azure-cosmos-spark_3-1_2-12/pom.xml index 999ae9d2e0cd8..348f9bbff12e1 100644 --- a/sdk/cosmos/azure-cosmos-spark_3-1_2-12/pom.xml +++ b/sdk/cosmos/azure-cosmos-spark_3-1_2-12/pom.xml @@ -11,7 +11,7 @@ com.azure.cosmos.spark azure-cosmos-spark_3-1_2-12 - 4.29.0-beta.1 + 4.28.3 jar https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/cosmos/azure-cosmos-spark_3-1_2-12 OLTP Spark 3.1 Connector for Azure Cosmos DB SQL API diff --git a/sdk/cosmos/azure-cosmos-spark_3-2_2-12/CHANGELOG.md b/sdk/cosmos/azure-cosmos-spark_3-2_2-12/CHANGELOG.md index 5247f11da4b1e..f377ec1c5a778 100644 --- a/sdk/cosmos/azure-cosmos-spark_3-2_2-12/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos-spark_3-2_2-12/CHANGELOG.md @@ -1,14 +1,9 @@ ## Release History -### 4.29.0-beta.1 (Unreleased) - -#### Features Added - -#### Breaking Changes - -#### Bugs Fixed +### 4.28.3 (2024-03-12) #### Other Changes +* Reduced noise level in logs with WARN level but added more verbose logs when retries have been re-enqueued. - See [PR 39169](https://github.com/Azure/azure-sdk-for-java/pull/39169) ### 4.28.2 (2024-03-05) diff --git a/sdk/cosmos/azure-cosmos-spark_3-2_2-12/README.md b/sdk/cosmos/azure-cosmos-spark_3-2_2-12/README.md index ebec4445c49b7..d973d3a593037 100644 --- a/sdk/cosmos/azure-cosmos-spark_3-2_2-12/README.md +++ b/sdk/cosmos/azure-cosmos-spark_3-2_2-12/README.md @@ -28,6 +28,7 @@ https://github.com/Azure/azure-sdk-for-java/issues/new #### azure-cosmos-spark_3-2_2-12 | Connector | Supported Spark Versions | Supported JVM Versions | Supported Scala Versions | Supported Databricks Runtimes | |-----------|--------------------------|------------------------|--------------------------|-------------------------------| +| 4.28.3 | 3.2.0 - 3.2.1 | [8, 11] | 2.12 | 10.\* | | 4.28.2 | 3.2.0 - 3.2.1 | [8, 11] | 2.12 | 10.\* | | 4.28.1 | 3.2.0 - 3.2.1 | [8, 11] | 2.12 | 10.\* | | 4.28.0 | 3.2.0 - 3.2.1 | [8, 11] | 2.12 | 10.\* | @@ -74,6 +75,7 @@ https://github.com/Azure/azure-sdk-for-java/issues/new #### azure-cosmos-spark_3-3_2-12 | Connector | Supported Spark Versions | Supported JVM Versions | Supported Scala Versions | Supported Databricks Runtimes | |-----------|--------------------------|------------------------|--------------------------|-------------------------------| +| 4.28.3 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | | 4.28.2 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | | 4.28.1 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | | 4.28.0 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | @@ -102,6 +104,7 @@ https://github.com/Azure/azure-sdk-for-java/issues/new #### azure-cosmos-spark_3-1_2-12 | Connector | Supported Spark Versions | Supported JVM Versions | Supported Scala Versions | Supported Databricks Runtimes | |--------------|--------------------------|------------------------|--------------------------|-------------------------------| +| 4.28.3 | 3.2.0 - 3.2.1 | [8, 11] | 2.12 | 8.\*, 9.\* | | 4.28.2 | 3.2.0 - 3.2.1 | [8, 11] | 2.12 | 8.\*, 9.\* | | 4.28.1 | 3.2.0 - 3.2.1 | [8, 11] | 2.12 | 8.\*, 9.\* | | 4.28.0 | 3.2.0 - 3.2.1 | [8, 11] | 2.12 | 8.\*, 9.\* | @@ -163,6 +166,7 @@ https://github.com/Azure/azure-sdk-for-java/issues/new #### azure-cosmos-spark_3-4_2-12 | Connector | Supported Spark Versions | Supported JVM Versions | Supported Scala Versions | Supported Databricks Runtimes | |-----------|--------------------------|------------------------|--------------------------|-------------------------------| +| 4.28.3 | 3.4.0 | [8, 11] | 2.12 | 13.* | | 4.28.2 | 3.4.0 | [8, 11] | 2.12 | 13.* | | 4.28.1 | 3.4.0 | [8, 11] | 2.12 | 13.* | | 4.28.0 | 3.4.0 | [8, 11] | 2.12 | 13.* | @@ -182,11 +186,11 @@ https://github.com/Azure/azure-sdk-for-java/issues/new ### Download You can use the maven coordinate of the jar to auto install the Spark Connector to your Databricks Runtime 10 from Maven: -`com.azure.cosmos.spark:azure-cosmos-spark_3-2_2-12:4.28.2` +`com.azure.cosmos.spark:azure-cosmos-spark_3-2_2-12:4.28.3` You can also integrate against Cosmos DB Spark Connector in your SBT project: ```scala -libraryDependencies += "com.azure.cosmos.spark" % "azure-cosmos-spark_3-2_2-12" % "4.28.2" +libraryDependencies += "com.azure.cosmos.spark" % "azure-cosmos-spark_3-2_2-12" % "4.28.3" ``` Cosmos DB Spark Connector is available on [Maven Central Repo](https://central.sonatype.com/search?namespace=com.azure.cosmos.spark). diff --git a/sdk/cosmos/azure-cosmos-spark_3-2_2-12/pom.xml b/sdk/cosmos/azure-cosmos-spark_3-2_2-12/pom.xml index 2f3371d4d9921..e810ffb08b59e 100644 --- a/sdk/cosmos/azure-cosmos-spark_3-2_2-12/pom.xml +++ b/sdk/cosmos/azure-cosmos-spark_3-2_2-12/pom.xml @@ -11,7 +11,7 @@ com.azure.cosmos.spark azure-cosmos-spark_3-2_2-12 - 4.29.0-beta.1 + 4.28.3 jar https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/cosmos/azure-cosmos-spark_3-2_2-12 OLTP Spark 3.2 Connector for Azure Cosmos DB SQL API diff --git a/sdk/cosmos/azure-cosmos-spark_3-3_2-12/CHANGELOG.md b/sdk/cosmos/azure-cosmos-spark_3-3_2-12/CHANGELOG.md index 9238b1b0d59a3..556211be419ba 100644 --- a/sdk/cosmos/azure-cosmos-spark_3-3_2-12/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos-spark_3-3_2-12/CHANGELOG.md @@ -1,14 +1,9 @@ ## Release History -### 4.29.0-beta.1 (Unreleased) - -#### Features Added - -#### Breaking Changes - -#### Bugs Fixed +### 4.28.3 (2024-03-12) #### Other Changes +* Reduced noise level in logs with WARN level but added more verbose logs when retries have been re-enqueued. - See [PR 39169](https://github.com/Azure/azure-sdk-for-java/pull/39169) ### 4.28.2 (2024-03-05) diff --git a/sdk/cosmos/azure-cosmos-spark_3-3_2-12/README.md b/sdk/cosmos/azure-cosmos-spark_3-3_2-12/README.md index 45b6ffbf9b735..93169c1208571 100644 --- a/sdk/cosmos/azure-cosmos-spark_3-3_2-12/README.md +++ b/sdk/cosmos/azure-cosmos-spark_3-3_2-12/README.md @@ -28,6 +28,7 @@ https://github.com/Azure/azure-sdk-for-java/issues/new #### azure-cosmos-spark_3-3_2-12 | Connector | Supported Spark Versions | Supported JVM Versions | Supported Scala Versions | Supported Databricks Runtimes | |-----------|--------------------------|------------------------|--------------------------|-------------------------------| +| 4.28.3 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | | 4.28.2 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | | 4.28.1 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | | 4.28.0 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | @@ -56,6 +57,7 @@ https://github.com/Azure/azure-sdk-for-java/issues/new #### azure-cosmos-spark_3-2_2-12 | Connector | Supported Spark Versions | Supported JVM Versions | Supported Scala Versions | Supported Databricks Runtimes | |-----------|--------------------------|------------------------|--------------------------|-------------------------------| +| 4.28.3 | 3.2.0 - 3.2.1 | [8, 11] | 2.12 | 10.\* | | 4.28.2 | 3.2.0 - 3.2.1 | [8, 11] | 2.12 | 10.\* | | 4.28.1 | 3.2.0 - 3.2.1 | [8, 11] | 2.12 | 10.\* | | 4.28.0 | 3.2.0 - 3.2.1 | [8, 11] | 2.12 | 10.\* | @@ -102,6 +104,7 @@ https://github.com/Azure/azure-sdk-for-java/issues/new #### azure-cosmos-spark_3-1_2-12 | Connector | Supported Spark Versions | Supported JVM Versions | Supported Scala Versions | Supported Databricks Runtimes | |--------------|--------------------------|------------------------|--------------------------|-------------------------------| +| 4.28.3 | 3.2.0 - 3.2.1 | [8, 11] | 2.12 | 10.\* | | 4.28.2 | 3.2.0 - 3.2.1 | [8, 11] | 2.12 | 10.\* | | 4.28.1 | 3.2.0 - 3.2.1 | [8, 11] | 2.12 | 10.\* | | 4.28.0 | 3.2.0 - 3.2.1 | [8, 11] | 2.12 | 10.\* | @@ -163,6 +166,7 @@ https://github.com/Azure/azure-sdk-for-java/issues/new #### azure-cosmos-spark_3-4_2-12 | Connector | Supported Spark Versions | Supported JVM Versions | Supported Scala Versions | Supported Databricks Runtimes | |-----------|--------------------------|------------------------|--------------------------|-------------------------------| +| 4.28.3 | 3.4.0 | [8, 11] | 2.12 | 13.* | | 4.28.2 | 3.4.0 | [8, 11] | 2.12 | 13.* | | 4.28.1 | 3.4.0 | [8, 11] | 2.12 | 13.* | | 4.28.0 | 3.4.0 | [8, 11] | 2.12 | 13.* | @@ -182,11 +186,11 @@ https://github.com/Azure/azure-sdk-for-java/issues/new ### Download You can use the maven coordinate of the jar to auto install the Spark Connector to your Databricks Runtime 11 from Maven: -`com.azure.cosmos.spark:azure-cosmos-spark_3-3_2-12:4.28.2` +`com.azure.cosmos.spark:azure-cosmos-spark_3-3_2-12:4.28.3` You can also integrate against Cosmos DB Spark Connector in your SBT project: ```scala -libraryDependencies += "com.azure.cosmos.spark" % "azure-cosmos-spark_3-3_2-12" % "4.28.2" +libraryDependencies += "com.azure.cosmos.spark" % "azure-cosmos-spark_3-3_2-12" % "4.28.3" ``` Cosmos DB Spark Connector is available on [Maven Central Repo](https://central.sonatype.com/search?namespace=com.azure.cosmos.spark). diff --git a/sdk/cosmos/azure-cosmos-spark_3-3_2-12/pom.xml b/sdk/cosmos/azure-cosmos-spark_3-3_2-12/pom.xml index 05d3d29bb7e20..51e26e974238b 100644 --- a/sdk/cosmos/azure-cosmos-spark_3-3_2-12/pom.xml +++ b/sdk/cosmos/azure-cosmos-spark_3-3_2-12/pom.xml @@ -11,7 +11,7 @@ com.azure.cosmos.spark azure-cosmos-spark_3-3_2-12 - 4.29.0-beta.1 + 4.28.3 jar https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/cosmos/azure-cosmos-spark_3-3_2-12 OLTP Spark 3.3 Connector for Azure Cosmos DB SQL API diff --git a/sdk/cosmos/azure-cosmos-spark_3-4_2-12/CHANGELOG.md b/sdk/cosmos/azure-cosmos-spark_3-4_2-12/CHANGELOG.md index 05d98692786f7..c8e1ce708d3ed 100644 --- a/sdk/cosmos/azure-cosmos-spark_3-4_2-12/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos-spark_3-4_2-12/CHANGELOG.md @@ -1,14 +1,9 @@ ## Release History -### 4.29.0-beta.1 (Unreleased) - -#### Features Added - -#### Breaking Changes - -#### Bugs Fixed +### 4.28.3 (2024-03-12) #### Other Changes +* Reduced noise level in logs with WARN level but added more verbose logs when retries have been re-enqueued. - See [PR 39169](https://github.com/Azure/azure-sdk-for-java/pull/39169) ### 4.28.2 (2024-03-05) diff --git a/sdk/cosmos/azure-cosmos-spark_3-4_2-12/README.md b/sdk/cosmos/azure-cosmos-spark_3-4_2-12/README.md index 33f1c9574e99d..9f731eec2fd4f 100644 --- a/sdk/cosmos/azure-cosmos-spark_3-4_2-12/README.md +++ b/sdk/cosmos/azure-cosmos-spark_3-4_2-12/README.md @@ -28,6 +28,7 @@ https://github.com/Azure/azure-sdk-for-java/issues/new #### azure-cosmos-spark_3-4_2-12 | Connector | Supported Spark Versions | Supported JVM Versions | Supported Scala Versions | Supported Databricks Runtimes | |-----------|--------------------------|------------------------|--------------------------|-------------------------------| +| 4.28.3 | 3.4.0 | [8, 11] | 2.12 | 13.* | | 4.28.2 | 3.4.0 | [8, 11] | 2.12 | 13.* | | 4.28.1 | 3.4.0 | [8, 11] | 2.12 | 13.* | | 4.28.0 | 3.4.0 | [8, 11] | 2.12 | 13.* | @@ -47,6 +48,7 @@ https://github.com/Azure/azure-sdk-for-java/issues/new #### azure-cosmos-spark_3-3_2-12 | Connector | Supported Spark Versions | Supported JVM Versions | Supported Scala Versions | Supported Databricks Runtimes | |-----------|--------------------------|------------------------|--------------------------|-------------------------------| +| 4.28.3 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | | 4.28.2 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | | 4.28.1 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | | 4.28.0 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | @@ -75,6 +77,7 @@ https://github.com/Azure/azure-sdk-for-java/issues/new #### azure-cosmos-spark_3-2_2-12 | Connector | Supported Spark Versions | Supported JVM Versions | Supported Scala Versions | Supported Databricks Runtimes | |-----------|--------------------------|------------------------|--------------------------|-------------------------------| +| 4.28.3 | 3.2.0 - 3.2.1 | [8, 11] | 2.12 | 10.\* | | 4.28.2 | 3.2.0 - 3.2.1 | [8, 11] | 2.12 | 10.\* | | 4.28.1 | 3.2.0 - 3.2.1 | [8, 11] | 2.12 | 10.\* | | 4.28.0 | 3.2.0 - 3.2.1 | [8, 11] | 2.12 | 10.\* | @@ -121,6 +124,7 @@ https://github.com/Azure/azure-sdk-for-java/issues/new #### azure-cosmos-spark_3-1_2-12 | Connector | Supported Spark Versions | Supported JVM Versions | Supported Scala Versions | Supported Databricks Runtimes | |--------------|--------------------------|------------------------|--------------------------|-------------------------------| +| 4.28.3 | 3.2.0 - 3.2.1 | [8, 11] | 2.12 | 10.\* | | 4.28.2 | 3.2.0 - 3.2.1 | [8, 11] | 2.12 | 10.\* | | 4.28.1 | 3.2.0 - 3.2.1 | [8, 11] | 2.12 | 10.\* | | 4.28.0 | 3.2.0 - 3.2.1 | [8, 11] | 2.12 | 10.\* | @@ -182,11 +186,11 @@ https://github.com/Azure/azure-sdk-for-java/issues/new ### Download You can use the maven coordinate of the jar to auto install the Spark Connector to your Databricks Runtime 11 from Maven: -`com.azure.cosmos.spark:azure-cosmos-spark_3-4_2-12:4.28.2` +`com.azure.cosmos.spark:azure-cosmos-spark_3-4_2-12:4.28.3` You can also integrate against Cosmos DB Spark Connector in your SBT project: ```scala -libraryDependencies += "com.azure.cosmos.spark" % "azure-cosmos-spark_3-4_2-12" % "4.28.2" +libraryDependencies += "com.azure.cosmos.spark" % "azure-cosmos-spark_3-4_2-12" % "4.28.3" ``` Cosmos DB Spark Connector is available on [Maven Central Repo](https://central.sonatype.com/search?namespace=com.azure.cosmos.spark). diff --git a/sdk/cosmos/azure-cosmos-spark_3-4_2-12/pom.xml b/sdk/cosmos/azure-cosmos-spark_3-4_2-12/pom.xml index 261372acd86e0..129e0e095c9bb 100644 --- a/sdk/cosmos/azure-cosmos-spark_3-4_2-12/pom.xml +++ b/sdk/cosmos/azure-cosmos-spark_3-4_2-12/pom.xml @@ -11,7 +11,7 @@ com.azure.cosmos.spark azure-cosmos-spark_3-4_2-12 - 4.29.0-beta.1 + 4.28.3 jar https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/cosmos/azure-cosmos-spark_3-4_2-12 OLTP Spark 3.4 Connector for Azure Cosmos DB SQL API diff --git a/sdk/cosmos/azure-cosmos-spark_3_2-12/docs/quick-start.md b/sdk/cosmos/azure-cosmos-spark_3_2-12/docs/quick-start.md index 130caf2824bdd..62d7a92b37e36 100644 --- a/sdk/cosmos/azure-cosmos-spark_3_2-12/docs/quick-start.md +++ b/sdk/cosmos/azure-cosmos-spark_3_2-12/docs/quick-start.md @@ -26,16 +26,16 @@ You can use any other Spark 3.1.1 spark offering as well, also you should be abl SLF4J is only needed if you plan to use logging, please also download an SLF4J binding which will link the SLF4J API with the logging implementation of your choice. See the [SLF4J user manual](https://www.slf4j.org/manual.html) for more information. For Spark 3.1: -- Install Cosmos DB Spark Connector, in your spark Cluster [com.azure.cosmos.spark:azure-cosmos-spark_3-1_2-12:4.28.2](https://search.maven.org/artifact/com.azure.cosmos.spark/azure-cosmos-spark_3-1_2-12/4.28.2/jar) +- Install Cosmos DB Spark Connector, in your spark Cluster [com.azure.cosmos.spark:azure-cosmos-spark_3-1_2-12:4.28.3](https://search.maven.org/artifact/com.azure.cosmos.spark/azure-cosmos-spark_3-1_2-12/4.28.3/jar) For Spark 3.2: -- Install Cosmos DB Spark Connector, in your spark Cluster [com.azure.cosmos.spark:azure-cosmos-spark_3-2_2-12:4.28.2](https://search.maven.org/artifact/com.azure.cosmos.spark/azure-cosmos-spark_3-2_2-12/4.28.2/jar) +- Install Cosmos DB Spark Connector, in your spark Cluster [com.azure.cosmos.spark:azure-cosmos-spark_3-2_2-12:4.28.3](https://search.maven.org/artifact/com.azure.cosmos.spark/azure-cosmos-spark_3-2_2-12/4.28.3/jar) For Spark 3.3: -- Install Cosmos DB Spark Connector, in your spark Cluster [com.azure.cosmos.spark:azure-cosmos-spark_3-3_2-12:4.28.2](https://search.maven.org/artifact/com.azure.cosmos.spark/azure-cosmos-spark_3-3_2-12/4.28.2/jar) +- Install Cosmos DB Spark Connector, in your spark Cluster [com.azure.cosmos.spark:azure-cosmos-spark_3-3_2-12:4.28.3](https://search.maven.org/artifact/com.azure.cosmos.spark/azure-cosmos-spark_3-3_2-12/4.28.3/jar) For Spark 3.4: -- Install Cosmos DB Spark Connector, in your spark Cluster [com.azure.cosmos.spark:azure-cosmos-spark_3-4_2-12:4.28.2](https://search.maven.org/artifact/com.azure.cosmos.spark/azure-cosmos-spark_3-4_2-12/4.28.2/jar) +- Install Cosmos DB Spark Connector, in your spark Cluster [com.azure.cosmos.spark:azure-cosmos-spark_3-4_2-12:4.28.3](https://search.maven.org/artifact/com.azure.cosmos.spark/azure-cosmos-spark_3-4_2-12/4.28.3/jar) The getting started guide is based on PySpark however you can use the equivalent scala version as well, and you can run the following code snippet in an Azure Databricks PySpark notebook. diff --git a/sdk/cosmos/azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/implementation/SparkBridgeImplementationInternal.scala b/sdk/cosmos/azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/implementation/SparkBridgeImplementationInternal.scala index a7166244dbf52..b0016b38409b1 100644 --- a/sdk/cosmos/azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/implementation/SparkBridgeImplementationInternal.scala +++ b/sdk/cosmos/azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/implementation/SparkBridgeImplementationInternal.scala @@ -5,11 +5,13 @@ package com.azure.cosmos.implementation import com.azure.cosmos.implementation.ImplementationBridgeHelpers.CosmosClientBuilderHelper import com.azure.cosmos.implementation.changefeed.common.{ChangeFeedMode, ChangeFeedStartFromInternal, ChangeFeedState, ChangeFeedStateV1} +import com.azure.cosmos.implementation.guava25.base.MoreObjects.firstNonNull +import com.azure.cosmos.implementation.guava25.base.Strings.emptyToNull import com.azure.cosmos.implementation.query.CompositeContinuationToken import com.azure.cosmos.implementation.routing.Range import com.azure.cosmos.models.{FeedRange, PartitionKey, PartitionKeyBuilder, PartitionKeyDefinition, SparkModelBridgeInternal} import com.azure.cosmos.spark.diagnostics.BasicLoggingTrait -import com.azure.cosmos.spark.{ChangeFeedOffset, NormalizedRange} +import com.azure.cosmos.spark.{ChangeFeedOffset, CosmosConstants, NormalizedRange} import com.azure.cosmos.{CosmosAsyncClient, CosmosClientBuilder, DirectConnectionConfig, SparkBridgeInternal} import com.fasterxml.jackson.databind.ObjectMapper @@ -21,6 +23,14 @@ import scala.collection.JavaConverters._ // scalastyle:on underscore.import private[cosmos] object SparkBridgeImplementationInternal extends BasicLoggingTrait { + private val SPARK_MAX_CONNECTIONS_PER_ENDPOINT_PROPERTY = "COSMOS.SPARK_MAX_CONNECTIONS_PER_ENDPOINT" + private val SPARK_MAX_CONNECTIONS_PER_ENDPOINT_VARIABLE = "COSMOS_SPARK_MAX_CONNECTIONS_PER_ENDPOINT" + private val DEFAULT_SPARK_MAX_CONNECTIONS_PER_ENDPOINT: Int = DirectConnectionConfig.getDefaultConfig.getMaxConnectionsPerEndpoint + + private val SPARK_IO_THREAD_COUNT_FACTOR_PER_CORE_PROPERTY = "COSMOS.SPARK_IO_THREAD_COUNT_FACTOR_PER_CORE" + private val SPARK_IO_THREAD_COUNT_FACTOR_PER_CORE_VARIABLE = "COSMOS_SPARK_IO_THREAD_COUNT_FACTOR_PER_CORE" + private val DEFAULT_SPARK_IO_THREAD_COUNT_FACTOR_PER_CORE: Int = CosmosConstants.defaultIoThreadCountFactorPerCore + def setMetadataCacheSnapshot(cosmosClientBuilder: CosmosClientBuilder, metadataCache: CosmosClientMetadataCachesSnapshot): Unit = { @@ -356,6 +366,41 @@ private[cosmos] object SparkBridgeImplementationInternal extends BasicLoggingTra ).json() } + private def getMaxConnectionsPerEndpointOverride: Int = { + val maxConnectionsPerEndpointText = System.getProperty( + SPARK_MAX_CONNECTIONS_PER_ENDPOINT_PROPERTY, + firstNonNull( + emptyToNull(System.getenv.get(SPARK_MAX_CONNECTIONS_PER_ENDPOINT_VARIABLE)), + String.valueOf(DEFAULT_SPARK_MAX_CONNECTIONS_PER_ENDPOINT))) + + try { + maxConnectionsPerEndpointText.toInt + } + catch { + case e: Exception => + logError(s"Parsing spark max connections per endpoint failed. Using the default $DEFAULT_SPARK_MAX_CONNECTIONS_PER_ENDPOINT.", e) + DEFAULT_SPARK_MAX_CONNECTIONS_PER_ENDPOINT + } + } + + def getIoThreadCountPerCoreOverride: Int = { + val ioThreadCountPerCoreText = System.getProperty( + SPARK_IO_THREAD_COUNT_FACTOR_PER_CORE_PROPERTY, + firstNonNull( + emptyToNull(System.getenv.get(SPARK_IO_THREAD_COUNT_FACTOR_PER_CORE_VARIABLE)), + String.valueOf(DEFAULT_SPARK_IO_THREAD_COUNT_FACTOR_PER_CORE))) + + try { + ioThreadCountPerCoreText.toInt + } + catch { + case e: Exception => + logError(s"Parsing spark I/O thread-count per core failed. Using the default $DEFAULT_SPARK_IO_THREAD_COUNT_FACTOR_PER_CORE.", e) + DEFAULT_SPARK_IO_THREAD_COUNT_FACTOR_PER_CORE + } + } + + def configureSimpleObjectMapper(allowDuplicateProperties: Boolean) : Unit = { Utils.configureSimpleObjectMapper(allowDuplicateProperties) } @@ -365,22 +410,24 @@ private[cosmos] object SparkBridgeImplementationInternal extends BasicLoggingTra "\"timeoutDetectionTimeLimit\": \"PT90S\", \"timeoutDetectionHighFrequencyThreshold\": 10," + "\"timeoutDetectionHighFrequencyTimeLimit\": \"PT30S\", \"timeoutDetectionOnWriteThreshold\": 10," + "\"timeoutDetectionOnWriteTimeLimit\": \"PT90s\", \"tcpNetworkRequestTimeout\": \"PT7S\", " + - "\"connectTimeout\": \"PT10S\"}" + "\"connectTimeout\": \"PT10S\", \"maxChannelsPerEndpoint\": \"" + + s"$getMaxConnectionsPerEndpointOverride" + + "\"}" if (System.getProperty("reactor.netty.tcp.sslHandshakeTimeout") == null) { - System.setProperty("reactor.netty.tcp.sslHandshakeTimeout", "20000"); + System.setProperty("reactor.netty.tcp.sslHandshakeTimeout", "20000") } if (System.getProperty(Configs.HTTP_MAX_REQUEST_TIMEOUT) == null) { System.setProperty( Configs.HTTP_MAX_REQUEST_TIMEOUT, - "70"); + "70") } if (System.getProperty(Configs.HTTP_DEFAULT_CONNECTION_POOL_SIZE) == null) { System.setProperty( Configs.HTTP_DEFAULT_CONNECTION_POOL_SIZE, - "25000"); + "25000") } if (System.getProperty("azure.cosmos.directTcp.defaultOptions") == null) { diff --git a/sdk/cosmos/azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/spark/BulkWriter.scala b/sdk/cosmos/azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/spark/BulkWriter.scala index 10db85cd86c09..f097230c3deac 100644 --- a/sdk/cosmos/azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/spark/BulkWriter.scala +++ b/sdk/cosmos/azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/spark/BulkWriter.scala @@ -9,7 +9,9 @@ import com.azure.cosmos.implementation.apachecommons.lang.StringUtils import com.azure.cosmos.implementation.batch.{BatchRequestResponseConstants, BulkExecutorDiagnosticsTracker, ItemBulkOperation} import com.azure.cosmos.models._ import com.azure.cosmos.spark.BulkWriter.{BulkOperationFailedException, bulkWriterBoundedElastic, getThreadInfo, readManyBoundedElastic} +import com.azure.cosmos.spark.CosmosConstants.StatusCodes import com.azure.cosmos.spark.diagnostics.DefaultDiagnostics +import reactor.core.Scannable import reactor.core.publisher.Mono import reactor.core.scheduler.Scheduler @@ -55,6 +57,8 @@ private class BulkWriter(container: CosmosAsyncContainer, private val log = LoggerHelper.getLogger(diagnosticsConfig, this.getClass) + private val verboseLoggingAfterReEnqueueingRetriesEnabled = new AtomicBoolean(false) + private val cpuCount = SparkUtils.getNumberOfHostCPUCores // each bulk writer allows up to maxPendingOperations being buffered // there is one bulk writer per spark task/partition @@ -111,9 +115,17 @@ private class BulkWriter(container: CosmosAsyncContainer, maxConcurrentPartitions ) - private class ForwardingMetricTracker extends BulkExecutorDiagnosticsTracker { + private class ForwardingMetricTracker(val verboseLoggingEnabled: AtomicBoolean) extends BulkExecutorDiagnosticsTracker { override def trackDiagnostics(ctx: CosmosDiagnosticsContext): Unit = { - outputMetricsPublisher.trackWriteOperation(0, Option.apply(ctx)) + val ctxOption = Option.apply(ctx) + outputMetricsPublisher.trackWriteOperation(0, ctxOption) + if (ctxOption.isDefined && verboseLoggingEnabled.get) { + BulkWriter.log.logWarning(s"Track bulk operation after re-enqueued retry: ${ctxOption.get.toJson}") + } + } + + override def verboseLoggingAfterReEnqueueingRetriesEnabled(): Boolean = { + verboseLoggingEnabled.get() } } @@ -121,7 +133,7 @@ private class BulkWriter(container: CosmosAsyncContainer, .getCosmosBulkExecutionOptionsAccessor .setDiagnosticsTracker( cosmosBulkExecutionOptions, - new ForwardingMetricTracker + new ForwardingMetricTracker(verboseLoggingAfterReEnqueueingRetriesEnabled) ) ThroughputControlHelper.populateThroughputControlGroupName(cosmosBulkExecutionOptions, writeConfig.throughputControlConfig) @@ -421,7 +433,7 @@ private class BulkWriter(container: CosmosAsyncContainer, // so we are not going to make task complete here if (!activeReadManyOperationFound) { // can't find the read-many operation in list of active operations! - log.logInfo(s"Cannot find active read-many for '" + logInfoOrWarning(s"Cannot find active read-many for '" + s"${readManyOperation.cosmosItemIdentity.getPartitionKey}/" + s"${readManyOperation.cosmosItemIdentity.getId}'. This can happen when " + s"retries get re-enqueued.") @@ -563,7 +575,7 @@ private class BulkWriter(container: CosmosAsyncContainer, if (!itemOperationFound) { // can't find the item operation in list of active operations! - log.logInfo(s"Cannot find active operation for '${itemOperation.getOperationType} " + + logInfoOrWarning(s"Cannot find active operation for '${itemOperation.getOperationType} " + s"${itemOperation.getPartitionKeyValue}/${itemOperation.getId}'. This can happen when " + s"retries get re-enqueued.") shouldSkipTaskCompletion.set(true) @@ -668,7 +680,7 @@ private class BulkWriter(container: CosmosAsyncContainer, operationContext: OperationContext): Unit = { activeTasks.incrementAndGet() if (operationContext.attemptNumber > 1) { - log.logInfo(s"bulk scheduleWrite attemptCnt: ${operationContext.attemptNumber}, " + + logInfoOrWarning(s"bulk scheduleWrite attemptCnt: ${operationContext.attemptNumber}, " + s"Context: ${operationContext.toString} $getThreadInfo") } @@ -923,7 +935,7 @@ private class BulkWriter(container: CosmosAsyncContainer, ) } else { numberOfIntervalsWithIdenticalActiveOperationSnapshots.set(0) - log.logInfo( + logInfoOrWarning( s"$operationName is waiting for active bulkWrite operations: $operationsLog " + s"Context: ${operationContext.toString} $getThreadInfo" ) @@ -966,7 +978,7 @@ private class BulkWriter(container: CosmosAsyncContainer, while ((pendingRetriesSnapshot > 0 || activeTasksSnapshot > 0) && errorCaptureFirstException.get == null) { - log.logInfo( + logInfoOrWarning( s"Waiting for pending activeTasks $activeTasksSnapshot and/or pendingRetries " + s"$pendingRetriesSnapshot, Context: ${operationContext.toString} $getThreadInfo") val activeOperationsSnapshot = activeBulkWriteOperations.clone() @@ -981,9 +993,17 @@ private class BulkWriter(container: CosmosAsyncContainer, ) if (numberOfIntervalsWithIdenticalActiveOperationSnapshots.get == 1L && - // pending retries only tracks the time to enqueue - // the retry - so this should never take longer than 1 minute - pendingRetriesSnapshot == 0L) { + // pending retries only tracks the time to enqueue + // the retry - so this should never take longer than 1 minute + pendingRetriesSnapshot == 0L && + Scannable.from(bulkInputEmitter).scan(Scannable.Attr.BUFFERED) >0) { + + if (verboseLoggingAfterReEnqueueingRetriesEnabled.compareAndSet(false, true)) { + log.logWarning(s"Starting to re-enqueue retries. Enabling verbose logs. " + + s"Attempt: ${numberOfIntervalsWithIdenticalActiveOperationSnapshots.get} - " + + s"Context: ${operationContext.toString} $getThreadInfo") + } + activeOperationsSnapshot.foreach(operation => { if (activeBulkWriteOperations.contains(operation)) { // re-validating whether the operation is still active - if so, just re-enqueue another retry @@ -991,8 +1011,9 @@ private class BulkWriter(container: CosmosAsyncContainer, // For FAIL_NON_SERIALIZED, will keep retry, while for other errors, use the default behavior bulkInputEmitter.emitNext(operation, emitFailureHandler) - log.logInfo(s"Re-enqueued a retry for pending active write task '${operation.getOperationType} " + log.logWarning(s"Re-enqueued a retry for pending active write task '${operation.getOperationType} " + s"(${operation.getPartitionKeyValue}/${operation.getId})' " + + s"- Attempt: ${numberOfIntervalsWithIdenticalActiveOperationSnapshots.get} - " + s"Context: ${operationContext.toString} $getThreadInfo") } }) @@ -1004,8 +1025,9 @@ private class BulkWriter(container: CosmosAsyncContainer, // For FAIL_NON_SERIALIZED, will keep retry, while for other errors, use the default behavior readManyInputEmitterOpt.get.emitNext(operation, emitFailureHandler) - log.logInfo(s"Re-enqueued a retry for pending active read-many task '" + log.logWarning(s"Re-enqueued a retry for pending active read-many task '" + s"(${operation.cosmosItemIdentity.getPartitionKey}/${operation.cosmosItemIdentity.getId})' " + + s"- Attempt: ${numberOfIntervalsWithIdenticalActiveOperationSnapshots.get} - " + s"Context: ${operationContext.toString} $getThreadInfo") } }) @@ -1017,44 +1039,28 @@ private class BulkWriter(container: CosmosAsyncContainer, val semaphoreAvailablePermitsSnapshot = semaphore.availablePermits() if (awaitCompleted) { - log.logInfo(s"Waiting completed for pending activeTasks $activeTasksSnapshot, pendingRetries " + + logInfoOrWarning(s"Waiting completed for pending activeTasks $activeTasksSnapshot, pendingRetries " + s"$pendingRetriesSnapshot Context: ${operationContext.toString} $getThreadInfo") } else { - log.logInfo(s"Waiting interrupted for pending activeTasks $activeTasksSnapshot , pendingRetries " + + logInfoOrWarning(s"Waiting interrupted for pending activeTasks $activeTasksSnapshot , pendingRetries " + s"$pendingRetriesSnapshot - available permits $semaphoreAvailablePermitsSnapshot, " + s"Context: ${operationContext.toString} $getThreadInfo") } } - log.logInfo(s"Waiting completed for pending activeTasks $activeTasksSnapshot, pendingRetries " + + logInfoOrWarning(s"Waiting completed for pending activeTasks $activeTasksSnapshot, pendingRetries " + s"$pendingRetriesSnapshot Context: ${operationContext.toString} $getThreadInfo") } finally { lock.unlock() } - log.logInfo(s"invoking bulkInputEmitter.onComplete(), Context: ${operationContext.toString} $getThreadInfo") + logInfoOrWarning(s"invoking bulkInputEmitter.onComplete(), Context: ${operationContext.toString} $getThreadInfo") semaphore.release(Math.max(0, activeTasks.get())) - val completeBulkWriteEmitResult = bulkInputEmitter.tryEmitComplete() - if (completeBulkWriteEmitResult eq Sinks.EmitResult.OK) { - log.logDebug(s"bulkInputEmitter sink completed, Context: ${operationContext.toString} $getThreadInfo") - } - else { - log.logInfo( - s"bulkInputEmitter sink completion failed. EmitResult: $completeBulkWriteEmitResult +" + - s"Context: ${operationContext.toString} $getThreadInfo") - } + bulkInputEmitter.emitComplete(BulkWriter.emitFailureHandlerForComplete) // complete readManyInputEmitter if (readManyInputEmitterOpt.isDefined) { - val completeReadManyEmitResult = readManyInputEmitterOpt.get.tryEmitComplete() - if (completeReadManyEmitResult eq Sinks.EmitResult.OK) { - log.logDebug(s"bulkInputEmitter sink completed, Context: ${operationContext.toString} $getThreadInfo") - } - else { - log.logInfo( - s"bulkInputEmitter sink completion failed. EmitResult: $completeReadManyEmitResult +" + - s"Context: ${operationContext.toString} $getThreadInfo") - } + readManyInputEmitterOpt.get.emitComplete(BulkWriter.emitFailureHandlerForComplete) } throwIfCapturedExceptionExists() @@ -1070,7 +1076,7 @@ private class BulkWriter(container: CosmosAsyncContainer, s"retries. totalSuccessfulIngestionMetrics=${totalSuccessfulIngestionMetrics.get()}, " + s"totalScheduled=$totalScheduledMetrics, Context: ${operationContext.toString} $getThreadInfo") } else { - log.logInfo(s"flushAndClose completed with no error. " + + logInfoOrWarning(s"flushAndClose completed with no error. " + s"totalSuccessfulIngestionMetrics=${totalSuccessfulIngestionMetrics.get()}, " + s"totalScheduled=$totalScheduledMetrics, Context: ${operationContext.toString} $getThreadInfo") } @@ -1115,6 +1121,14 @@ private class BulkWriter(container: CosmosAsyncContainer, // scalastyle:on method.length // scalastyle:on cyclomatic.complexity + private def logInfoOrWarning(msg: => String): Unit = { + if (this.verboseLoggingAfterReEnqueueingRetriesEnabled.get()) { + log.logWarning(msg) + } else { + log.logInfo(msg) + } + } + private def markTaskCompletion(): Unit = { lock.lock() try { @@ -1142,7 +1156,7 @@ private class BulkWriter(container: CosmosAsyncContainer, } private def cancelWork(): Unit = { - log.logInfo(s"cancelling remaining unprocessed tasks ${activeTasks.get} " + + logInfoOrWarning(s"cancelling remaining unprocessed tasks ${activeTasks.get} " + s"[bulkWrite tasks ${activeBulkWriteOperations.size}, readMany tasks ${activeReadManyOperations.size} ]" + s"Context: ${operationContext.toString}") subscriptionDisposable.dispose() @@ -1173,9 +1187,14 @@ private class BulkWriter(container: CosmosAsyncContainer, returnValue = writeConfig.itemWriteStrategy match { case ItemWriteStrategy.ItemBulkUpdate => this.shouldRetryForItemPatchBulkUpdate(statusCode, subStatusCode) - case _ => Exceptions.canBeTransientFailure(statusCode, subStatusCode) || - statusCode == 0 // Gateway mode reports inability to connect due to - // PoolAcquirePendingLimitException as status code 0 + // Upsert can return 404/0 in rare cases (when due to TTL expiration there is a race condition + case ItemWriteStrategy.ItemOverwrite => + Exceptions.canBeTransientFailure(statusCode, subStatusCode) || + statusCode == 0 || // Gateway mode reports inability to connect due to PoolAcquirePendingLimitException as status code 0 + Exceptions.isNotFoundExceptionCore(statusCode, subStatusCode) + case _ => + Exceptions.canBeTransientFailure(statusCode, subStatusCode) || + statusCode == 0 // Gateway mode reports inability to connect due to PoolAcquirePendingLimitException as status code 0 } } @@ -1273,6 +1292,20 @@ private object BulkWriter { } } + private val emitFailureHandlerForComplete: EmitFailureHandler = + (signalType, emitResult) => { + if (emitResult.equals(EmitResult.FAIL_NON_SERIALIZED)) { + log.logDebug(s"emitFailureHandlerForComplete - Signal: ${signalType.toString}, Result: ${emitResult.toString}") + true + } else if (emitResult.equals(EmitResult.FAIL_CANCELLED) || emitResult.equals(EmitResult.FAIL_TERMINATED)) { + log.logDebug(s"emitFailureHandlerForComplete - Already completed - Signal: ${signalType.toString}, Result: ${emitResult.toString}") + false + } else { + log.logError(s"emitFailureHandlerForComplete - Signal: ${signalType.toString}, Result: ${emitResult.toString}") + false + } + } + private val bulkProcessingThresholds = new CosmosBulkExecutionThresholdsState() // Custom bounded elastic scheduler to switch off IO thread to process response. diff --git a/sdk/cosmos/azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/spark/CosmosClientCache.scala b/sdk/cosmos/azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/spark/CosmosClientCache.scala index 7f92ce8db0855..748ea74004632 100644 --- a/sdk/cosmos/azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/spark/CosmosClientCache.scala +++ b/sdk/cosmos/azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/spark/CosmosClientCache.scala @@ -265,7 +265,7 @@ private[spark] object CosmosClientCache extends BasicLoggingTrait { // indicators that the default number of I/O threads can be too low // for workloads with large payloads SparkBridgeImplementationInternal - .setIoThreadCountPerCoreFactor(directConfig, CosmosConstants.defaultIoThreadCountFactorPerCore) + .setIoThreadCountPerCoreFactor(directConfig, SparkBridgeImplementationInternal.getIoThreadCountPerCoreOverride) directConfig = // Spark workloads often result in very high CPU load diff --git a/sdk/cosmos/azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/spark/CosmosConstants.scala b/sdk/cosmos/azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/spark/CosmosConstants.scala index 6ed778d138ead..65f2b9bfbf294 100644 --- a/sdk/cosmos/azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/spark/CosmosConstants.scala +++ b/sdk/cosmos/azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/spark/CosmosConstants.scala @@ -8,7 +8,7 @@ import com.azure.cosmos.implementation.HttpConstants import reactor.util.concurrent.Queues // cosmos db related constants -private object CosmosConstants { +private[cosmos] object CosmosConstants { private[this] val propertiesFileName = "azure-cosmos-spark.properties" val currentVersion: String = CoreUtils.getProperties(propertiesFileName).get("version") diff --git a/sdk/cosmos/azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/spark/PointWriter.scala b/sdk/cosmos/azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/spark/PointWriter.scala index c22b3c4949a13..6acf3678a1c40 100644 --- a/sdk/cosmos/azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/spark/PointWriter.scala +++ b/sdk/cosmos/azure-cosmos-spark_3_2-12/src/main/scala/com/azure/cosmos/spark/PointWriter.scala @@ -317,7 +317,9 @@ private class PointWriter(container: CosmosAsyncContainer, return } catch { - case e: CosmosException if Exceptions.canBeTransientFailure(e.getStatusCode, e.getSubStatusCode) => + case e: CosmosException if (Exceptions.canBeTransientFailure(e.getStatusCode, e.getSubStatusCode) || + Exceptions.isNotFoundExceptionCore(e.getStatusCode, e.getSubStatusCode) || + e.getStatusCode == 0) => // Gateway mode reports inability to connect due to PoolAcquirePendingLimitException as status code 0 log.logWarning( s"upsert item $upsertOperation attempt #$attempt max remaining retries " + s"${cosmosWriteConfig.maxRetryCount - attempt}, encountered ${e.getMessage}") diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/CosmosClientBuilder.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/CosmosClientBuilder.java index 98d6173869d84..1c30988b6112f 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/CosmosClientBuilder.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/CosmosClientBuilder.java @@ -1232,7 +1232,7 @@ private void logStartupInfo(StopWatch stopwatch, CosmosAsyncClient client) { } // NOTE: if changing the logging below - do not log any confidential info like master key credentials etc. - logger.info("Cosmos Client with (Correlation) ID [{}] started up in [{}] ms with the following " + + logger.warn("Cosmos Client with (Correlation) ID [{}] started up in [{}] ms with the following " + "configuration: serviceEndpoint [{}], preferredRegions [{}], excludedRegions [{}], connectionPolicy [{}], " + "consistencyLevel [{}], contentResponseOnWriteEnabled [{}], sessionCapturingOverride [{}], " + "connectionSharingAcrossClients [{}], clientTelemetryEnabled [{}], proactiveContainerInit [{}], diagnostics [{}], tracing [{}]", diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java index a79f881c8069f..0199e70e5df79 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java @@ -630,7 +630,7 @@ public void init(CosmosClientMetadataCachesSnapshot metadataCachesSnapshot, Func this, this.connectionPolicy.getPreferredRegions()); clientTelemetry.init().thenEmpty((publisher) -> { - logger.info( + logger.warn( "Initialized DocumentClient [{}] with machineId[{}]" + " serviceEndpoint [{}], connectionPolicy [{}], consistencyLevel [{}]", clientId, diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/batch/BulkExecutor.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/batch/BulkExecutor.java index cd322fbfdae58..2f9c50086f1e6 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/batch/BulkExecutor.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/batch/BulkExecutor.java @@ -107,14 +107,14 @@ public final class BulkExecutor implements Disposable { private final AtomicBoolean isDisposed = new AtomicBoolean(false); private final AtomicBoolean isShutdown = new AtomicBoolean(false); private final AtomicInteger totalCount; - private final Sinks.EmitFailureHandler serializedEmitFailureHandler; + private final static Sinks.EmitFailureHandler serializedEmitFailureHandler = new SerializedEmitFailureHandler(); + private final static Sinks.EmitFailureHandler serializedCompleteEmitFailureHandler = new SerializedCompleteEmitFailureHandler();; private final Sinks.Many mainSink; private final List> groupSinks; private final CosmosAsyncClient cosmosClient; private final String bulkSpanName; private final AtomicReference scheduledFutureForFlush; private final String identifier = "BulkExecutor-" + instanceCount.incrementAndGet(); - private final BulkExecutorDiagnosticsTracker diagnosticsTracker; public BulkExecutor(CosmosAsyncContainer container, @@ -163,7 +163,6 @@ public BulkExecutor(CosmosAsyncContainer container, // Initialize sink for handling gone error. mainSourceCompleted = new AtomicBoolean(false); totalCount = new AtomicInteger(0); - serializedEmitFailureHandler = new SerializedEmitFailureHandler(); mainSink = Sinks.many().unicast().onBackpressureBuffer(); groupSinks = new CopyOnWriteArrayList<>(); @@ -217,16 +216,32 @@ private void cancelFlushTask(boolean initializeAggressiveFlush) { if (scheduledFutureSnapshot != null) { try { scheduledFutureSnapshot.dispose(); - logger.debug("Cancelled all future scheduled tasks {}, Context: {}", getThreadInfo(), this.operationContextText); + logDebugOrWarning("Cancelled all future scheduled tasks {}, Context: {}", getThreadInfo(), this.operationContextText); } catch (Exception e) { logger.warn("Failed to cancel scheduled tasks{}, Context: {}", getThreadInfo(), this.operationContextText, e); } } } + private void logInfoOrWarning(String msg, Object... args) { + if (this.diagnosticsTracker == null || !this.diagnosticsTracker.verboseLoggingAfterReEnqueueingRetriesEnabled()) { + logger.info(msg, args); + } else { + logger.warn(msg, args); + } + } + + private void logDebugOrWarning(String msg, Object... args) { + if (this.diagnosticsTracker == null || !this.diagnosticsTracker.verboseLoggingAfterReEnqueueingRetriesEnabled()) { + logger.debug(msg, args); + } else { + logger.warn(msg, args); + } + } + private void shutdown() { if (this.isShutdown.compareAndSet(false, true)) { - logger.debug("Shutting down, Context: {}", this.operationContextText); + logDebugOrWarning("Shutting down, Context: {}", this.operationContextText); groupSinks.forEach(FluxSink::complete); logger.debug("All group sinks completed, Context: {}", this.operationContextText); @@ -240,20 +255,20 @@ public Flux> execute() { .executeCore() .doFinally((SignalType signal) -> { if (signal == SignalType.ON_COMPLETE) { - logger.debug("BulkExecutor.execute flux completed - # left items {}, Context: {}, {}", + logDebugOrWarning("BulkExecutor.execute flux completed - # left items {}, Context: {}, {}", this.totalCount.get(), this.operationContextText, getThreadInfo()); } else { int itemsLeftSnapshot = this.totalCount.get(); if (itemsLeftSnapshot > 0) { - logger.info("BulkExecutor.execute flux terminated - Signal: {} - # left items {}, Context: {}, {}", + logInfoOrWarning("BulkExecutor.execute flux terminated - Signal: {} - # left items {}, Context: {}, {}", signal, itemsLeftSnapshot, this.operationContextText, getThreadInfo()); } else { - logger.debug("BulkExecutor.execute flux terminated - Signal: {} - # left items {}, Context: {}, {}", + logDebugOrWarning("BulkExecutor.execute flux terminated - Signal: {} - # left items {}, Context: {}, {}", signal, itemsLeftSnapshot, this.operationContextText, @@ -294,14 +309,15 @@ private Flux> executeCore() { .subscribeOn(CosmosSchedulers.BULK_EXECUTOR_BOUNDED_ELASTIC) .flatMapMany(maxConcurrentCosmosPartitions -> { - logger.debug("BulkExecutor.execute with MaxConcurrentPartitions: {}, Context: {}", + logDebugOrWarning("BulkExecutor.execute with MaxConcurrentPartitions: {}, Context: {}", maxConcurrentCosmosPartitions, this.operationContextText); return this.inputOperations .publishOn(CosmosSchedulers.BULK_EXECUTOR_BOUNDED_ELASTIC) .onErrorMap(throwable -> { - logger.error("Skipping an error operation while processing. Cause: {}, Context: {}", + logger.error("{}: Skipping an error operation while processing. Cause: {}, Context: {}", + getThreadInfo(), throwable.getMessage(), this.operationContextText, throwable); @@ -309,7 +325,6 @@ private Flux> executeCore() { return throwable; }) .doOnNext((CosmosItemOperation cosmosItemOperation) -> { - // Set the retry policy before starting execution. Should only happens once. BulkExecutorUtil.setRetryPolicyForBulk( docClientWrapper, @@ -333,7 +348,7 @@ private Flux> executeCore() { mainSourceCompleted.set(true); long totalCountSnapshot = totalCount.get(); - logger.debug("Main source completed - # left items {}, Context: {}", + logDebugOrWarning("Main source completed - # left items {}, Context: {}", totalCountSnapshot, this.operationContextText); if (totalCountSnapshot == 0) { @@ -346,7 +361,7 @@ private Flux> executeCore() { this.cancelFlushTask(true); this.onFlush(); - logger.debug("Scheduled new flush operation {}, Context: {}", getThreadInfo(), this.operationContextText); + logDebugOrWarning("Scheduled new flush operation {}, Context: {}", getThreadInfo(), this.operationContextText); } }) .mergeWith(mainSink.asFlux()) @@ -387,7 +402,7 @@ private Flux> executeCore() { if (totalCountAfterDecrement == 0 && mainSourceCompletedSnapshot) { // It is possible that count is zero but there are more elements in the source. // Count 0 also signifies that there are no pending elements in any sink. - logger.debug("All work completed, {}, TotalCount: {}, Context: {} {}", + logDebugOrWarning("All work completed, {}, TotalCount: {}, Context: {} {}", getItemOperationDiagnostics(requestAndResponse.getOperation()), totalCountAfterDecrement, this.operationContextText, @@ -395,7 +410,7 @@ private Flux> executeCore() { completeAllSinks(); } else { if (totalCountAfterDecrement == 0) { - logger.debug( + logDebugOrWarning( "No Work left - but mainSource not yet completed, Context: {} {}", this.operationContextText, getThreadInfo()); @@ -415,10 +430,10 @@ private Flux> executeCore() { if (totalCountSnapshot == 0 && mainSourceCompletedSnapshot) { // It is possible that count is zero but there are more elements in the source. // Count 0 also signifies that there are no pending elements in any sink. - logger.debug("DoOnComplete: All work completed, Context: {}", this.operationContextText); + logDebugOrWarning("DoOnComplete: All work completed, Context: {}", this.operationContextText); completeAllSinks(); } else { - logger.debug( + logDebugOrWarning( "DoOnComplete: Work left - TotalCount after decrement: {}, main sink completed {}, Context: {} {}", totalCountSnapshot, mainSourceCompletedSnapshot, @@ -489,7 +504,7 @@ private Flux> executePartitionedGroup( age >= this.maxMicroBatchIntervalInMs || totalSerializedLength >= this.maxMicroBatchPayloadSizeInBytes) { - logger.debug( + logDebugOrWarning( "BufferUntil - Flushing PKRange {} due to BatchSize ({}), payload size ({}) or age ({}), " + "Triggering {}, Context: {} {}", thresholds.getPartitionKeyRangeId(), @@ -520,7 +535,7 @@ private Flux> executePartitionedGroup( operations.add(itemOperation); } - logger.debug( + logDebugOrWarning( "Flushing PKRange {} micro batch with {} operations, Context: {} {}", thresholds.getPartitionKeyRangeId(), operations.size(), @@ -614,7 +629,7 @@ private Mono> handleTransactionalBatchOper CosmosItemOperation itemOperation = operationResult.getOperation(); TContext actualContext = this.getActualContext(itemOperation); - logger.debug( + logDebugOrWarning( "HandleTransactionalBatchOperationResult - PKRange {}, Response Status Code {}, " + "Operation Status Code, {}, {}, Context: {} {}", thresholds.getPartitionKeyRangeId(), @@ -632,7 +647,7 @@ private Mono> handleTransactionalBatchOper return itemBulkOperation.getRetryPolicy().shouldRetry(operationResult).flatMap( result -> { if (result.shouldRetry) { - logger.debug( + logDebugOrWarning( "HandleTransactionalBatchOperationResult - enqueue retry, PKRange {}, Response " + "Status Code {}, Operation Status Code, {}, {}, Context: {} {}", thresholds.getPartitionKeyRangeId(), @@ -647,7 +662,7 @@ private Mono> handleTransactionalBatchOper if (response.getStatusCode() == HttpConstants.StatusCodes.CONFLICT || response.getStatusCode() == HttpConstants.StatusCodes.PRECONDITION_FAILED) { - logger.debug( + logDebugOrWarning( "HandleTransactionalBatchOperationResult - Fail, PKRange {}, Response Status " + "Code {}, Operation Status Code {}, {}, Context: {} {}", thresholds.getPartitionKeyRangeId(), @@ -709,7 +724,7 @@ private Mono> handleTransactionalBatchExec FluxSink groupSink, PartitionScopeThresholds thresholds) { - logger.debug( + logDebugOrWarning( "HandleTransactionalBatchExecutionException, PKRange {}, Error: {}, {}, Context: {} {}", thresholds.getPartitionKeyRangeId(), exception, @@ -728,7 +743,7 @@ private Mono> handleTransactionalBatchExec .shouldRetryForGone(cosmosException.getStatusCode(), cosmosException.getSubStatusCode(), itemBulkOperation, cosmosException) .flatMap(shouldRetryGone -> { if (shouldRetryGone) { - logger.debug( + logDebugOrWarning( "HandleTransactionalBatchExecutionException - Retry due to split, PKRange {}, Error: " + "{}, {}, Context: {} {}", thresholds.getPartitionKeyRangeId(), @@ -740,7 +755,7 @@ private Mono> handleTransactionalBatchExec mainSink.emitNext(itemOperation, serializedEmitFailureHandler); return Mono.empty(); } else { - logger.debug( + logDebugOrWarning( "HandleTransactionalBatchExecutionException - Retry other, PKRange {}, Error: " + "{}, {}, Context: {} {}", thresholds.getPartitionKeyRangeId(), @@ -864,26 +879,10 @@ private Mono executeBatchRequest(PartitionKeyRangeServerBat } private void completeAllSinks() { - logger.info("Closing all sinks, Context: {}", this.operationContextText); + logInfoOrWarning("Closing all sinks, Context: {}", this.operationContextText); logger.debug("Executor service shut down, Context: {}", this.operationContextText); - Sinks.EmitResult completeEmitResult = mainSink.tryEmitComplete(); - if (completeEmitResult == Sinks.EmitResult.OK) { - logger.debug("Main sink completed, Context: {}", this.operationContextText); - } else { - if (completeEmitResult == Sinks.EmitResult.FAIL_CANCELLED || - completeEmitResult == Sinks.EmitResult.FAIL_TERMINATED) { - - logger.debug("Main sink already completed, EmitResult: {}, Context: {}", - completeEmitResult, - this.operationContextText); - } else { - logger.warn( - "Main sink completion failed. EmitResult: {}, Context: {}", - completeEmitResult, - this.operationContextText); - } - } + mainSink.emitComplete(serializedCompleteEmitFailureHandler); this.shutdown(); } @@ -929,7 +928,7 @@ private static String getThreadInfo() { return sb.toString(); } - private class SerializedEmitFailureHandler implements Sinks.EmitFailureHandler { + private static class SerializedEmitFailureHandler implements Sinks.EmitFailureHandler { @Override public boolean onEmitFailure(SignalType signalType, Sinks.EmitResult emitResult) { @@ -943,4 +942,24 @@ public boolean onEmitFailure(SignalType signalType, Sinks.EmitResult emitResult) return false; } } + + private static class SerializedCompleteEmitFailureHandler implements Sinks.EmitFailureHandler { + + @Override + public boolean onEmitFailure(SignalType signalType, Sinks.EmitResult emitResult) { + if (emitResult.equals(Sinks.EmitResult.FAIL_NON_SERIALIZED)) { + logger.debug("SerializedCompleteEmitFailureHandler.onEmitFailure - Signal:{}, Result: {}", signalType, emitResult); + + return true; + } + + if (emitResult == Sinks.EmitResult.FAIL_CANCELLED || emitResult == Sinks.EmitResult.FAIL_TERMINATED) { + logger.debug("SerializedCompleteEmitFailureHandler.onEmitFailure - Main sink already completed, Signal:{}, Result: {}", signalType, emitResult); + return false; + } + + logger.error("SerializedCompleteEmitFailureHandler.onEmitFailure - Signal:{}, Result: {}", signalType, emitResult); + return false; + } + } } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/batch/BulkExecutorDiagnosticsTracker.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/batch/BulkExecutorDiagnosticsTracker.java index f31047d7f2e8b..ebf490b53ee9f 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/batch/BulkExecutorDiagnosticsTracker.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/batch/BulkExecutorDiagnosticsTracker.java @@ -7,4 +7,5 @@ public interface BulkExecutorDiagnosticsTracker { void trackDiagnostics(CosmosDiagnosticsContext ctx); + boolean verboseLoggingAfterReEnqueueingRetriesEnabled(); } From 1f727e9cc72d0cdcdf94aa65296fac315a441771 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 12 Mar 2024 05:19:09 -0400 Subject: [PATCH 24/90] [Automation] Generate Fluent Lite from storageactions#package-2023-01-01 (#39180) * [Automation] External Change * [Automation] Generate Fluent Lite from storageactions#package-2023-01-01 --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 107 ++ .../SAMPLE.md | 392 +++++ .../pom.xml | 110 ++ .../storageactions/StorageActionsManager.java | 312 ++++ .../fluent/OperationsClient.java | 40 + .../fluent/StorageActionsMgmtClient.java | 76 + .../fluent/StorageTaskAssignmentsClient.java | 48 + .../fluent/StorageTasksClient.java | 324 ++++ .../fluent/StorageTasksReportsClient.java | 49 + .../fluent/models/OperationInner.java | 129 ++ .../models/StorageTaskAssignmentInner.java | 43 + .../fluent/models/StorageTaskInner.java | 124 ++ .../models/StorageTaskPreviewActionInner.java | 64 + .../StorageTaskReportInstanceInner.java | 75 + .../fluent/models/package-info.java | 9 + .../storageactions/fluent/package-info.java | 9 + .../implementation/OperationImpl.java | 51 + .../implementation/OperationsClientImpl.java | 239 +++ .../implementation/OperationsImpl.java | 45 + .../implementation/ResourceManagerUtils.java | 197 +++ .../StorageActionsMgmtClientBuilder.java | 136 ++ .../StorageActionsMgmtClientImpl.java | 335 ++++ .../StorageTaskAssignmentImpl.java | 32 + .../StorageTaskAssignmentsClientImpl.java | 321 ++++ .../StorageTaskAssignmentsImpl.java | 47 + .../implementation/StorageTaskImpl.java | 189 +++ .../StorageTaskPreviewActionImpl.java | 33 + .../StorageTaskReportInstanceImpl.java | 50 + .../StorageTasksClientImpl.java | 1487 +++++++++++++++++ .../implementation/StorageTasksImpl.java | 169 ++ .../StorageTasksReportsClientImpl.java | 330 ++++ .../StorageTasksReportsImpl.java | 48 + .../implementation/package-info.java | 9 + .../storageactions/models/ActionType.java | 48 + .../storageactions/models/ElseCondition.java | 64 + .../storageactions/models/IfCondition.java | 96 ++ .../models/ManagedServiceIdentity.java | 144 ++ .../models/ManagedServiceIdentityType.java | 64 + .../models/MatchedBlockName.java | 58 + .../storageactions/models/OnFailure.java | 56 + .../storageactions/models/OnSuccess.java | 56 + .../storageactions/models/Operation.java | 58 + .../models/OperationDisplay.java | 95 ++ .../models/OperationListResult.java | 64 + .../storageactions/models/Operations.java | 35 + .../storageactions/models/Origin.java | 59 + .../models/ProvisioningState.java | 86 + .../storageactions/models/RunResult.java | 53 + .../storageactions/models/RunStatusEnum.java | 53 + .../storageactions/models/StorageTask.java | 305 ++++ .../models/StorageTaskAction.java | 92 + .../models/StorageTaskAssignment.java | 26 + .../models/StorageTaskAssignments.java | 43 + .../StorageTaskAssignmentsListResult.java | 65 + .../models/StorageTaskOperation.java | 142 ++ .../models/StorageTaskOperationName.java | 78 + .../models/StorageTaskPreviewAction.java | 26 + .../StorageTaskPreviewActionCondition.java | 89 + .../StorageTaskPreviewActionIfCondition.java | 54 + .../StorageTaskPreviewActionProperties.java | 134 ++ .../StorageTaskPreviewBlobProperties.java | 157 ++ ...StorageTaskPreviewContainerProperties.java | 84 + .../StorageTaskPreviewKeyValueProperties.java | 80 + .../models/StorageTaskProperties.java | 165 ++ .../models/StorageTaskReportInstance.java | 55 + .../models/StorageTaskReportProperties.java | 281 ++++ .../models/StorageTaskReportSummary.java | 65 + .../models/StorageTaskUpdateParameters.java | 123 ++ .../storageactions/models/StorageTasks.java | 189 +++ .../models/StorageTasksListResult.java | 65 + .../models/StorageTasksReports.java | 44 + .../models/UserAssignedIdentity.java | 59 + .../storageactions/models/package-info.java | 9 + .../storageactions/package-info.java | 9 + .../src/main/java/module-info.java | 13 + .../proxy-config.json | 1 + .../reflect-config.json | 176 ++ .../generated/OperationsListSamples.java | 24 + .../StorageTaskAssignmentListSamples.java | 25 + .../generated/StorageTasksCreateSamples.java | 58 + .../generated/StorageTasksDeleteSamples.java | 24 + ...StorageTasksGetByResourceGroupSamples.java | 24 + ...torageTasksListByResourceGroupSamples.java | 25 + .../generated/StorageTasksListSamples.java | 25 + .../StorageTasksPreviewActionsSamples.java | 87 + .../StorageTasksReportListSamples.java | 25 + .../generated/StorageTasksUpdateSamples.java | 61 + .../generated/ElseConditionTests.java | 53 + .../generated/IfConditionTests.java | 65 + .../ManagedServiceIdentityTests.java | 43 + .../generated/OperationDisplayTests.java | 23 + .../generated/OperationInnerTests.java | 24 + .../generated/OperationListResultTests.java | 23 + .../generated/OperationsListMockTests.java | 54 + .../generated/StorageTaskActionTests.java | 88 + .../StorageTaskAssignmentInnerTests.java | 22 + .../StorageTaskAssignmentsListMockTests.java | 54 + ...StorageTaskAssignmentsListResultTests.java | 24 + .../generated/StorageTaskInnerTests.java | 122 ++ .../generated/StorageTaskOperationTests.java | 52 + ...torageTaskPreviewActionConditionTests.java | 30 + ...rageTaskPreviewActionIfConditionTests.java | 26 + .../generated/StorageTaskPropertiesTests.java | 94 ++ .../StorageTaskReportInstanceInnerTests.java | 25 + .../StorageTaskReportPropertiesTests.java | 23 + .../StorageTaskReportSummaryTests.java | 23 + .../StorageTaskUpdateParametersTests.java | 118 ++ .../StorageTasksCreateMockTests.java | 106 ++ ...tByResourceGroupWithResponseMockTests.java | 67 + ...rageTasksListByResourceGroupMockTests.java | 69 + .../generated/StorageTasksListMockTests.java | 68 + .../StorageTasksListResultTests.java | 23 + .../StorageTasksReportsListMockTests.java | 55 + .../generated/UserAssignedIdentityTests.java | 23 + .../org.mockito.plugins.MockMaker | 1 + sdk/storageactions/ci.yml | 47 + sdk/storageactions/pom.xml | 15 + 120 files changed, 11192 insertions(+) create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/CHANGELOG.md create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/README.md create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/SAMPLE.md create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/pom.xml create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/StorageActionsManager.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/OperationsClient.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageActionsMgmtClient.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTaskAssignmentsClient.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTasksClient.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTasksReportsClient.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/OperationInner.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskAssignmentInner.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskInner.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskPreviewActionInner.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskReportInstanceInner.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/package-info.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/package-info.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/OperationImpl.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/OperationsClientImpl.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/OperationsImpl.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/ResourceManagerUtils.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageActionsMgmtClientBuilder.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageActionsMgmtClientImpl.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskAssignmentImpl.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskAssignmentsClientImpl.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskAssignmentsImpl.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskImpl.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskPreviewActionImpl.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskReportInstanceImpl.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksClientImpl.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksImpl.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksReportsClientImpl.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksReportsImpl.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/package-info.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ActionType.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ElseCondition.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/IfCondition.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ManagedServiceIdentity.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ManagedServiceIdentityType.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/MatchedBlockName.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OnFailure.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OnSuccess.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/Operation.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OperationDisplay.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OperationListResult.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/Operations.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/Origin.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ProvisioningState.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/RunResult.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/RunStatusEnum.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTask.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAction.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAssignment.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAssignments.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAssignmentsListResult.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskOperation.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskOperationName.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewAction.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewActionCondition.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewActionIfCondition.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewActionProperties.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewBlobProperties.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewContainerProperties.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewKeyValueProperties.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskProperties.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskReportInstance.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskReportProperties.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskReportSummary.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskUpdateParameters.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTasks.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTasksListResult.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTasksReports.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/UserAssignedIdentity.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/package-info.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/package-info.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/module-info.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storageactions/proxy-config.json create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storageactions/reflect-config.json create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/OperationsListSamples.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentListSamples.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksCreateSamples.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksDeleteSamples.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksGetByResourceGroupSamples.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListByResourceGroupSamples.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListSamples.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksPreviewActionsSamples.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksReportListSamples.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksUpdateSamples.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/ElseConditionTests.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/IfConditionTests.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/ManagedServiceIdentityTests.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationDisplayTests.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationInnerTests.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationListResultTests.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationsListMockTests.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskActionTests.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentInnerTests.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentsListMockTests.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentsListResultTests.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskInnerTests.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskOperationTests.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPreviewActionConditionTests.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPreviewActionIfConditionTests.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPropertiesTests.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportInstanceInnerTests.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportPropertiesTests.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportSummaryTests.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskUpdateParametersTests.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksCreateMockTests.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksGetByResourceGroupWithResponseMockTests.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListByResourceGroupMockTests.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListMockTests.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListResultTests.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksReportsListMockTests.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/UserAssignedIdentityTests.java create mode 100644 sdk/storageactions/azure-resourcemanager-storageactions/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker create mode 100644 sdk/storageactions/ci.yml create mode 100644 sdk/storageactions/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 966553551deaf..c1e0233b53456 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -449,6 +449,7 @@ com.azure.resourcemanager:azure-resourcemanager-astro;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-workloadssapvirtualinstance;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-largeinstance;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-migrationdiscoverysap;1.0.0-beta.1;1.0.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-storageactions;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 diff --git a/pom.xml b/pom.xml index 7efa9f98ff664..00c9806689776 100644 --- a/pom.xml +++ b/pom.xml @@ -191,6 +191,7 @@ sdk/springappdiscovery sdk/sqlvirtualmachine sdk/storage + sdk/storageactions sdk/storagecache sdk/storageimportexport sdk/storagemover diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/CHANGELOG.md b/sdk/storageactions/azure-resourcemanager-storageactions/CHANGELOG.md new file mode 100644 index 0000000000000..0001177193c67 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2024-03-12) + +- Azure Resource Manager StorageActions client library for Java. This package contains Microsoft Azure SDK for StorageActions Management SDK. The Azure Storage Actions Management API. Package tag package-2023-01-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/README.md b/sdk/storageactions/azure-resourcemanager-storageactions/README.md new file mode 100644 index 0000000000000..27700ca8178a8 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/README.md @@ -0,0 +1,107 @@ +# Azure Resource Manager StorageActions client library for Java + +Azure Resource Manager StorageActions client library for Java. + +This package contains Microsoft Azure SDK for StorageActions Management SDK. The Azure Storage Actions Management API. Package tag package-2023-01-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-storageactions;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-storageactions + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +With above configuration, `azure` client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +StorageActionsManager manager = StorageActionsManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storageactions/azure-resourcemanager-storageactions/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fstorageactions%2Fazure-resourcemanager-storageactions%2FREADME.png) diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/SAMPLE.md b/sdk/storageactions/azure-resourcemanager-storageactions/SAMPLE.md new file mode 100644 index 0000000000000..dfca5159334b8 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/SAMPLE.md @@ -0,0 +1,392 @@ +# Code snippets and samples + + +## Operations + +- [List](#operations_list) + +## StorageTaskAssignment + +- [List](#storagetaskassignment_list) + +## StorageTasks + +- [Create](#storagetasks_create) +- [Delete](#storagetasks_delete) +- [GetByResourceGroup](#storagetasks_getbyresourcegroup) +- [List](#storagetasks_list) +- [ListByResourceGroup](#storagetasks_listbyresourcegroup) +- [PreviewActions](#storagetasks_previewactions) +- [Update](#storagetasks_update) + +## StorageTasksReport + +- [List](#storagetasksreport_list) +### Operations_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: + * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/misc/ + * OperationsList.json + */ + /** + * Sample code: OperationsList. + * + * @param manager Entry point to StorageActionsManager. + */ + public static void operationsList(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### StorageTaskAssignment_List + +```java +/** + * Samples for StorageTaskAssignment List. + */ +public final class StorageTaskAssignmentListSamples { + /* + * x-ms-original-file: + * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ + * storageTasksList/ListStorageTaskAssignmentIds.json + */ + /** + * Sample code: ListStorageTaskAssignmentsByResourceGroup. + * + * @param manager Entry point to StorageActionsManager. + */ + public static void listStorageTaskAssignmentsByResourceGroup( + com.azure.resourcemanager.storageactions.StorageActionsManager manager) { + manager.storageTaskAssignments().list("rgroup1", "mytask1", null, com.azure.core.util.Context.NONE); + } +} +``` + +### StorageTasks_Create + +```java +import com.azure.resourcemanager.storageactions.models.ElseCondition; +import com.azure.resourcemanager.storageactions.models.IfCondition; +import com.azure.resourcemanager.storageactions.models.OnFailure; +import com.azure.resourcemanager.storageactions.models.OnSuccess; +import com.azure.resourcemanager.storageactions.models.StorageTaskAction; +import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; +import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; +import com.azure.resourcemanager.storageactions.models.StorageTaskProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for StorageTasks Create. + */ +public final class StorageTasksCreateSamples { + /* + * x-ms-original-file: + * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ + * storageTasksCrud/PutStorageTask.json + */ + /** + * Sample code: PutStorageTask. + * + * @param manager Entry point to StorageActionsManager. + */ + public static void putStorageTask(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { + manager.storageTasks().define("mytask1").withRegion("westus").withExistingResourceGroup("res4228") + .withProperties(new StorageTaskProperties().withEnabled(true).withDescription("My Storage task") + .withAction(new StorageTaskAction() + .withIfProperty(new IfCondition().withCondition("[[equals(AccessTier, 'Cool')]]") + .withOperations(Arrays.asList(new StorageTaskOperation() + .withName(StorageTaskOperationName.SET_BLOB_TIER).withParameters(mapOf("tier", "Hot")) + .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))) + .withElseProperty(new ElseCondition().withOperations( + Arrays.asList(new StorageTaskOperation().withName(StorageTaskOperationName.DELETE_BLOB) + .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### StorageTasks_Delete + +```java +/** + * Samples for StorageTasks Delete. + */ +public final class StorageTasksDeleteSamples { + /* + * x-ms-original-file: + * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ + * storageTasksCrud/DeleteStorageTask.json + */ + /** + * Sample code: DeleteStorageTask. + * + * @param manager Entry point to StorageActionsManager. + */ + public static void deleteStorageTask(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { + manager.storageTasks().delete("res4228", "mytask1", com.azure.core.util.Context.NONE); + } +} +``` + +### StorageTasks_GetByResourceGroup + +```java +/** + * Samples for StorageTasks GetByResourceGroup. + */ +public final class StorageTasksGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ + * storageTasksCrud/GetStorageTask.json + */ + /** + * Sample code: GetStorageTask. + * + * @param manager Entry point to StorageActionsManager. + */ + public static void getStorageTask(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { + manager.storageTasks().getByResourceGroupWithResponse("res4228", "mytask1", com.azure.core.util.Context.NONE); + } +} +``` + +### StorageTasks_List + +```java +/** + * Samples for StorageTasks List. + */ +public final class StorageTasksListSamples { + /* + * x-ms-original-file: + * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ + * storageTasksList/ListStorageTasksBySubscription.json + */ + /** + * Sample code: ListStorageTasksBySubscription. + * + * @param manager Entry point to StorageActionsManager. + */ + public static void + listStorageTasksBySubscription(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { + manager.storageTasks().list(com.azure.core.util.Context.NONE); + } +} +``` + +### StorageTasks_ListByResourceGroup + +```java +/** + * Samples for StorageTasks ListByResourceGroup. + */ +public final class StorageTasksListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ + * storageTasksList/ListStorageTasksByResourceGroup.json + */ + /** + * Sample code: ListStorageTasksByResourceGroup. + * + * @param manager Entry point to StorageActionsManager. + */ + public static void + listStorageTasksByResourceGroup(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { + manager.storageTasks().listByResourceGroup("res6117", com.azure.core.util.Context.NONE); + } +} +``` + +### StorageTasks_PreviewActions + +```java +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskPreviewActionInner; +import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionCondition; +import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionIfCondition; +import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionProperties; +import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewBlobProperties; +import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewContainerProperties; +import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewKeyValueProperties; +import java.util.Arrays; + +/** + * Samples for StorageTasks PreviewActions. + */ +public final class StorageTasksPreviewActionsSamples { + /* + * x-ms-original-file: + * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/misc/ + * PerformStorageTaskActionsPreview.json + */ + /** + * Sample code: PerformStorageTaskActionsPreview. + * + * @param manager Entry point to StorageActionsManager. + */ + public static void + performStorageTaskActionsPreview(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { + manager.storageTasks().previewActionsWithResponse("eastus", + new StorageTaskPreviewActionInner().withProperties(new StorageTaskPreviewActionProperties() + .withContainer(new StorageTaskPreviewContainerProperties().withName("firstContainer") + .withMetadata(Arrays.asList(new StorageTaskPreviewKeyValueProperties() + .withKey("fakeTokenPlaceholder").withValue("mContainerValue1")))) + .withBlobs(Arrays.asList( + new StorageTaskPreviewBlobProperties().withName("folder1/file1.txt").withProperties(Arrays.asList( + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("Wed, 07 Jun 2023 05:23:29 GMT"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("Wed, 07 Jun 2023 05:23:29 GMT"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("0x8DB67175454D36D"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue("38619"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("text/xml"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue(""), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue(""), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue(""), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("njr6iDrmU9+FC89WMK22EA=="), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue(""), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue(""), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("BlockBlob"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue("Hot"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue("true"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("unlocked"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("available"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue("true"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue("1"))) + .withMetadata(Arrays.asList(new StorageTaskPreviewKeyValueProperties() + .withKey("fakeTokenPlaceholder").withValue("mValue1"))) + .withTags(Arrays.asList(new StorageTaskPreviewKeyValueProperties() + .withKey("fakeTokenPlaceholder").withValue("tValue1"))), + new StorageTaskPreviewBlobProperties().withName("folder2/file1.txt") + .withProperties(Arrays.asList( + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("Wed, 06 Jun 2023 05:23:29 GMT"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("Wed, 06 Jun 2023 05:23:29 GMT"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("0x6FB67175454D36D"))) + .withMetadata(Arrays.asList(new StorageTaskPreviewKeyValueProperties() + .withKey("fakeTokenPlaceholder").withValue("mValue2"))) + .withTags(Arrays.asList(new StorageTaskPreviewKeyValueProperties() + .withKey("fakeTokenPlaceholder").withValue("tValue2"))))) + .withAction(new StorageTaskPreviewActionCondition() + .withIfProperty( + new StorageTaskPreviewActionIfCondition().withCondition("[[equals(AccessTier, 'Hot')]]")) + .withElseBlockExists(true))), + com.azure.core.util.Context.NONE); + } +} +``` + +### StorageTasks_Update + +```java +import com.azure.resourcemanager.storageactions.models.ElseCondition; +import com.azure.resourcemanager.storageactions.models.IfCondition; +import com.azure.resourcemanager.storageactions.models.OnFailure; +import com.azure.resourcemanager.storageactions.models.OnSuccess; +import com.azure.resourcemanager.storageactions.models.StorageTask; +import com.azure.resourcemanager.storageactions.models.StorageTaskAction; +import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; +import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; +import com.azure.resourcemanager.storageactions.models.StorageTaskProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for StorageTasks Update. + */ +public final class StorageTasksUpdateSamples { + /* + * x-ms-original-file: + * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ + * storageTasksCrud/PatchStorageTask.json + */ + /** + * Sample code: PatchStorageTask. + * + * @param manager Entry point to StorageActionsManager. + */ + public static void patchStorageTask(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { + StorageTask resource = manager.storageTasks() + .getByResourceGroupWithResponse("res4228", "mytask1", com.azure.core.util.Context.NONE).getValue(); + resource.update() + .withProperties(new StorageTaskProperties().withEnabled(true).withDescription("My Storage task") + .withAction(new StorageTaskAction() + .withIfProperty(new IfCondition().withCondition("[[equals(AccessTier, 'Cool')]]") + .withOperations(Arrays.asList(new StorageTaskOperation() + .withName(StorageTaskOperationName.SET_BLOB_TIER).withParameters(mapOf("tier", "Hot")) + .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))) + .withElseProperty(new ElseCondition().withOperations( + Arrays.asList(new StorageTaskOperation().withName(StorageTaskOperationName.DELETE_BLOB) + .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))))) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### StorageTasksReport_List + +```java +/** + * Samples for StorageTasksReport List. + */ +public final class StorageTasksReportListSamples { + /* + * x-ms-original-file: + * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ + * storageTasksList/ListStorageTasksRunReportSummary.json + */ + /** + * Sample code: ListStorageTasksByResourceGroup. + * + * @param manager Entry point to StorageActionsManager. + */ + public static void + listStorageTasksByResourceGroup(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { + manager.storageTasksReports().list("rgroup1", "mytask1", null, null, com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/pom.xml b/sdk/storageactions/azure-resourcemanager-storageactions/pom.xml new file mode 100644 index 0000000000000..8d4738641fa13 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/pom.xml @@ -0,0 +1,110 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-storageactions + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for StorageActions Management + This package contains Microsoft Azure SDK for StorageActions Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Azure Storage Actions Management API. Package tag package-2023-01-01. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + 0 + 0 + true + + + + com.azure + azure-core + 1.47.0 + + + com.azure + azure-core-management + 1.12.0 + + + com.azure + azure-core-test + 1.24.0 + test + + + com.azure + azure-identity + 1.11.3 + test + + + org.junit.jupiter + junit-jupiter-api + 5.9.3 + test + + + org.junit.jupiter + junit-jupiter-engine + 5.9.3 + test + + + org.mockito + mockito-core + 4.11.0 + test + + + net.bytebuddy + byte-buddy + 1.14.8 + test + + + net.bytebuddy + byte-buddy-agent + 1.14.8 + test + + + org.slf4j + slf4j-simple + 1.7.36 + test + + + diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/StorageActionsManager.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/StorageActionsManager.java new file mode 100644 index 0000000000000..a27853009f267 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/StorageActionsManager.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions; + +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.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.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storageactions.fluent.StorageActionsMgmtClient; +import com.azure.resourcemanager.storageactions.implementation.OperationsImpl; +import com.azure.resourcemanager.storageactions.implementation.StorageActionsMgmtClientBuilder; +import com.azure.resourcemanager.storageactions.implementation.StorageTaskAssignmentsImpl; +import com.azure.resourcemanager.storageactions.implementation.StorageTasksImpl; +import com.azure.resourcemanager.storageactions.implementation.StorageTasksReportsImpl; +import com.azure.resourcemanager.storageactions.models.Operations; +import com.azure.resourcemanager.storageactions.models.StorageTaskAssignments; +import com.azure.resourcemanager.storageactions.models.StorageTasks; +import com.azure.resourcemanager.storageactions.models.StorageTasksReports; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Entry point to StorageActionsManager. + * The Azure Storage Actions Management API. + */ +public final class StorageActionsManager { + private Operations operations; + + private StorageTasks storageTasks; + + private StorageTaskAssignments storageTaskAssignments; + + private StorageTasksReports storageTasksReports; + + private final StorageActionsMgmtClient clientObject; + + private StorageActionsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new StorageActionsMgmtClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()).subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval).buildClient(); + } + + /** + * Creates an instance of StorageActions service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the StorageActions service API instance. + */ + public static StorageActionsManager 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 StorageActions service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the StorageActions service API instance. + */ + public static StorageActionsManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new StorageActionsManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create StorageActionsManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new StorageActionsManager.Configurable(); + } + + /** + * The Configurable allowing configurations to be set. + */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + + 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 StorageActions service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the StorageActions service API instance. + */ + public StorageActionsManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder.append("azsdk-java").append("-").append("com.azure.resourcemanager.storageactions") + .append("/").append("1.0.0-beta.1"); + 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 ArmChallengeAuthenticationPolicy(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 StorageActionsManager(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 StorageTasks. It manages StorageTask. + * + * @return Resource collection API of StorageTasks. + */ + public StorageTasks storageTasks() { + if (this.storageTasks == null) { + this.storageTasks = new StorageTasksImpl(clientObject.getStorageTasks(), this); + } + return storageTasks; + } + + /** + * Gets the resource collection API of StorageTaskAssignments. + * + * @return Resource collection API of StorageTaskAssignments. + */ + public StorageTaskAssignments storageTaskAssignments() { + if (this.storageTaskAssignments == null) { + this.storageTaskAssignments + = new StorageTaskAssignmentsImpl(clientObject.getStorageTaskAssignments(), this); + } + return storageTaskAssignments; + } + + /** + * Gets the resource collection API of StorageTasksReports. + * + * @return Resource collection API of StorageTasksReports. + */ + public StorageTasksReports storageTasksReports() { + if (this.storageTasksReports == null) { + this.storageTasksReports = new StorageTasksReportsImpl(clientObject.getStorageTasksReports(), this); + } + return storageTasksReports; + } + + /** + * Gets wrapped service client StorageActionsMgmtClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client StorageActionsMgmtClient. + */ + public StorageActionsMgmtClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/OperationsClient.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/OperationsClient.java new file mode 100644 index 0000000000000..a3947f6b6c4d4 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/OperationsClient.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.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.storageactions.fluent.models.OperationInner; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public interface OperationsClient { + /** + * Lists all of the available Storage Actions Rest API 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 of the available Storage Actions Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageActionsMgmtClient.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageActionsMgmtClient.java new file mode 100644 index 0000000000000..9026d03806e13 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageActionsMgmtClient.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for StorageActionsMgmtClient class. + */ +public interface StorageActionsMgmtClient { + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * 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 StorageTasksClient object to access its operations. + * + * @return the StorageTasksClient object. + */ + StorageTasksClient getStorageTasks(); + + /** + * Gets the StorageTaskAssignmentsClient object to access its operations. + * + * @return the StorageTaskAssignmentsClient object. + */ + StorageTaskAssignmentsClient getStorageTaskAssignments(); + + /** + * Gets the StorageTasksReportsClient object to access its operations. + * + * @return the StorageTasksReportsClient object. + */ + StorageTasksReportsClient getStorageTasksReports(); +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTaskAssignmentsClient.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTaskAssignmentsClient.java new file mode 100644 index 0000000000000..66617b5fe35eb --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTaskAssignmentsClient.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.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.storageactions.fluent.models.StorageTaskAssignmentInner; + +/** + * An instance of this class provides access to all the operations defined in StorageTaskAssignmentsClient. + */ +public interface StorageTaskAssignmentsClient { + /** + * Lists all the storage tasks available under the given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String storageTaskName); + + /** + * Lists all the storage tasks available under the given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the + * list response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String storageTaskName, String maxpagesize, + Context context); +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTasksClient.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTasksClient.java new file mode 100644 index 0000000000000..02c8611c92c59 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTasksClient.java @@ -0,0 +1,324 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.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.storageactions.fluent.models.StorageTaskInner; +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskPreviewActionInner; +import com.azure.resourcemanager.storageactions.models.StorageTaskUpdateParameters; + +/** + * An instance of this class provides access to all the operations defined in StorageTasksClient. + */ +public interface StorageTasksClient { + /** + * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already + * created and a subsequent create request is issued with different properties, the storage task properties will be + * updated. If a storage task is already created and a subsequent create or update request is issued with the exact + * same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to create a Storage 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. + * @return the {@link SyncPoller} for polling of represents Storage Task. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, StorageTaskInner> beginCreate(String resourceGroupName, + String storageTaskName, StorageTaskInner parameters); + + /** + * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already + * created and a subsequent create request is issued with different properties, the storage task properties will be + * updated. If a storage task is already created and a subsequent create or update request is issued with the exact + * same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to create a Storage 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 SyncPoller} for polling of represents Storage Task. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, StorageTaskInner> beginCreate(String resourceGroupName, + String storageTaskName, StorageTaskInner parameters, Context context); + + /** + * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already + * created and a subsequent create request is issued with different properties, the storage task properties will be + * updated. If a storage task is already created and a subsequent create or update request is issued with the exact + * same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to create a Storage 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. + * @return represents Storage Task. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageTaskInner create(String resourceGroupName, String storageTaskName, StorageTaskInner parameters); + + /** + * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already + * created and a subsequent create request is issued with different properties, the storage task properties will be + * updated. If a storage task is already created and a subsequent create or update request is issued with the exact + * same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to create a Storage 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 represents Storage Task. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageTaskInner create(String resourceGroupName, String storageTaskName, StorageTaskInner parameters, + Context context); + + /** + * Delete the storage task resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 storageTaskName); + + /** + * Delete the storage task resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 storageTaskName, Context context); + + /** + * Delete the storage task resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 storageTaskName); + + /** + * Delete the storage task resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 storageTaskName, Context context); + + /** + * Get the storage task properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage task properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String storageTaskName, + Context context); + + /** + * Get the storage task properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageTaskInner getByResourceGroup(String resourceGroupName, String storageTaskName); + + /** + * Update storage task properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to update the storage task 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 represents Storage Task. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, StorageTaskInner> beginUpdate(String resourceGroupName, + String storageTaskName, StorageTaskUpdateParameters parameters); + + /** + * Update storage task properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to update the storage task 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 represents Storage Task. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, StorageTaskInner> beginUpdate(String resourceGroupName, + String storageTaskName, StorageTaskUpdateParameters parameters, Context context); + + /** + * Update storage task properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to update the storage task 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 represents Storage Task. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageTaskInner update(String resourceGroupName, String storageTaskName, StorageTaskUpdateParameters parameters); + + /** + * Update storage task properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to update the storage task 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 represents Storage Task. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageTaskInner update(String resourceGroupName, String storageTaskName, StorageTaskUpdateParameters parameters, + Context context); + + /** + * Lists all the storage tasks available under the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the storage tasks available under the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists all the storage tasks available under the given 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 response from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the storage tasks available under the given 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 response from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Runs the input conditions against input object metadata properties and designates matched objects in response. + * + * @param location The location to perform preview of the actions. + * @param parameters The parameters to preview action condition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Task Preview Action along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response previewActionsWithResponse(String location, + StorageTaskPreviewActionInner parameters, Context context); + + /** + * Runs the input conditions against input object metadata properties and designates matched objects in response. + * + * @param location The location to perform preview of the actions. + * @param parameters The parameters to preview action condition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Task Preview Action. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageTaskPreviewActionInner previewActions(String location, StorageTaskPreviewActionInner parameters); +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTasksReportsClient.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTasksReportsClient.java new file mode 100644 index 0000000000000..659e9de567184 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTasksReportsClient.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.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.storageactions.fluent.models.StorageTaskReportInstanceInner; + +/** + * An instance of this class provides access to all the operations defined in StorageTasksReportsClient. + */ +public interface StorageTasksReportsClient { + /** + * Fetch the storage tasks run report summary for each assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String storageTaskName); + + /** + * Fetch the storage tasks run report summary for each assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the + * list response. + * @param filter Optional. When specified, it can be used to query using reporting 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 fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String storageTaskName, + String maxpagesize, String filter, Context context); +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/OperationInner.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/OperationInner.java new file mode 100644 index 0000000000000..3ec0341cd4d53 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/OperationInner.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storageactions.models.ActionType; +import com.azure.resourcemanager.storageactions.models.OperationDisplay; +import com.azure.resourcemanager.storageactions.models.Origin; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * REST API Operation + * + * Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Fluent +public final class OperationInner { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for + * ARM/control-plane operations. + */ + @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + @JsonProperty(value = "display") + 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" + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private Origin origin; + + /* + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) + private ActionType actionType; + + /** + * Creates an instance of OperationInner class. + */ + public 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 ARM/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; + } + + /** + * Set the display property: Localized display information for this particular operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * 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: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskAssignmentInner.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskAssignmentInner.java new file mode 100644 index 0000000000000..72a68b8e80ac7 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskAssignmentInner.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Fetch the Storage task assignment ARM ids. + */ +@Immutable +public final class StorageTaskAssignmentInner { + /* + * ARM Id of the storage task assignments, associated with the storage tasks. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Creates an instance of StorageTaskAssignmentInner class. + */ + public StorageTaskAssignmentInner() { + } + + /** + * Get the id property: ARM Id of the storage task assignments, associated with the storage tasks. + * + * @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() { + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskInner.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskInner.java new file mode 100644 index 0000000000000..d5a6d0f80e432 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskInner.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentity; +import com.azure.resourcemanager.storageactions.models.StorageTaskProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * Represents Storage Task. + */ +@Fluent +public final class StorageTaskInner extends Resource { + /* + * The managed service identity of the resource. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /* + * Properties of the storage task. + */ + @JsonProperty(value = "properties") + private StorageTaskProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Creates an instance of StorageTaskInner class. + */ + public StorageTaskInner() { + } + + /** + * Get the identity property: The managed service identity of the resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identity of the resource. + * + * @param identity the identity value to set. + * @return the StorageTaskInner object itself. + */ + public StorageTaskInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the properties property: Properties of the storage task. + * + * @return the properties value. + */ + public StorageTaskProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the storage task. + * + * @param properties the properties value to set. + * @return the StorageTaskInner object itself. + */ + public StorageTaskInner withProperties(StorageTaskProperties 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; + } + + /** + * {@inheritDoc} + */ + @Override + public StorageTaskInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public StorageTaskInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskPreviewActionInner.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskPreviewActionInner.java new file mode 100644 index 0000000000000..074be25822de0 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskPreviewActionInner.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Storage Task Preview Action. + */ +@Fluent +public final class StorageTaskPreviewActionInner { + /* + * Properties of the storage task preview. + */ + @JsonProperty(value = "properties", required = true) + private StorageTaskPreviewActionProperties properties; + + /** + * Creates an instance of StorageTaskPreviewActionInner class. + */ + public StorageTaskPreviewActionInner() { + } + + /** + * Get the properties property: Properties of the storage task preview. + * + * @return the properties value. + */ + public StorageTaskPreviewActionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the storage task preview. + * + * @param properties the properties value to set. + * @return the StorageTaskPreviewActionInner object itself. + */ + public StorageTaskPreviewActionInner withProperties(StorageTaskPreviewActionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property properties in model StorageTaskPreviewActionInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageTaskPreviewActionInner.class); +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskReportInstanceInner.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskReportInstanceInner.java new file mode 100644 index 0000000000000..60a7c756a67f4 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskReportInstanceInner.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.storageactions.models.StorageTaskReportProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Storage Tasks run report instance. + */ +@Fluent +public final class StorageTaskReportInstanceInner extends ProxyResource { + /* + * Storage task execution report for a run instance. + */ + @JsonProperty(value = "properties") + private StorageTaskReportProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Creates an instance of StorageTaskReportInstanceInner class. + */ + public StorageTaskReportInstanceInner() { + } + + /** + * Get the properties property: Storage task execution report for a run instance. + * + * @return the properties value. + */ + public StorageTaskReportProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Storage task execution report for a run instance. + * + * @param properties the properties value to set. + * @return the StorageTaskReportInstanceInner object itself. + */ + public StorageTaskReportInstanceInner withProperties(StorageTaskReportProperties 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/package-info.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/package-info.java new file mode 100644 index 0000000000000..62c75a487a6fc --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the inner data models for StorageActionsMgmtClient. + * The Azure Storage Actions Management API. + */ +package com.azure.resourcemanager.storageactions.fluent.models; diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/package-info.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/package-info.java new file mode 100644 index 0000000000000..7f6af6f52cb18 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the service clients for StorageActionsMgmtClient. + * The Azure Storage Actions Management API. + */ +package com.azure.resourcemanager.storageactions.fluent; diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/OperationImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/OperationImpl.java new file mode 100644 index 0000000000000..2d5d3e2b2e363 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/OperationImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.implementation; + +import com.azure.resourcemanager.storageactions.fluent.models.OperationInner; +import com.azure.resourcemanager.storageactions.models.ActionType; +import com.azure.resourcemanager.storageactions.models.Operation; +import com.azure.resourcemanager.storageactions.models.OperationDisplay; +import com.azure.resourcemanager.storageactions.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.storageactions.StorageActionsManager serviceManager; + + OperationImpl(OperationInner innerObject, + com.azure.resourcemanager.storageactions.StorageActionsManager 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.storageactions.StorageActionsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/OperationsClientImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..c492e74f96729 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/OperationsClientImpl.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.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.storageactions.fluent.OperationsClient; +import com.azure.resourcemanager.storageactions.fluent.models.OperationInner; +import com.azure.resourcemanager.storageactions.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 StorageActionsMgmtClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(StorageActionsMgmtClientImpl client) { + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageActionsMgmtClientOperations to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageActionsMgmtCl") + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.StorageActions/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists all of the available Storage Actions Rest API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 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 of the available Storage Actions Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all of the available Storage Actions Rest API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 of the available Storage Actions Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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)); + } + + /** + * Lists all of the available Storage Actions Rest API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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()); + } + + /** + * Lists all of the available Storage Actions Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 + * + * The nextLink 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 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 + * + * The nextLink 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 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/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/OperationsImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..acff497f39d0e --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/OperationsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.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.storageactions.fluent.OperationsClient; +import com.azure.resourcemanager.storageactions.fluent.models.OperationInner; +import com.azure.resourcemanager.storageactions.models.Operation; +import com.azure.resourcemanager.storageactions.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.storageactions.StorageActionsManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.storageactions.StorageActionsManager 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.storageactions.StorageActionsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/ResourceManagerUtils.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/ResourceManagerUtils.java new file mode 100644 index 0000000000000..a2a1d6eff9bd9 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/ResourceManagerUtils.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.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/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageActionsMgmtClientBuilder.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageActionsMgmtClientBuilder.java new file mode 100644 index 0000000000000..e25e23d935952 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageActionsMgmtClientBuilder.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.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 StorageActionsMgmtClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { StorageActionsMgmtClientImpl.class }) +public final class StorageActionsMgmtClientBuilder { + /* + * 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 StorageActionsMgmtClientBuilder. + */ + public StorageActionsMgmtClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the StorageActionsMgmtClientBuilder. + */ + public StorageActionsMgmtClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the StorageActionsMgmtClientBuilder. + */ + public StorageActionsMgmtClientBuilder 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 StorageActionsMgmtClientBuilder. + */ + public StorageActionsMgmtClientBuilder 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 StorageActionsMgmtClientBuilder. + */ + public StorageActionsMgmtClientBuilder 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 StorageActionsMgmtClientBuilder. + */ + public StorageActionsMgmtClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of StorageActionsMgmtClientImpl with the provided parameters. + * + * @return an instance of StorageActionsMgmtClientImpl. + */ + public StorageActionsMgmtClientImpl 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(); + StorageActionsMgmtClientImpl client = new StorageActionsMgmtClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + return client; + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageActionsMgmtClientImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageActionsMgmtClientImpl.java new file mode 100644 index 0000000000000..c912f2df07e65 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageActionsMgmtClientImpl.java @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.implementation; + +import com.azure.core.annotation.ServiceClient; +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.storageactions.fluent.OperationsClient; +import com.azure.resourcemanager.storageactions.fluent.StorageActionsMgmtClient; +import com.azure.resourcemanager.storageactions.fluent.StorageTaskAssignmentsClient; +import com.azure.resourcemanager.storageactions.fluent.StorageTasksClient; +import com.azure.resourcemanager.storageactions.fluent.StorageTasksReportsClient; +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 StorageActionsMgmtClientImpl type. + */ +@ServiceClient(builder = StorageActionsMgmtClientBuilder.class) +public final class StorageActionsMgmtClientImpl implements StorageActionsMgmtClient { + /** + * 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; + } + + /** + * server parameter. + */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Api Version. + */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * The default poll interval for long-running operation. + */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** + * The 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 StorageTasksClient object to access its operations. + */ + private final StorageTasksClient storageTasks; + + /** + * Gets the StorageTasksClient object to access its operations. + * + * @return the StorageTasksClient object. + */ + public StorageTasksClient getStorageTasks() { + return this.storageTasks; + } + + /** + * The StorageTaskAssignmentsClient object to access its operations. + */ + private final StorageTaskAssignmentsClient storageTaskAssignments; + + /** + * Gets the StorageTaskAssignmentsClient object to access its operations. + * + * @return the StorageTaskAssignmentsClient object. + */ + public StorageTaskAssignmentsClient getStorageTaskAssignments() { + return this.storageTaskAssignments; + } + + /** + * The StorageTasksReportsClient object to access its operations. + */ + private final StorageTasksReportsClient storageTasksReports; + + /** + * Gets the StorageTasksReportsClient object to access its operations. + * + * @return the StorageTasksReportsClient object. + */ + public StorageTasksReportsClient getStorageTasksReports() { + return this.storageTasksReports; + } + + /** + * Initializes an instance of StorageActionsMgmtClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + * @param endpoint server parameter. + */ + StorageActionsMgmtClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2023-01-01"; + this.operations = new OperationsClientImpl(this); + this.storageTasks = new StorageTasksClientImpl(this); + this.storageTaskAssignments = new StorageTaskAssignmentsClientImpl(this); + this.storageTasksReports = new StorageTasksReportsClientImpl(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 ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(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(StorageActionsMgmtClientImpl.class); +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskAssignmentImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskAssignmentImpl.java new file mode 100644 index 0000000000000..10a32260d52e5 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskAssignmentImpl.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.implementation; + +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskAssignmentInner; +import com.azure.resourcemanager.storageactions.models.StorageTaskAssignment; + +public final class StorageTaskAssignmentImpl implements StorageTaskAssignment { + private StorageTaskAssignmentInner innerObject; + + private final com.azure.resourcemanager.storageactions.StorageActionsManager serviceManager; + + StorageTaskAssignmentImpl(StorageTaskAssignmentInner innerObject, + com.azure.resourcemanager.storageactions.StorageActionsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public StorageTaskAssignmentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storageactions.StorageActionsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskAssignmentsClientImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskAssignmentsClientImpl.java new file mode 100644 index 0000000000000..e2278b82f4a68 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskAssignmentsClientImpl.java @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.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.storageactions.fluent.StorageTaskAssignmentsClient; +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskAssignmentInner; +import com.azure.resourcemanager.storageactions.models.StorageTaskAssignmentsListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in StorageTaskAssignmentsClient. + */ +public final class StorageTaskAssignmentsClientImpl implements StorageTaskAssignmentsClient { + /** + * The proxy service used to perform REST calls. + */ + private final StorageTaskAssignmentsService service; + + /** + * The service client containing this operation class. + */ + private final StorageActionsMgmtClientImpl client; + + /** + * Initializes an instance of StorageTaskAssignmentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + StorageTaskAssignmentsClientImpl(StorageActionsMgmtClientImpl client) { + this.service = RestProxy.create(StorageTaskAssignmentsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageActionsMgmtClientStorageTaskAssignments to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageActionsMgmtCl") + public interface StorageTaskAssignmentsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks/{storageTaskName}/storageTaskAssignments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageTaskName") String storageTaskName, @QueryParam("$maxpagesize") String maxpagesize, + @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists all the storage tasks available under the given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the + * list response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Tasks operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String storageTaskName, String maxpagesize) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageTaskName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, storageTaskName, + maxpagesize, 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())); + } + + /** + * Lists all the storage tasks available under the given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the + * list response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Tasks operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String storageTaskName, String maxpagesize, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageTaskName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), resourceGroupName, storageTaskName, maxpagesize, + 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)); + } + + /** + * Lists all the storage tasks available under the given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the + * list response. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Tasks operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String storageTaskName, + String maxpagesize) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, storageTaskName, maxpagesize), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the storage tasks available under the given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Tasks operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String storageTaskName) { + final String maxpagesize = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, storageTaskName, maxpagesize), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the storage tasks available under the given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the + * list response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Tasks operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String storageTaskName, + String maxpagesize, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, storageTaskName, maxpagesize, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the storage tasks available under the given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String storageTaskName) { + final String maxpagesize = null; + return new PagedIterable<>(listAsync(resourceGroupName, storageTaskName, maxpagesize)); + } + + /** + * Lists all the storage tasks available under the given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the + * list response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String storageTaskName, + String maxpagesize, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, storageTaskName, maxpagesize, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink 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 from the List Storage Tasks 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 + * + * The nextLink 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 from the List Storage Tasks 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/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskAssignmentsImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskAssignmentsImpl.java new file mode 100644 index 0000000000000..c2b64253600a5 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskAssignmentsImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.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.storageactions.fluent.StorageTaskAssignmentsClient; +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskAssignmentInner; +import com.azure.resourcemanager.storageactions.models.StorageTaskAssignment; +import com.azure.resourcemanager.storageactions.models.StorageTaskAssignments; + +public final class StorageTaskAssignmentsImpl implements StorageTaskAssignments { + private static final ClientLogger LOGGER = new ClientLogger(StorageTaskAssignmentsImpl.class); + + private final StorageTaskAssignmentsClient innerClient; + + private final com.azure.resourcemanager.storageactions.StorageActionsManager serviceManager; + + public StorageTaskAssignmentsImpl(StorageTaskAssignmentsClient innerClient, + com.azure.resourcemanager.storageactions.StorageActionsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String storageTaskName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, storageTaskName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageTaskAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String storageTaskName, + String maxpagesize, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, storageTaskName, maxpagesize, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageTaskAssignmentImpl(inner1, this.manager())); + } + + private StorageTaskAssignmentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storageactions.StorageActionsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskImpl.java new file mode 100644 index 0000000000000..de6f6a9f1079f --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskImpl.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskInner; +import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentity; +import com.azure.resourcemanager.storageactions.models.StorageTask; +import com.azure.resourcemanager.storageactions.models.StorageTaskProperties; +import com.azure.resourcemanager.storageactions.models.StorageTaskUpdateParameters; +import java.util.Collections; +import java.util.Map; + +public final class StorageTaskImpl implements StorageTask, StorageTask.Definition, StorageTask.Update { + private StorageTaskInner innerObject; + + private final com.azure.resourcemanager.storageactions.StorageActionsManager 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 ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public StorageTaskProperties properties() { + return this.innerModel().properties(); + } + + 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 StorageTaskInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storageactions.StorageActionsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String storageTaskName; + + private StorageTaskUpdateParameters updateParameters; + + public StorageTaskImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public StorageTask create() { + this.innerObject = serviceManager.serviceClient().getStorageTasks().create(resourceGroupName, storageTaskName, + this.innerModel(), Context.NONE); + return this; + } + + public StorageTask create(Context context) { + this.innerObject = serviceManager.serviceClient().getStorageTasks().create(resourceGroupName, storageTaskName, + this.innerModel(), context); + return this; + } + + StorageTaskImpl(String name, com.azure.resourcemanager.storageactions.StorageActionsManager serviceManager) { + this.innerObject = new StorageTaskInner(); + this.serviceManager = serviceManager; + this.storageTaskName = name; + } + + public StorageTaskImpl update() { + this.updateParameters = new StorageTaskUpdateParameters(); + return this; + } + + public StorageTask apply() { + this.innerObject = serviceManager.serviceClient().getStorageTasks().update(resourceGroupName, storageTaskName, + updateParameters, Context.NONE); + return this; + } + + public StorageTask apply(Context context) { + this.innerObject = serviceManager.serviceClient().getStorageTasks().update(resourceGroupName, storageTaskName, + updateParameters, context); + return this; + } + + StorageTaskImpl(StorageTaskInner innerObject, + com.azure.resourcemanager.storageactions.StorageActionsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.storageTaskName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "storageTasks"); + } + + public StorageTask refresh() { + this.innerObject = serviceManager.serviceClient().getStorageTasks() + .getByResourceGroupWithResponse(resourceGroupName, storageTaskName, Context.NONE).getValue(); + return this; + } + + public StorageTask refresh(Context context) { + this.innerObject = serviceManager.serviceClient().getStorageTasks() + .getByResourceGroupWithResponse(resourceGroupName, storageTaskName, context).getValue(); + return this; + } + + public StorageTaskImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public StorageTaskImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public StorageTaskImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public StorageTaskImpl withIdentity(ManagedServiceIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateParameters.withIdentity(identity); + return this; + } + } + + public StorageTaskImpl withProperties(StorageTaskProperties properties) { + if (isInCreateMode()) { + this.innerModel().withProperties(properties); + return this; + } else { + this.updateParameters.withProperties(properties); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskPreviewActionImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskPreviewActionImpl.java new file mode 100644 index 0000000000000..2f8e93761fde4 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskPreviewActionImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.implementation; + +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskPreviewActionInner; +import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewAction; +import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionProperties; + +public final class StorageTaskPreviewActionImpl implements StorageTaskPreviewAction { + private StorageTaskPreviewActionInner innerObject; + + private final com.azure.resourcemanager.storageactions.StorageActionsManager serviceManager; + + StorageTaskPreviewActionImpl(StorageTaskPreviewActionInner innerObject, + com.azure.resourcemanager.storageactions.StorageActionsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public StorageTaskPreviewActionProperties properties() { + return this.innerModel().properties(); + } + + public StorageTaskPreviewActionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storageactions.StorageActionsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskReportInstanceImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskReportInstanceImpl.java new file mode 100644 index 0000000000000..da65db288bbaf --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskReportInstanceImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskReportInstanceInner; +import com.azure.resourcemanager.storageactions.models.StorageTaskReportInstance; +import com.azure.resourcemanager.storageactions.models.StorageTaskReportProperties; + +public final class StorageTaskReportInstanceImpl implements StorageTaskReportInstance { + private StorageTaskReportInstanceInner innerObject; + + private final com.azure.resourcemanager.storageactions.StorageActionsManager serviceManager; + + StorageTaskReportInstanceImpl(StorageTaskReportInstanceInner innerObject, + com.azure.resourcemanager.storageactions.StorageActionsManager 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 StorageTaskReportProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public StorageTaskReportInstanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storageactions.StorageActionsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksClientImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksClientImpl.java new file mode 100644 index 0000000000000..7262654f5929a --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksClientImpl.java @@ -0,0 +1,1487 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.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.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.storageactions.fluent.StorageTasksClient; +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskInner; +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskPreviewActionInner; +import com.azure.resourcemanager.storageactions.models.StorageTaskUpdateParameters; +import com.azure.resourcemanager.storageactions.models.StorageTasksListResult; +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 StorageTasksClient. + */ +public final class StorageTasksClientImpl implements StorageTasksClient { + /** + * The proxy service used to perform REST calls. + */ + private final StorageTasksService service; + + /** + * The service client containing this operation class. + */ + private final StorageActionsMgmtClientImpl client; + + /** + * Initializes an instance of StorageTasksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + StorageTasksClientImpl(StorageActionsMgmtClientImpl client) { + this.service + = RestProxy.create(StorageTasksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageActionsMgmtClientStorageTasks to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageActionsMgmtCl") + public interface StorageTasksService { + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks/{storageTaskName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageTaskName") String storageTaskName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") StorageTaskInner parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks/{storageTaskName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageTaskName") String storageTaskName, @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.StorageActions/storageTasks/{storageTaskName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageTaskName") String storageTaskName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks/{storageTaskName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageTaskName") String storageTaskName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") StorageTaskUpdateParameters parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.StorageActions/storageTasks") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.StorageActions/locations/{location}/previewActions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> previewActions(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @BodyParam("application/json") StorageTaskPreviewActionInner parameters, + @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("$host") 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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already + * created and a subsequent create request is issued with different properties, the storage task properties will be + * updated. If a storage task is already created and a subsequent create or update request is issued with the exact + * same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to create a Storage 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 represents Storage Task along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String storageTaskName, + StorageTaskInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageTaskName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), resourceGroupName, storageTaskName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already + * created and a subsequent create request is issued with different properties, the storage task properties will be + * updated. If a storage task is already created and a subsequent create or update request is issued with the exact + * same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to create a Storage 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 represents Storage Task along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String storageTaskName, + StorageTaskInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageTaskName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), resourceGroupName, storageTaskName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + } + + /** + * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already + * created and a subsequent create request is issued with different properties, the storage task properties will be + * updated. If a storage task is already created and a subsequent create or update request is issued with the exact + * same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to create a Storage 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 PollerFlux} for polling of represents Storage Task. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, StorageTaskInner> beginCreateAsync(String resourceGroupName, + String storageTaskName, StorageTaskInner parameters) { + Mono>> mono = createWithResponseAsync(resourceGroupName, storageTaskName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + StorageTaskInner.class, StorageTaskInner.class, this.client.getContext()); + } + + /** + * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already + * created and a subsequent create request is issued with different properties, the storage task properties will be + * updated. If a storage task is already created and a subsequent create or update request is issued with the exact + * same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to create a Storage 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 PollerFlux} for polling of represents Storage Task. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, StorageTaskInner> beginCreateAsync(String resourceGroupName, + String storageTaskName, StorageTaskInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, storageTaskName, parameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + StorageTaskInner.class, StorageTaskInner.class, context); + } + + /** + * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already + * created and a subsequent create request is issued with different properties, the storage task properties will be + * updated. If a storage task is already created and a subsequent create or update request is issued with the exact + * same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to create a Storage 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 SyncPoller} for polling of represents Storage Task. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StorageTaskInner> beginCreate(String resourceGroupName, + String storageTaskName, StorageTaskInner parameters) { + return this.beginCreateAsync(resourceGroupName, storageTaskName, parameters).getSyncPoller(); + } + + /** + * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already + * created and a subsequent create request is issued with different properties, the storage task properties will be + * updated. If a storage task is already created and a subsequent create or update request is issued with the exact + * same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to create a Storage 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 SyncPoller} for polling of represents Storage Task. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StorageTaskInner> beginCreate(String resourceGroupName, + String storageTaskName, StorageTaskInner parameters, Context context) { + return this.beginCreateAsync(resourceGroupName, storageTaskName, parameters, context).getSyncPoller(); + } + + /** + * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already + * created and a subsequent create request is issued with different properties, the storage task properties will be + * updated. If a storage task is already created and a subsequent create or update request is issued with the exact + * same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to create a Storage 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 represents Storage Task on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String storageTaskName, + StorageTaskInner parameters) { + return beginCreateAsync(resourceGroupName, storageTaskName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already + * created and a subsequent create request is issued with different properties, the storage task properties will be + * updated. If a storage task is already created and a subsequent create or update request is issued with the exact + * same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to create a Storage 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 represents Storage Task on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String storageTaskName, + StorageTaskInner parameters, Context context) { + return beginCreateAsync(resourceGroupName, storageTaskName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already + * created and a subsequent create request is issued with different properties, the storage task properties will be + * updated. If a storage task is already created and a subsequent create or update request is issued with the exact + * same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to create a Storage 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 represents Storage Task. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageTaskInner create(String resourceGroupName, String storageTaskName, StorageTaskInner parameters) { + return createAsync(resourceGroupName, storageTaskName, parameters).block(); + } + + /** + * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already + * created and a subsequent create request is issued with different properties, the storage task properties will be + * updated. If a storage task is already created and a subsequent create or update request is issued with the exact + * same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to create a Storage 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 represents Storage Task. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageTaskInner create(String resourceGroupName, String storageTaskName, StorageTaskInner parameters, + Context context) { + return createAsync(resourceGroupName, storageTaskName, parameters, context).block(); + } + + /** + * Delete the storage task resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 storageTaskName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageTaskName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, storageTaskName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the storage task resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if 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 storageTaskName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageTaskName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, storageTaskName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + } + + /** + * Delete the storage task resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 storageTaskName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, storageTaskName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete the storage task resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 storageTaskName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, storageTaskName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete the storage task resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 storageTaskName) { + return this.beginDeleteAsync(resourceGroupName, storageTaskName).getSyncPoller(); + } + + /** + * Delete the storage task resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 storageTaskName, + Context context) { + return this.beginDeleteAsync(resourceGroupName, storageTaskName, context).getSyncPoller(); + } + + /** + * Delete the storage task resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 storageTaskName) { + return beginDeleteAsync(resourceGroupName, storageTaskName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the storage task resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 storageTaskName, Context context) { + return beginDeleteAsync(resourceGroupName, storageTaskName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the storage task resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 storageTaskName) { + deleteAsync(resourceGroupName, storageTaskName).block(); + } + + /** + * Delete the storage task resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 storageTaskName, Context context) { + deleteAsync(resourceGroupName, storageTaskName, context).block(); + } + + /** + * Get the storage task properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage task properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String storageTaskName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageTaskName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, + storageTaskName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the storage task properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage task properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String storageTaskName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageTaskName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, storageTaskName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + } + + /** + * Get the storage task properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage task properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String storageTaskName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, storageTaskName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the storage task properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage task properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String storageTaskName, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, storageTaskName, context).block(); + } + + /** + * Get the storage task properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageTaskInner getByResourceGroup(String resourceGroupName, String storageTaskName) { + return getByResourceGroupWithResponse(resourceGroupName, storageTaskName, Context.NONE).getValue(); + } + + /** + * Update storage task properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to update the storage task 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 represents Storage Task along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String storageTaskName, + StorageTaskUpdateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageTaskName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, storageTaskName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update storage task properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to update the storage task 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 represents Storage Task along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String storageTaskName, + StorageTaskUpdateParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageTaskName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), resourceGroupName, storageTaskName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + } + + /** + * Update storage task properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to update the storage task 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 represents Storage Task. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, StorageTaskInner> beginUpdateAsync(String resourceGroupName, + String storageTaskName, StorageTaskUpdateParameters parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, storageTaskName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + StorageTaskInner.class, StorageTaskInner.class, this.client.getContext()); + } + + /** + * Update storage task properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to update the storage task 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 represents Storage Task. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, StorageTaskInner> beginUpdateAsync(String resourceGroupName, + String storageTaskName, StorageTaskUpdateParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, storageTaskName, parameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + StorageTaskInner.class, StorageTaskInner.class, context); + } + + /** + * Update storage task properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to update the storage task 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 represents Storage Task. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StorageTaskInner> beginUpdate(String resourceGroupName, + String storageTaskName, StorageTaskUpdateParameters parameters) { + return this.beginUpdateAsync(resourceGroupName, storageTaskName, parameters).getSyncPoller(); + } + + /** + * Update storage task properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to update the storage task 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 represents Storage Task. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StorageTaskInner> beginUpdate(String resourceGroupName, + String storageTaskName, StorageTaskUpdateParameters parameters, Context context) { + return this.beginUpdateAsync(resourceGroupName, storageTaskName, parameters, context).getSyncPoller(); + } + + /** + * Update storage task properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to update the storage task 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 represents Storage Task on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String storageTaskName, + StorageTaskUpdateParameters parameters) { + return beginUpdateAsync(resourceGroupName, storageTaskName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update storage task properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to update the storage task 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 represents Storage Task on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String storageTaskName, + StorageTaskUpdateParameters parameters, Context context) { + return beginUpdateAsync(resourceGroupName, storageTaskName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update storage task properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to update the storage task 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 represents Storage Task. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageTaskInner update(String resourceGroupName, String storageTaskName, + StorageTaskUpdateParameters parameters) { + return updateAsync(resourceGroupName, storageTaskName, parameters).block(); + } + + /** + * Update storage task properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide to update the storage task 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 represents Storage Task. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageTaskInner update(String resourceGroupName, String storageTaskName, + StorageTaskUpdateParameters parameters, Context context) { + return updateAsync(resourceGroupName, storageTaskName, parameters, context).block(); + } + + /** + * Lists all the storage tasks available under the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Tasks operation 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 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())); + } + + /** + * Lists all the storage tasks available under the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Tasks operation 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all the storage tasks available under the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Tasks operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the storage tasks available under the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Tasks operation 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 storage tasks available under the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the storage tasks available under the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists all the storage tasks available under the given 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 response from the List Storage Tasks operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, + 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())); + } + + /** + * Lists all the storage tasks available under the given 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 response from the List Storage Tasks operation 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, 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)); + } + + /** + * Lists all the storage tasks available under the given 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 response from the List Storage Tasks operation 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 storage tasks available under the given 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 response from the List Storage Tasks operation 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 storage tasks available under the given 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 response from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the storage tasks available under the given 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 response from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Runs the input conditions against input object metadata properties and designates matched objects in response. + * + * @param location The location to perform preview of the actions. + * @param parameters The parameters to preview action condition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Task Preview Action along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> previewActionsWithResponseAsync(String location, + StorageTaskPreviewActionInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.previewActions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Runs the input conditions against input object metadata properties and designates matched objects in response. + * + * @param location The location to perform preview of the actions. + * @param parameters The parameters to preview action condition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Task Preview Action along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> previewActionsWithResponseAsync(String location, + StorageTaskPreviewActionInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.previewActions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, parameters, accept, context); + } + + /** + * Runs the input conditions against input object metadata properties and designates matched objects in response. + * + * @param location The location to perform preview of the actions. + * @param parameters The parameters to preview action condition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Task Preview Action on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono previewActionsAsync(String location, + StorageTaskPreviewActionInner parameters) { + return previewActionsWithResponseAsync(location, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Runs the input conditions against input object metadata properties and designates matched objects in response. + * + * @param location The location to perform preview of the actions. + * @param parameters The parameters to preview action condition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Task Preview Action along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response previewActionsWithResponse(String location, + StorageTaskPreviewActionInner parameters, Context context) { + return previewActionsWithResponseAsync(location, parameters, context).block(); + } + + /** + * Runs the input conditions against input object metadata properties and designates matched objects in response. + * + * @param location The location to perform preview of the actions. + * @param parameters The parameters to preview action condition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Task Preview Action. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageTaskPreviewActionInner previewActions(String location, StorageTaskPreviewActionInner parameters) { + return previewActionsWithResponse(location, parameters, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink 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 from the List Storage Tasks operation 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 + * + * The nextLink 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 from the List Storage Tasks operation 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 + * + * The nextLink 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 from the List Storage Tasks operation 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 + * + * The nextLink 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 from the List Storage Tasks operation 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/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksImpl.java new file mode 100644 index 0000000000000..361b20f46f6f0 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksImpl.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.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.storageactions.fluent.StorageTasksClient; +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskInner; +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskPreviewActionInner; +import com.azure.resourcemanager.storageactions.models.StorageTask; +import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewAction; +import com.azure.resourcemanager.storageactions.models.StorageTasks; + +public final class StorageTasksImpl implements StorageTasks { + private static final ClientLogger LOGGER = new ClientLogger(StorageTasksImpl.class); + + private final StorageTasksClient innerClient; + + private final com.azure.resourcemanager.storageactions.StorageActionsManager serviceManager; + + public StorageTasksImpl(StorageTasksClient innerClient, + com.azure.resourcemanager.storageactions.StorageActionsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String storageTaskName) { + this.serviceClient().delete(resourceGroupName, storageTaskName); + } + + public void delete(String resourceGroupName, String storageTaskName, Context context) { + this.serviceClient().delete(resourceGroupName, storageTaskName, context); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String storageTaskName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, storageTaskName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new StorageTaskImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public StorageTask getByResourceGroup(String resourceGroupName, String storageTaskName) { + StorageTaskInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, storageTaskName); + if (inner != null) { + return new StorageTaskImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageTaskImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageTaskImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageTaskImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageTaskImpl(inner1, this.manager())); + } + + public Response previewActionsWithResponse(String location, + StorageTaskPreviewActionInner parameters, Context context) { + Response inner + = this.serviceClient().previewActionsWithResponse(location, parameters, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new StorageTaskPreviewActionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public StorageTaskPreviewAction previewActions(String location, StorageTaskPreviewActionInner parameters) { + StorageTaskPreviewActionInner inner = this.serviceClient().previewActions(location, parameters); + if (inner != null) { + return new StorageTaskPreviewActionImpl(inner, this.manager()); + } else { + return null; + } + } + + public StorageTask 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 storageTaskName = ResourceManagerUtils.getValueFromIdByName(id, "storageTasks"); + if (storageTaskName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageTasks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, storageTaskName, 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 storageTaskName = ResourceManagerUtils.getValueFromIdByName(id, "storageTasks"); + if (storageTaskName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageTasks'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, storageTaskName, 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 storageTaskName = ResourceManagerUtils.getValueFromIdByName(id, "storageTasks"); + if (storageTaskName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageTasks'.", id))); + } + this.delete(resourceGroupName, storageTaskName, 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 storageTaskName = ResourceManagerUtils.getValueFromIdByName(id, "storageTasks"); + if (storageTaskName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storageTasks'.", id))); + } + this.delete(resourceGroupName, storageTaskName, context); + } + + private StorageTasksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storageactions.StorageActionsManager manager() { + return this.serviceManager; + } + + public StorageTaskImpl define(String name) { + return new StorageTaskImpl(name, this.manager()); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksReportsClientImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksReportsClientImpl.java new file mode 100644 index 0000000000000..a4e5f968c98ca --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksReportsClientImpl.java @@ -0,0 +1,330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.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.storageactions.fluent.StorageTasksReportsClient; +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskReportInstanceInner; +import com.azure.resourcemanager.storageactions.models.StorageTaskReportSummary; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in StorageTasksReportsClient. + */ +public final class StorageTasksReportsClientImpl implements StorageTasksReportsClient { + /** + * The proxy service used to perform REST calls. + */ + private final StorageTasksReportsService service; + + /** + * The service client containing this operation class. + */ + private final StorageActionsMgmtClientImpl client; + + /** + * Initializes an instance of StorageTasksReportsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + StorageTasksReportsClientImpl(StorageActionsMgmtClientImpl client) { + this.service = RestProxy.create(StorageTasksReportsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageActionsMgmtClientStorageTasksReports to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "StorageActionsMgmtCl") + public interface StorageTasksReportsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks/{storageTaskName}/reports") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageTaskName") String storageTaskName, @QueryParam("$maxpagesize") String maxpagesize, + @QueryParam("$filter") String filter, @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Fetch the storage tasks run report summary for each assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the + * list response. + * @param filter Optional. When specified, it can be used to query using reporting 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 fetch Storage Tasks Run Summary along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String storageTaskName, String maxpagesize, String filter) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageTaskName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, storageTaskName, + maxpagesize, filter, 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())); + } + + /** + * Fetch the storage tasks run report summary for each assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the + * list response. + * @param filter Optional. When specified, it can be used to query using reporting 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 fetch Storage Tasks Run Summary along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String storageTaskName, String maxpagesize, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageTaskName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), resourceGroupName, storageTaskName, maxpagesize, filter, + 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)); + } + + /** + * Fetch the storage tasks run report summary for each assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the + * list response. + * @param filter Optional. When specified, it can be used to query using reporting 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 fetch Storage Tasks Run Summary as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String storageTaskName, + String maxpagesize, String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, storageTaskName, maxpagesize, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Fetch the storage tasks run report summary for each assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return fetch Storage Tasks Run Summary as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String storageTaskName) { + final String maxpagesize = null; + final String filter = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, storageTaskName, maxpagesize, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Fetch the storage tasks run report summary for each assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the + * list response. + * @param filter Optional. When specified, it can be used to query using reporting 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 fetch Storage Tasks Run Summary as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String storageTaskName, + String maxpagesize, String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, storageTaskName, maxpagesize, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Fetch the storage tasks run report summary for each assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String storageTaskName) { + final String maxpagesize = null; + final String filter = null; + return new PagedIterable<>(listAsync(resourceGroupName, storageTaskName, maxpagesize, filter)); + } + + /** + * Fetch the storage tasks run report summary for each assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the + * list response. + * @param filter Optional. When specified, it can be used to query using reporting 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 fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String storageTaskName, + String maxpagesize, String filter, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, storageTaskName, maxpagesize, filter, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink 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 fetch Storage Tasks Run Summary 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 + * + * The nextLink 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 fetch Storage Tasks Run Summary 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/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksReportsImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksReportsImpl.java new file mode 100644 index 0000000000000..da4b7f2af0690 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksReportsImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.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.storageactions.fluent.StorageTasksReportsClient; +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskReportInstanceInner; +import com.azure.resourcemanager.storageactions.models.StorageTaskReportInstance; +import com.azure.resourcemanager.storageactions.models.StorageTasksReports; + +public final class StorageTasksReportsImpl implements StorageTasksReports { + private static final ClientLogger LOGGER = new ClientLogger(StorageTasksReportsImpl.class); + + private final StorageTasksReportsClient innerClient; + + private final com.azure.resourcemanager.storageactions.StorageActionsManager serviceManager; + + public StorageTasksReportsImpl(StorageTasksReportsClient innerClient, + com.azure.resourcemanager.storageactions.StorageActionsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String storageTaskName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, storageTaskName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageTaskReportInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String storageTaskName, + String maxpagesize, String filter, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, storageTaskName, maxpagesize, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageTaskReportInstanceImpl(inner1, this.manager())); + } + + private StorageTasksReportsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storageactions.StorageActionsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/package-info.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/package-info.java new file mode 100644 index 0000000000000..6d2cd3579d35c --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the implementations for StorageActionsMgmtClient. + * The Azure Storage Actions Management API. + */ +package com.azure.resourcemanager.storageactions.implementation; diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ActionType.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ActionType.java new file mode 100644 index 0000000000000..5129290ef94f5 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ActionType.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ +public final class ActionType extends ExpandableStringEnum { + /** + * Static value Internal for ActionType. + */ + 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. + */ + @JsonCreator + 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/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ElseCondition.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ElseCondition.java new file mode 100644 index 0000000000000..4b0c596d8e0ea --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ElseCondition.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The else block of storage task operation. + */ +@Fluent +public final class ElseCondition { + /* + * List of operations to execute in the else block + */ + @JsonProperty(value = "operations", required = true) + private List operations; + + /** + * Creates an instance of ElseCondition class. + */ + public ElseCondition() { + } + + /** + * Get the operations property: List of operations to execute in the else block. + * + * @return the operations value. + */ + public List operations() { + return this.operations; + } + + /** + * Set the operations property: List of operations to execute in the else block. + * + * @param operations the operations value to set. + * @return the ElseCondition object itself. + */ + public ElseCondition withOperations(List operations) { + this.operations = operations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (operations() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property operations in model ElseCondition")); + } else { + operations().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ElseCondition.class); +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/IfCondition.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/IfCondition.java new file mode 100644 index 0000000000000..a363a36398718 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/IfCondition.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The if block of storage task operation. + */ +@Fluent +public final class IfCondition { + /* + * The condition predicate which is composed of object properties, eg: blob and container properties. + */ + @JsonProperty(value = "condition", required = true) + private String condition; + + /* + * List of operations to execute when the condition predicate satisfies. + */ + @JsonProperty(value = "operations", required = true) + private List operations; + + /** + * Creates an instance of IfCondition class. + */ + public IfCondition() { + } + + /** + * Get the condition property: The condition predicate which is composed of object properties, eg: blob and + * container properties. + * + * @return the condition value. + */ + public String condition() { + return this.condition; + } + + /** + * Set the condition property: The condition predicate which is composed of object properties, eg: blob and + * container properties. + * + * @param condition the condition value to set. + * @return the IfCondition object itself. + */ + public IfCondition withCondition(String condition) { + this.condition = condition; + return this; + } + + /** + * Get the operations property: List of operations to execute when the condition predicate satisfies. + * + * @return the operations value. + */ + public List operations() { + return this.operations; + } + + /** + * Set the operations property: List of operations to execute when the condition predicate satisfies. + * + * @param operations the operations value to set. + * @return the IfCondition object itself. + */ + public IfCondition withOperations(List operations) { + this.operations = operations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (condition() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property condition in model IfCondition")); + } + if (operations() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property operations in model IfCondition")); + } else { + operations().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IfCondition.class); +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ManagedServiceIdentity.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ManagedServiceIdentity.java new file mode 100644 index 0000000000000..15812da9a726b --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ManagedServiceIdentity.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; +import java.util.UUID; + +/** + * Managed service identity (system assigned and/or user assigned identities). + */ +@Fluent +public final class ManagedServiceIdentity { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private UUID tenantId; + + /* + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ + @JsonProperty(value = "type", required = true) + private ManagedServiceIdentityType type; + + /* + * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/ + * userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** + * Creates an instance of ManagedServiceIdentity class. + */ + public ManagedServiceIdentity() { + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided + * for a system assigned identity. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.tenantId; + } + + /** + * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property type in model ManagedServiceIdentity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ManagedServiceIdentityType.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ManagedServiceIdentityType.java new file mode 100644 index 0000000000000..bd4fc1a5846f2 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ManagedServiceIdentityType.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** + * Static value None for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** + * Static value SystemAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * Static value UserAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * Static value SystemAssigned,UserAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED + = fromString("SystemAssigned,UserAssigned"); + + /** + * Creates a new instance of ManagedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedServiceIdentityType() { + } + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + @JsonCreator + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/MatchedBlockName.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/MatchedBlockName.java new file mode 100644 index 0000000000000..cc83e3e4c555b --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/MatchedBlockName.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Represents the condition block name that matched blob properties. + */ +public final class MatchedBlockName extends ExpandableStringEnum { + /** + * Static value If for MatchedBlockName. + */ + public static final MatchedBlockName IF = fromString("If"); + + /** + * Static value Else for MatchedBlockName. + */ + public static final MatchedBlockName ELSE = fromString("Else"); + + /** + * Static value None for MatchedBlockName. + */ + public static final MatchedBlockName NONE = fromString("None"); + + /** + * Creates a new instance of MatchedBlockName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MatchedBlockName() { + } + + /** + * Creates or finds a MatchedBlockName from its string representation. + * + * @param name a name to look for. + * @return the corresponding MatchedBlockName. + */ + @JsonCreator + public static MatchedBlockName fromString(String name) { + return fromString(name, MatchedBlockName.class); + } + + /** + * Gets known MatchedBlockName values. + * + * @return known MatchedBlockName values. + */ + public static Collection values() { + return values(MatchedBlockName.class); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OnFailure.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OnFailure.java new file mode 100644 index 0000000000000..eb9692b813440 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OnFailure.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Action to be taken when the operation fails for a object. + */ +public enum OnFailure { + /** + * Enum value break. + */ + BREAK("break"); + + /** + * The actual serialized value for a OnFailure instance. + */ + private final String value; + + OnFailure(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OnFailure instance. + * + * @param value the serialized value to parse. + * @return the parsed OnFailure object, or null if unable to parse. + */ + @JsonCreator + public static OnFailure fromString(String value) { + if (value == null) { + return null; + } + OnFailure[] items = OnFailure.values(); + for (OnFailure item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OnSuccess.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OnSuccess.java new file mode 100644 index 0000000000000..4b618d23ea42b --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OnSuccess.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Action to be taken when the operation is successful for a object. + */ +public enum OnSuccess { + /** + * Enum value continue. + */ + CONTINUE("continue"); + + /** + * The actual serialized value for a OnSuccess instance. + */ + private final String value; + + OnSuccess(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OnSuccess instance. + * + * @param value the serialized value to parse. + * @return the parsed OnSuccess object, or null if unable to parse. + */ + @JsonCreator + public static OnSuccess fromString(String value) { + if (value == null) { + return null; + } + OnSuccess[] items = OnSuccess.values(); + for (OnSuccess item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/Operation.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/Operation.java new file mode 100644 index 0000000000000..6466484007cef --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/Operation.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.resourcemanager.storageactions.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 ARM/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: 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.storageactions.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OperationDisplay.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OperationDisplay.java new file mode 100644 index 0000000000000..d47e35ef4b9c1 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OperationDisplay.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Localized display information for this particular operation. + */ +@Immutable +public final class OperationDisplay { + /* + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft + * Compute". + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /* + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job + * Schedule Collections". + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual + * Machine", "Restart Virtual Machine". + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Creates an instance of OperationDisplay class. + */ + public 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OperationListResult.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OperationListResult.java new file mode 100644 index 0000000000000..09ade72575cc5 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OperationListResult.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.storageactions.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + /* + * List of operations supported by the resource provider + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Creates an instance of OperationListResult class. + */ + public OperationListResult() { + } + + /** + * Get the value property: List of operations supported by the 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/Operations.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/Operations.java new file mode 100644 index 0000000000000..4d166f077ba75 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/Operations.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of Operations. + */ +public interface Operations { + /** + * Lists all of the available Storage Actions Rest API 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 of the available Storage Actions Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/Origin.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/Origin.java new file mode 100644 index 0000000000000..e483681b4c670 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/Origin.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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 { + /** + * Static value user for Origin. + */ + public static final Origin USER = fromString("user"); + + /** + * Static value system for Origin. + */ + public static final Origin SYSTEM = fromString("system"); + + /** + * Static value user,system for Origin. + */ + 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. + */ + @JsonCreator + 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/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ProvisioningState.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ProvisioningState.java new file mode 100644 index 0000000000000..a85d88f2bae28 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ProvisioningState.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Represents the provisioning state of the storage task. + */ +public enum ProvisioningState { + /** + * Enum value ValidateSubscriptionQuotaBegin. + */ + VALIDATE_SUBSCRIPTION_QUOTA_BEGIN("ValidateSubscriptionQuotaBegin"), + + /** + * Enum value ValidateSubscriptionQuotaEnd. + */ + VALIDATE_SUBSCRIPTION_QUOTA_END("ValidateSubscriptionQuotaEnd"), + + /** + * Enum value Creating. + */ + CREATING("Creating"), + + /** + * Enum value Succeeded. + */ + SUCCEEDED("Succeeded"), + + /** + * Enum value Deleting. + */ + DELETING("Deleting"), + + /** + * Enum value Canceled. + */ + CANCELED("Canceled"), + + /** + * Enum value Failed. + */ + FAILED("Failed"); + + /** + * The actual serialized value for a ProvisioningState instance. + */ + private final String value; + + ProvisioningState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ProvisioningState instance. + * + * @param value the serialized value to parse. + * @return the parsed ProvisioningState object, or null if unable to parse. + */ + @JsonCreator + public static ProvisioningState fromString(String value) { + if (value == null) { + return null; + } + ProvisioningState[] items = ProvisioningState.values(); + for (ProvisioningState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/RunResult.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/RunResult.java new file mode 100644 index 0000000000000..e13b1588535b8 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/RunResult.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Represents the overall result of the execution for the run instance. + */ +public final class RunResult extends ExpandableStringEnum { + /** + * Static value Succeeded for RunResult. + */ + public static final RunResult SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for RunResult. + */ + public static final RunResult FAILED = fromString("Failed"); + + /** + * Creates a new instance of RunResult value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RunResult() { + } + + /** + * Creates or finds a RunResult from its string representation. + * + * @param name a name to look for. + * @return the corresponding RunResult. + */ + @JsonCreator + public static RunResult fromString(String name) { + return fromString(name, RunResult.class); + } + + /** + * Gets known RunResult values. + * + * @return known RunResult values. + */ + public static Collection values() { + return values(RunResult.class); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/RunStatusEnum.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/RunStatusEnum.java new file mode 100644 index 0000000000000..608091f2d6358 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/RunStatusEnum.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Represents the status of the execution. + */ +public final class RunStatusEnum extends ExpandableStringEnum { + /** + * Static value InProgress for RunStatusEnum. + */ + public static final RunStatusEnum IN_PROGRESS = fromString("InProgress"); + + /** + * Static value Finished for RunStatusEnum. + */ + public static final RunStatusEnum FINISHED = fromString("Finished"); + + /** + * Creates a new instance of RunStatusEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RunStatusEnum() { + } + + /** + * Creates or finds a RunStatusEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding RunStatusEnum. + */ + @JsonCreator + public static RunStatusEnum fromString(String name) { + return fromString(name, RunStatusEnum.class); + } + + /** + * Gets known RunStatusEnum values. + * + * @return known RunStatusEnum values. + */ + public static Collection values() { + return values(RunStatusEnum.class); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTask.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTask.java new file mode 100644 index 0000000000000..bb98ddc311bf7 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTask.java @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskInner; +import java.util.Map; + +/** + * An immutable client-side representation of StorageTask. + */ +public interface StorageTask { + /** + * 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 identity property: The managed service identity of the resource. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the properties property: Properties of the storage task. + * + * @return the properties value. + */ + StorageTaskProperties properties(); + + /** + * 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.storageactions.fluent.models.StorageTaskInner object. + * + * @return the inner object. + */ + StorageTaskInner innerModel(); + + /** + * The entirety of the StorageTask definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The StorageTask definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the StorageTask definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the StorageTask 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 StorageTask 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 StorageTask 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.WithIdentity, DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + StorageTask create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + StorageTask create(Context context); + } + + /** + * The stage of the StorageTask 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 StorageTask definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The managed service identity of the resource.. + * + * @param identity The managed service identity of the resource. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + + /** + * The stage of the StorageTask definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the storage task.. + * + * @param properties Properties of the storage task. + * @return the next definition stage. + */ + WithCreate withProperties(StorageTaskProperties properties); + } + } + + /** + * Begins update for the StorageTask resource. + * + * @return the stage of resource update. + */ + StorageTask.Update update(); + + /** + * The template for StorageTask update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + StorageTask apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + StorageTask apply(Context context); + } + + /** + * The StorageTask update stages. + */ + interface UpdateStages { + /** + * The stage of the StorageTask update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Gets or sets a list of key value pairs that describe the resource. These + * tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can + * be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value + * no greater in length than 256 characters.. + * + * @param tags Gets or sets a list of key value pairs that describe the resource. These tags can be used in + * viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a + * resource. Each tag must have a key no greater in length than 128 characters and a value no greater in + * length than 256 characters. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the StorageTask update allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the resource.. + * + * @param identity The identity of the resource. + * @return the next definition stage. + */ + Update withIdentity(ManagedServiceIdentity identity); + } + + /** + * The stage of the StorageTask update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the storage task.. + * + * @param properties Properties of the storage task. + * @return the next definition stage. + */ + Update withProperties(StorageTaskProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + StorageTask refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + StorageTask refresh(Context context); +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAction.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAction.java new file mode 100644 index 0000000000000..9e38d0608b2fb --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAction.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The storage task action represents conditional statements and operations to be performed on target objects. + */ +@Fluent +public final class StorageTaskAction { + /* + * The if block of storage task operation + */ + @JsonProperty(value = "if", required = true) + private IfCondition ifProperty; + + /* + * The else block of storage task operation + */ + @JsonProperty(value = "else") + private ElseCondition elseProperty; + + /** + * Creates an instance of StorageTaskAction class. + */ + public StorageTaskAction() { + } + + /** + * Get the ifProperty property: The if block of storage task operation. + * + * @return the ifProperty value. + */ + public IfCondition ifProperty() { + return this.ifProperty; + } + + /** + * Set the ifProperty property: The if block of storage task operation. + * + * @param ifProperty the ifProperty value to set. + * @return the StorageTaskAction object itself. + */ + public StorageTaskAction withIfProperty(IfCondition ifProperty) { + this.ifProperty = ifProperty; + return this; + } + + /** + * Get the elseProperty property: The else block of storage task operation. + * + * @return the elseProperty value. + */ + public ElseCondition elseProperty() { + return this.elseProperty; + } + + /** + * Set the elseProperty property: The else block of storage task operation. + * + * @param elseProperty the elseProperty value to set. + * @return the StorageTaskAction object itself. + */ + public StorageTaskAction withElseProperty(ElseCondition elseProperty) { + this.elseProperty = elseProperty; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ifProperty() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property ifProperty in model StorageTaskAction")); + } else { + ifProperty().validate(); + } + if (elseProperty() != null) { + elseProperty().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageTaskAction.class); +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAssignment.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAssignment.java new file mode 100644 index 0000000000000..e3d0222bbe03a --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAssignment.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskAssignmentInner; + +/** + * An immutable client-side representation of StorageTaskAssignment. + */ +public interface StorageTaskAssignment { + /** + * Gets the id property: ARM Id of the storage task assignments, associated with the storage tasks. + * + * @return the id value. + */ + String id(); + + /** + * Gets the inner com.azure.resourcemanager.storageactions.fluent.models.StorageTaskAssignmentInner object. + * + * @return the inner object. + */ + StorageTaskAssignmentInner innerModel(); +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAssignments.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAssignments.java new file mode 100644 index 0000000000000..8f3f3c0f37afc --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAssignments.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of StorageTaskAssignments. + */ +public interface StorageTaskAssignments { + /** + * Lists all the storage tasks available under the given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String storageTaskName); + + /** + * Lists all the storage tasks available under the given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the + * list response. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String storageTaskName, String maxpagesize, + Context context); +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAssignmentsListResult.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAssignmentsListResult.java new file mode 100644 index 0000000000000..9b57951dfc87e --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAssignmentsListResult.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskAssignmentInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The response from the List Storage Tasks operation. + */ +@Immutable +public final class StorageTaskAssignmentsListResult { + /* + * Gets the list of storage task assignment Ids. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Request URL that can be used to query next page of storage task assignment Ids. Returned when total number of + * requested storage task assignment Ids exceed maximum page size. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Creates an instance of StorageTaskAssignmentsListResult class. + */ + public StorageTaskAssignmentsListResult() { + } + + /** + * Get the value property: Gets the list of storage task assignment Ids. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Request URL that can be used to query next page of storage task assignment Ids. + * Returned when total number of requested storage task assignment Ids exceed maximum page size. + * + * @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()); + } + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskOperation.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskOperation.java new file mode 100644 index 0000000000000..ade8765e62462 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskOperation.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * Represents an operation to be performed on the object. + */ +@Fluent +public final class StorageTaskOperation { + /* + * The operation to be performed on the object. + */ + @JsonProperty(value = "name", required = true) + private StorageTaskOperationName name; + + /* + * Key-value parameters for the operation. + */ + @JsonProperty(value = "parameters") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map parameters; + + /* + * Action to be taken when the operation is successful for a object. + */ + @JsonProperty(value = "onSuccess") + private OnSuccess onSuccess; + + /* + * Action to be taken when the operation fails for a object. + */ + @JsonProperty(value = "onFailure") + private OnFailure onFailure; + + /** + * Creates an instance of StorageTaskOperation class. + */ + public StorageTaskOperation() { + } + + /** + * Get the name property: The operation to be performed on the object. + * + * @return the name value. + */ + public StorageTaskOperationName name() { + return this.name; + } + + /** + * Set the name property: The operation to be performed on the object. + * + * @param name the name value to set. + * @return the StorageTaskOperation object itself. + */ + public StorageTaskOperation withName(StorageTaskOperationName name) { + this.name = name; + return this; + } + + /** + * Get the parameters property: Key-value parameters for the operation. + * + * @return the parameters value. + */ + public Map parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Key-value parameters for the operation. + * + * @param parameters the parameters value to set. + * @return the StorageTaskOperation object itself. + */ + public StorageTaskOperation withParameters(Map parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the onSuccess property: Action to be taken when the operation is successful for a object. + * + * @return the onSuccess value. + */ + public OnSuccess onSuccess() { + return this.onSuccess; + } + + /** + * Set the onSuccess property: Action to be taken when the operation is successful for a object. + * + * @param onSuccess the onSuccess value to set. + * @return the StorageTaskOperation object itself. + */ + public StorageTaskOperation withOnSuccess(OnSuccess onSuccess) { + this.onSuccess = onSuccess; + return this; + } + + /** + * Get the onFailure property: Action to be taken when the operation fails for a object. + * + * @return the onFailure value. + */ + public OnFailure onFailure() { + return this.onFailure; + } + + /** + * Set the onFailure property: Action to be taken when the operation fails for a object. + * + * @param onFailure the onFailure value to set. + * @return the StorageTaskOperation object itself. + */ + public StorageTaskOperation withOnFailure(OnFailure onFailure) { + this.onFailure = onFailure; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property name in model StorageTaskOperation")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageTaskOperation.class); +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskOperationName.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskOperationName.java new file mode 100644 index 0000000000000..9f858273dcfc7 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskOperationName.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The operation to be performed on the object. + */ +public final class StorageTaskOperationName extends ExpandableStringEnum { + /** + * Static value SetBlobTier for StorageTaskOperationName. + */ + public static final StorageTaskOperationName SET_BLOB_TIER = fromString("SetBlobTier"); + + /** + * Static value SetBlobTags for StorageTaskOperationName. + */ + public static final StorageTaskOperationName SET_BLOB_TAGS = fromString("SetBlobTags"); + + /** + * Static value SetBlobImmutabilityPolicy for StorageTaskOperationName. + */ + public static final StorageTaskOperationName SET_BLOB_IMMUTABILITY_POLICY = fromString("SetBlobImmutabilityPolicy"); + + /** + * Static value SetBlobLegalHold for StorageTaskOperationName. + */ + public static final StorageTaskOperationName SET_BLOB_LEGAL_HOLD = fromString("SetBlobLegalHold"); + + /** + * Static value SetBlobExpiry for StorageTaskOperationName. + */ + public static final StorageTaskOperationName SET_BLOB_EXPIRY = fromString("SetBlobExpiry"); + + /** + * Static value DeleteBlob for StorageTaskOperationName. + */ + public static final StorageTaskOperationName DELETE_BLOB = fromString("DeleteBlob"); + + /** + * Static value UndeleteBlob for StorageTaskOperationName. + */ + public static final StorageTaskOperationName UNDELETE_BLOB = fromString("UndeleteBlob"); + + /** + * Creates a new instance of StorageTaskOperationName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StorageTaskOperationName() { + } + + /** + * Creates or finds a StorageTaskOperationName from its string representation. + * + * @param name a name to look for. + * @return the corresponding StorageTaskOperationName. + */ + @JsonCreator + public static StorageTaskOperationName fromString(String name) { + return fromString(name, StorageTaskOperationName.class); + } + + /** + * Gets known StorageTaskOperationName values. + * + * @return known StorageTaskOperationName values. + */ + public static Collection values() { + return values(StorageTaskOperationName.class); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewAction.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewAction.java new file mode 100644 index 0000000000000..c085d1ce99a75 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewAction.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskPreviewActionInner; + +/** + * An immutable client-side representation of StorageTaskPreviewAction. + */ +public interface StorageTaskPreviewAction { + /** + * Gets the properties property: Properties of the storage task preview. + * + * @return the properties value. + */ + StorageTaskPreviewActionProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.storageactions.fluent.models.StorageTaskPreviewActionInner object. + * + * @return the inner object. + */ + StorageTaskPreviewActionInner innerModel(); +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewActionCondition.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewActionCondition.java new file mode 100644 index 0000000000000..c24a0c0e8a93d --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewActionCondition.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the storage task conditions to be tested for a match with container and blob properties. + */ +@Fluent +public final class StorageTaskPreviewActionCondition { + /* + * The condition to be tested for a match with container and blob properties. + */ + @JsonProperty(value = "if", required = true) + private StorageTaskPreviewActionIfCondition ifProperty; + + /* + * Specify whether the else block is present in the condition. + */ + @JsonProperty(value = "elseBlockExists", required = true) + private boolean elseBlockExists; + + /** + * Creates an instance of StorageTaskPreviewActionCondition class. + */ + public StorageTaskPreviewActionCondition() { + } + + /** + * Get the ifProperty property: The condition to be tested for a match with container and blob properties. + * + * @return the ifProperty value. + */ + public StorageTaskPreviewActionIfCondition ifProperty() { + return this.ifProperty; + } + + /** + * Set the ifProperty property: The condition to be tested for a match with container and blob properties. + * + * @param ifProperty the ifProperty value to set. + * @return the StorageTaskPreviewActionCondition object itself. + */ + public StorageTaskPreviewActionCondition withIfProperty(StorageTaskPreviewActionIfCondition ifProperty) { + this.ifProperty = ifProperty; + return this; + } + + /** + * Get the elseBlockExists property: Specify whether the else block is present in the condition. + * + * @return the elseBlockExists value. + */ + public boolean elseBlockExists() { + return this.elseBlockExists; + } + + /** + * Set the elseBlockExists property: Specify whether the else block is present in the condition. + * + * @param elseBlockExists the elseBlockExists value to set. + * @return the StorageTaskPreviewActionCondition object itself. + */ + public StorageTaskPreviewActionCondition withElseBlockExists(boolean elseBlockExists) { + this.elseBlockExists = elseBlockExists; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ifProperty() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property ifProperty in model StorageTaskPreviewActionCondition")); + } else { + ifProperty().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageTaskPreviewActionCondition.class); +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewActionIfCondition.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewActionIfCondition.java new file mode 100644 index 0000000000000..52afc654fb610 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewActionIfCondition.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents storage task preview action condition. + */ +@Fluent +public final class StorageTaskPreviewActionIfCondition { + /* + * Storage task condition to bes tested for a match. + */ + @JsonProperty(value = "condition") + private String condition; + + /** + * Creates an instance of StorageTaskPreviewActionIfCondition class. + */ + public StorageTaskPreviewActionIfCondition() { + } + + /** + * Get the condition property: Storage task condition to bes tested for a match. + * + * @return the condition value. + */ + public String condition() { + return this.condition; + } + + /** + * Set the condition property: Storage task condition to bes tested for a match. + * + * @param condition the condition value to set. + * @return the StorageTaskPreviewActionIfCondition object itself. + */ + public StorageTaskPreviewActionIfCondition withCondition(String condition) { + this.condition = condition; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewActionProperties.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewActionProperties.java new file mode 100644 index 0000000000000..65d29098cb043 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewActionProperties.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Storage task preview action properties. + */ +@Fluent +public final class StorageTaskPreviewActionProperties { + /* + * Preview action container properties to be tested for a match with the provided condition. + */ + @JsonProperty(value = "container", required = true) + private StorageTaskPreviewContainerProperties container; + + /* + * Preview action container properties to be tested for a match with the provided condition. + */ + @JsonProperty(value = "blobs", required = true) + private List blobs; + + /* + * Preview action container properties to be tested for a match with the provided condition. + */ + @JsonProperty(value = "action", required = true) + private StorageTaskPreviewActionCondition action; + + /** + * Creates an instance of StorageTaskPreviewActionProperties class. + */ + public StorageTaskPreviewActionProperties() { + } + + /** + * Get the container property: Preview action container properties to be tested for a match with the provided + * condition. + * + * @return the container value. + */ + public StorageTaskPreviewContainerProperties container() { + return this.container; + } + + /** + * Set the container property: Preview action container properties to be tested for a match with the provided + * condition. + * + * @param container the container value to set. + * @return the StorageTaskPreviewActionProperties object itself. + */ + public StorageTaskPreviewActionProperties withContainer(StorageTaskPreviewContainerProperties container) { + this.container = container; + return this; + } + + /** + * Get the blobs property: Preview action container properties to be tested for a match with the provided + * condition. + * + * @return the blobs value. + */ + public List blobs() { + return this.blobs; + } + + /** + * Set the blobs property: Preview action container properties to be tested for a match with the provided + * condition. + * + * @param blobs the blobs value to set. + * @return the StorageTaskPreviewActionProperties object itself. + */ + public StorageTaskPreviewActionProperties withBlobs(List blobs) { + this.blobs = blobs; + return this; + } + + /** + * Get the action property: Preview action container properties to be tested for a match with the provided + * condition. + * + * @return the action value. + */ + public StorageTaskPreviewActionCondition action() { + return this.action; + } + + /** + * Set the action property: Preview action container properties to be tested for a match with the provided + * condition. + * + * @param action the action value to set. + * @return the StorageTaskPreviewActionProperties object itself. + */ + public StorageTaskPreviewActionProperties withAction(StorageTaskPreviewActionCondition action) { + this.action = action; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (container() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property container in model StorageTaskPreviewActionProperties")); + } else { + container().validate(); + } + if (blobs() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property blobs in model StorageTaskPreviewActionProperties")); + } else { + blobs().forEach(e -> e.validate()); + } + if (action() == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property action in model StorageTaskPreviewActionProperties")); + } else { + action().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageTaskPreviewActionProperties.class); +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewBlobProperties.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewBlobProperties.java new file mode 100644 index 0000000000000..e669ae71b3863 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewBlobProperties.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Storage task preview container properties. + */ +@Fluent +public final class StorageTaskPreviewBlobProperties { + /* + * property for the container name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * properties key value pairs to be tested for a match against the provided condition. + */ + @JsonProperty(value = "properties") + private List properties; + + /* + * metadata key value pairs to be tested for a match against the provided condition. + */ + @JsonProperty(value = "metadata") + private List metadata; + + /* + * tags key value pairs to be tested for a match against the provided condition. + */ + @JsonProperty(value = "tags") + private List tags; + + /* + * Represents the condition block name that matched blob properties. + */ + @JsonProperty(value = "matchedBlock", access = JsonProperty.Access.WRITE_ONLY) + private MatchedBlockName matchedBlock; + + /** + * Creates an instance of StorageTaskPreviewBlobProperties class. + */ + public StorageTaskPreviewBlobProperties() { + } + + /** + * Get the name property: property for the container name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: property for the container name. + * + * @param name the name value to set. + * @return the StorageTaskPreviewBlobProperties object itself. + */ + public StorageTaskPreviewBlobProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the properties property: properties key value pairs to be tested for a match against the provided condition. + * + * @return the properties value. + */ + public List properties() { + return this.properties; + } + + /** + * Set the properties property: properties key value pairs to be tested for a match against the provided condition. + * + * @param properties the properties value to set. + * @return the StorageTaskPreviewBlobProperties object itself. + */ + public StorageTaskPreviewBlobProperties withProperties(List properties) { + this.properties = properties; + return this; + } + + /** + * Get the metadata property: metadata key value pairs to be tested for a match against the provided condition. + * + * @return the metadata value. + */ + public List metadata() { + return this.metadata; + } + + /** + * Set the metadata property: metadata key value pairs to be tested for a match against the provided condition. + * + * @param metadata the metadata value to set. + * @return the StorageTaskPreviewBlobProperties object itself. + */ + public StorageTaskPreviewBlobProperties withMetadata(List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the tags property: tags key value pairs to be tested for a match against the provided condition. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: tags key value pairs to be tested for a match against the provided condition. + * + * @param tags the tags value to set. + * @return the StorageTaskPreviewBlobProperties object itself. + */ + public StorageTaskPreviewBlobProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the matchedBlock property: Represents the condition block name that matched blob properties. + * + * @return the matchedBlock value. + */ + public MatchedBlockName matchedBlock() { + return this.matchedBlock; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().forEach(e -> e.validate()); + } + if (metadata() != null) { + metadata().forEach(e -> e.validate()); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewContainerProperties.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewContainerProperties.java new file mode 100644 index 0000000000000..e413c4ce65f5e --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewContainerProperties.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Storage task preview container properties. + */ +@Fluent +public final class StorageTaskPreviewContainerProperties { + /* + * property for the container name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * metadata key value pairs to be tested for a match against the provided condition. + */ + @JsonProperty(value = "metadata") + private List metadata; + + /** + * Creates an instance of StorageTaskPreviewContainerProperties class. + */ + public StorageTaskPreviewContainerProperties() { + } + + /** + * Get the name property: property for the container name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: property for the container name. + * + * @param name the name value to set. + * @return the StorageTaskPreviewContainerProperties object itself. + */ + public StorageTaskPreviewContainerProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the metadata property: metadata key value pairs to be tested for a match against the provided condition. + * + * @return the metadata value. + */ + public List metadata() { + return this.metadata; + } + + /** + * Set the metadata property: metadata key value pairs to be tested for a match against the provided condition. + * + * @param metadata the metadata value to set. + * @return the StorageTaskPreviewContainerProperties object itself. + */ + public StorageTaskPreviewContainerProperties withMetadata(List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metadata() != null) { + metadata().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewKeyValueProperties.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewKeyValueProperties.java new file mode 100644 index 0000000000000..fdd3ed87e825b --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewKeyValueProperties.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Storage task preview object key value pair properties. + */ +@Fluent +public final class StorageTaskPreviewKeyValueProperties { + /* + * Represents the key property of the pair. + */ + @JsonProperty(value = "key") + private String key; + + /* + * Represents the value property of the pair. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Creates an instance of StorageTaskPreviewKeyValueProperties class. + */ + public StorageTaskPreviewKeyValueProperties() { + } + + /** + * Get the key property: Represents the key property of the pair. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: Represents the key property of the pair. + * + * @param key the key value to set. + * @return the StorageTaskPreviewKeyValueProperties object itself. + */ + public StorageTaskPreviewKeyValueProperties withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value property: Represents the value property of the pair. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Represents the value property of the pair. + * + * @param value the value value to set. + * @return the StorageTaskPreviewKeyValueProperties object itself. + */ + public StorageTaskPreviewKeyValueProperties withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskProperties.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskProperties.java new file mode 100644 index 0000000000000..915a4097a95a9 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskProperties.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * Properties of the storage task. + */ +@Fluent +public final class StorageTaskProperties { + /* + * Storage task version. + */ + @JsonProperty(value = "taskVersion", access = JsonProperty.Access.WRITE_ONLY) + private Long taskVersion; + + /* + * Storage Task is enabled when set to true and disabled when set to false + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * Text that describes the purpose of the storage task + */ + @JsonProperty(value = "description", required = true) + private String description; + + /* + * The storage task action that is executed + */ + @JsonProperty(value = "action", required = true) + private StorageTaskAction action; + + /* + * Represents the provisioning state of the storage task. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The creation date and time of the storage task in UTC. + */ + @JsonProperty(value = "creationTimeInUtc", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationTimeInUtc; + + /** + * Creates an instance of StorageTaskProperties class. + */ + public StorageTaskProperties() { + } + + /** + * Get the taskVersion property: Storage task version. + * + * @return the taskVersion value. + */ + public Long taskVersion() { + return this.taskVersion; + } + + /** + * Get the enabled property: Storage Task is enabled when set to true and disabled when set to false. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Storage Task is enabled when set to true and disabled when set to false. + * + * @param enabled the enabled value to set. + * @return the StorageTaskProperties object itself. + */ + public StorageTaskProperties withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the description property: Text that describes the purpose of the storage task. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Text that describes the purpose of the storage task. + * + * @param description the description value to set. + * @return the StorageTaskProperties object itself. + */ + public StorageTaskProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the action property: The storage task action that is executed. + * + * @return the action value. + */ + public StorageTaskAction action() { + return this.action; + } + + /** + * Set the action property: The storage task action that is executed. + * + * @param action the action value to set. + * @return the StorageTaskProperties object itself. + */ + public StorageTaskProperties withAction(StorageTaskAction action) { + this.action = action; + return this; + } + + /** + * Get the provisioningState property: Represents the provisioning state of the storage task. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the creationTimeInUtc property: The creation date and time of the storage task in UTC. + * + * @return the creationTimeInUtc value. + */ + public OffsetDateTime creationTimeInUtc() { + return this.creationTimeInUtc; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (description() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property description in model StorageTaskProperties")); + } + if (action() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property action in model StorageTaskProperties")); + } else { + action().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageTaskProperties.class); +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskReportInstance.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskReportInstance.java new file mode 100644 index 0000000000000..c59762ee7555e --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskReportInstance.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskReportInstanceInner; + +/** + * An immutable client-side representation of StorageTaskReportInstance. + */ +public interface StorageTaskReportInstance { + /** + * 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: Storage task execution report for a run instance. + * + * @return the properties value. + */ + StorageTaskReportProperties 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.storageactions.fluent.models.StorageTaskReportInstanceInner object. + * + * @return the inner object. + */ + StorageTaskReportInstanceInner innerModel(); +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskReportProperties.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskReportProperties.java new file mode 100644 index 0000000000000..683a6ea0d5032 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskReportProperties.java @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Storage task execution report for a run instance. + */ +@Immutable +public final class StorageTaskReportProperties { + /* + * Represents the Storage Task Assignment Id associated with the storage task that provided an execution context. + */ + @JsonProperty(value = "taskAssignmentId", access = JsonProperty.Access.WRITE_ONLY) + private String taskAssignmentId; + + /* + * Represents the Storage Account Id where the storage task definition was applied and executed. + */ + @JsonProperty(value = "storageAccountId", access = JsonProperty.Access.WRITE_ONLY) + private String storageAccountId; + + /* + * Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other + * comparison operators can be used as described for DateTime properties in + * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison- + * operators + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private String startTime; + + /* + * End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other + * comparison operators can be used as described for DateTime properties in + * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison- + * operators + */ + @JsonProperty(value = "finishTime", access = JsonProperty.Access.WRITE_ONLY) + private String finishTime; + + /* + * Total number of objects that meet the condition as defined in the storage task assignment execution context. + * Filter options such as objectsTargetedCount gt 50 and other comparison operators can be used as described for + * Numerical properties in + * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison- + * operators + */ + @JsonProperty(value = "objectsTargetedCount", access = JsonProperty.Access.WRITE_ONLY) + private String objectsTargetedCount; + + /* + * Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as + * objectsOperatedOnCount ge 100 and other comparison operators can be used as described for Numerical properties + * in + * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison- + * operators + */ + @JsonProperty(value = "objectsOperatedOnCount", access = JsonProperty.Access.WRITE_ONLY) + private String objectsOperatedOnCount; + + /* + * Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount + * eq 0 and other comparison operators can be used as described for Numerical properties in + * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison- + * operators + */ + @JsonProperty(value = "objectFailedCount", access = JsonProperty.Access.WRITE_ONLY) + private String objectFailedCount; + + /* + * Total number of objects where task operation succeeded when was attempted.Filter options such as + * objectsSucceededCount gt 150 and other comparison operators can be used as described for Numerical properties in + * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison- + * operators + */ + @JsonProperty(value = "objectsSucceededCount", access = JsonProperty.Access.WRITE_ONLY) + private String objectsSucceededCount; + + /* + * Well known Azure Storage error code that represents the error encountered during execution of the run instance. + */ + @JsonProperty(value = "runStatusError", access = JsonProperty.Access.WRITE_ONLY) + private String runStatusError; + + /* + * Represents the status of the execution. + */ + @JsonProperty(value = "runStatusEnum", access = JsonProperty.Access.WRITE_ONLY) + private RunStatusEnum runStatusEnum; + + /* + * Full path to the verbose report stored in the reporting container as specified in the assignment execution + * context for the storage account. + */ + @JsonProperty(value = "summaryReportPath", access = JsonProperty.Access.WRITE_ONLY) + private String summaryReportPath; + + /* + * Storage Task Arm Id. + */ + @JsonProperty(value = "taskId", access = JsonProperty.Access.WRITE_ONLY) + private String taskId; + + /* + * Storage Task Version + */ + @JsonProperty(value = "taskVersion", access = JsonProperty.Access.WRITE_ONLY) + private String taskVersion; + + /* + * Represents the overall result of the execution for the run instance + */ + @JsonProperty(value = "runResult", access = JsonProperty.Access.WRITE_ONLY) + private RunResult runResult; + + /** + * Creates an instance of StorageTaskReportProperties class. + */ + public StorageTaskReportProperties() { + } + + /** + * Get the taskAssignmentId property: Represents the Storage Task Assignment Id associated with the storage task + * that provided an execution context. + * + * @return the taskAssignmentId value. + */ + public String taskAssignmentId() { + return this.taskAssignmentId; + } + + /** + * Get the storageAccountId property: Represents the Storage Account Id where the storage task definition was + * applied and executed. + * + * @return the storageAccountId value. + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Get the startTime property: Start time of the run instance. Filter options such as startTime gt + * '2023-06-26T20:51:24.4494016Z' and other comparison operators can be used as described for DateTime properties + * in + * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators. + * + * @return the startTime value. + */ + public String startTime() { + return this.startTime; + } + + /** + * Get the finishTime property: End time of the run instance. Filter options such as startTime gt + * '2023-06-26T20:51:24.4494016Z' and other comparison operators can be used as described for DateTime properties + * in + * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators. + * + * @return the finishTime value. + */ + public String finishTime() { + return this.finishTime; + } + + /** + * Get the objectsTargetedCount property: Total number of objects that meet the condition as defined in the storage + * task assignment execution context. Filter options such as objectsTargetedCount gt 50 and other comparison + * operators can be used as described for Numerical properties in + * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators. + * + * @return the objectsTargetedCount value. + */ + public String objectsTargetedCount() { + return this.objectsTargetedCount; + } + + /** + * Get the objectsOperatedOnCount property: Total number of objects that meet the storage tasks condition and were + * operated upon. Filter options such as objectsOperatedOnCount ge 100 and other comparison operators can be used + * as described for Numerical properties in + * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators. + * + * @return the objectsOperatedOnCount value. + */ + public String objectsOperatedOnCount() { + return this.objectsOperatedOnCount; + } + + /** + * Get the objectFailedCount property: Total number of objects where task operation failed when was attempted. + * Filter options such as objectFailedCount eq 0 and other comparison operators can be used as described for + * Numerical properties in + * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators. + * + * @return the objectFailedCount value. + */ + public String objectFailedCount() { + return this.objectFailedCount; + } + + /** + * Get the objectsSucceededCount property: Total number of objects where task operation succeeded when was + * attempted.Filter options such as objectsSucceededCount gt 150 and other comparison operators can be used as + * described for Numerical properties in + * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators. + * + * @return the objectsSucceededCount value. + */ + public String objectsSucceededCount() { + return this.objectsSucceededCount; + } + + /** + * Get the runStatusError property: Well known Azure Storage error code that represents the error encountered + * during execution of the run instance. + * + * @return the runStatusError value. + */ + public String runStatusError() { + return this.runStatusError; + } + + /** + * Get the runStatusEnum property: Represents the status of the execution. + * + * @return the runStatusEnum value. + */ + public RunStatusEnum runStatusEnum() { + return this.runStatusEnum; + } + + /** + * Get the summaryReportPath property: Full path to the verbose report stored in the reporting container as + * specified in the assignment execution context for the storage account. + * + * @return the summaryReportPath value. + */ + public String summaryReportPath() { + return this.summaryReportPath; + } + + /** + * Get the taskId property: Storage Task Arm Id. + * + * @return the taskId value. + */ + public String taskId() { + return this.taskId; + } + + /** + * Get the taskVersion property: Storage Task Version. + * + * @return the taskVersion value. + */ + public String taskVersion() { + return this.taskVersion; + } + + /** + * Get the runResult property: Represents the overall result of the execution for the run instance. + * + * @return the runResult value. + */ + public RunResult runResult() { + return this.runResult; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskReportSummary.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskReportSummary.java new file mode 100644 index 0000000000000..594f2dc634f47 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskReportSummary.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskReportInstanceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Fetch Storage Tasks Run Summary. + */ +@Immutable +public final class StorageTaskReportSummary { + /* + * Gets storage tasks run result summary. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Request URL that can be used to query next page of storage task run results summary. Returned when the number of + * run instances and summary reports exceed maximum page size. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Creates an instance of StorageTaskReportSummary class. + */ + public StorageTaskReportSummary() { + } + + /** + * Get the value property: Gets storage tasks run result summary. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Request URL that can be used to query next page of storage task run results summary. + * Returned when the number of run instances and summary reports exceed maximum page size. + * + * @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()); + } + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskUpdateParameters.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskUpdateParameters.java new file mode 100644 index 0000000000000..a0af1f1feea0f --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskUpdateParameters.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * Parameters of the storage task update request. + */ +@Fluent +public final class StorageTaskUpdateParameters { + /* + * The identity of the resource. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /* + * Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and + * grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag + * must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * Properties of the storage task. + */ + @JsonProperty(value = "properties") + private StorageTaskProperties properties; + + /** + * Creates an instance of StorageTaskUpdateParameters class. + */ + public StorageTaskUpdateParameters() { + } + + /** + * Get the identity property: The identity of the resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the resource. + * + * @param identity the identity value to set. + * @return the StorageTaskUpdateParameters object itself. + */ + public StorageTaskUpdateParameters withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the tags property: Gets or sets a list of key value pairs that describe the resource. These tags can be used + * in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a + * resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length + * than 256 characters. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Gets or sets a list of key value pairs that describe the resource. These tags can be used + * in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a + * resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length + * than 256 characters. + * + * @param tags the tags value to set. + * @return the StorageTaskUpdateParameters object itself. + */ + public StorageTaskUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties property: Properties of the storage task. + * + * @return the properties value. + */ + public StorageTaskProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the storage task. + * + * @param properties the properties value to set. + * @return the StorageTaskUpdateParameters object itself. + */ + public StorageTaskUpdateParameters withProperties(StorageTaskProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTasks.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTasks.java new file mode 100644 index 0000000000000..143111d97f8a6 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTasks.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.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.storageactions.fluent.models.StorageTaskPreviewActionInner; + +/** + * Resource collection API of StorageTasks. + */ +public interface StorageTasks { + /** + * Delete the storage task resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 storageTaskName); + + /** + * Delete the storage task resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 storageTaskName, Context context); + + /** + * Get the storage task properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage task properties along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String storageTaskName, + Context context); + + /** + * Get the storage task properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage task properties. + */ + StorageTask getByResourceGroup(String resourceGroupName, String storageTaskName); + + /** + * Lists all the storage tasks available under the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all the storage tasks available under the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Lists all the storage tasks available under the given 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 response from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the storage tasks available under the given 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 response from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Runs the input conditions against input object metadata properties and designates matched objects in response. + * + * @param location The location to perform preview of the actions. + * @param parameters The parameters to preview action condition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Task Preview Action along with {@link Response}. + */ + Response previewActionsWithResponse(String location, + StorageTaskPreviewActionInner parameters, Context context); + + /** + * Runs the input conditions against input object metadata properties and designates matched objects in response. + * + * @param location The location to perform preview of the actions. + * @param parameters The parameters to preview action condition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Task Preview Action. + */ + StorageTaskPreviewAction previewActions(String location, StorageTaskPreviewActionInner parameters); + + /** + * Get the storage task properties. + * + * @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 storage task properties along with {@link Response}. + */ + StorageTask getById(String id); + + /** + * Get the storage task properties. + * + * @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 storage task properties along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the storage task 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. + */ + void deleteById(String id); + + /** + * Delete the storage task 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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new StorageTask resource. + * + * @param name resource name. + * @return the first stage of the new StorageTask definition. + */ + StorageTask.DefinitionStages.Blank define(String name); +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTasksListResult.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTasksListResult.java new file mode 100644 index 0000000000000..dbc42b211788b --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTasksListResult.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The response from the List Storage Tasks operation. + */ +@Immutable +public final class StorageTasksListResult { + /* + * Gets the list of storage tasks and their properties. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Request URL that can be used to query next page of storage tasks. Returned when total number of requested + * storage tasks exceed maximum page size. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Creates an instance of StorageTasksListResult class. + */ + public StorageTasksListResult() { + } + + /** + * Get the value property: Gets the list of storage tasks and their properties. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Request URL that can be used to query next page of storage tasks. Returned when total + * number of requested storage tasks exceed maximum page size. + * + * @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()); + } + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTasksReports.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTasksReports.java new file mode 100644 index 0000000000000..7437490733fd0 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTasksReports.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of StorageTasksReports. + */ +public interface StorageTasksReports { + /** + * Fetch the storage tasks run report summary for each assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String storageTaskName); + + /** + * Fetch the storage tasks run report summary for each assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must + * be between 3 and 18 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the + * list response. + * @param filter Optional. When specified, it can be used to query using reporting 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 fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String storageTaskName, String maxpagesize, + String filter, Context context); +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/UserAssignedIdentity.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/UserAssignedIdentity.java new file mode 100644 index 0000000000000..e0dd3e69d269e --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/UserAssignedIdentity.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** + * User assigned identity properties. + */ +@Immutable +public final class UserAssignedIdentity { + /* + * The principal ID of the assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The client ID of the assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private UUID clientId; + + /** + * Creates an instance of UserAssignedIdentity class. + */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public UUID clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/package-info.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/package-info.java new file mode 100644 index 0000000000000..8ebe8db8ef6a7 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the data models for StorageActionsMgmtClient. + * The Azure Storage Actions Management API. + */ +package com.azure.resourcemanager.storageactions.models; diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/package-info.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/package-info.java new file mode 100644 index 0000000000000..307bd34531671 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the classes for StorageActionsMgmtClient. + * The Azure Storage Actions Management API. + */ +package com.azure.resourcemanager.storageactions; diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/module-info.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/module-info.java new file mode 100644 index 0000000000000..65c238b848bb2 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/module-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.storageactions { + requires transitive com.azure.core.management; + exports com.azure.resourcemanager.storageactions; + exports com.azure.resourcemanager.storageactions.fluent; + exports com.azure.resourcemanager.storageactions.fluent.models; + exports com.azure.resourcemanager.storageactions.models; + opens com.azure.resourcemanager.storageactions.fluent.models to com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.storageactions.models to com.azure.core, com.fasterxml.jackson.databind; +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storageactions/proxy-config.json b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storageactions/proxy-config.json new file mode 100644 index 0000000000000..ecdbd3f19a421 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storageactions/proxy-config.json @@ -0,0 +1 @@ +[ [ "com.azure.resourcemanager.storageactions.implementation.OperationsClientImpl$OperationsService" ], [ "com.azure.resourcemanager.storageactions.implementation.StorageTasksClientImpl$StorageTasksService" ], [ "com.azure.resourcemanager.storageactions.implementation.StorageTaskAssignmentsClientImpl$StorageTaskAssignmentsService" ], [ "com.azure.resourcemanager.storageactions.implementation.StorageTasksReportsClientImpl$StorageTasksReportsService" ] ] \ No newline at end of file diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storageactions/reflect-config.json b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storageactions/reflect-config.json new file mode 100644 index 0000000000000..23dd66ccfca00 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storageactions/reflect-config.json @@ -0,0 +1,176 @@ +[ { + "name" : "com.azure.resourcemanager.storageactions.models.OperationListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.fluent.models.OperationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.models.OperationDisplay", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.fluent.models.StorageTaskInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.models.ManagedServiceIdentity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.models.UserAssignedIdentity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.models.StorageTaskProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.models.StorageTaskAction", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.models.IfCondition", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.models.StorageTaskOperation", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.models.ElseCondition", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.models.StorageTaskUpdateParameters", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.models.StorageTasksListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.models.StorageTaskAssignmentsListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.fluent.models.StorageTaskAssignmentInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.models.StorageTaskReportSummary", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.fluent.models.StorageTaskReportInstanceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.models.StorageTaskReportProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.fluent.models.StorageTaskPreviewActionInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.models.StorageTaskPreviewContainerProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.models.StorageTaskPreviewKeyValueProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.models.StorageTaskPreviewBlobProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionCondition", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionIfCondition", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.models.Origin", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.models.ActionType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.models.ManagedServiceIdentityType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.models.StorageTaskOperationName", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.models.RunStatusEnum", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.models.RunResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.models.MatchedBlockName", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.models.ProvisioningState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.models.OnFailure", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.storageactions.models.OnSuccess", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +} ] \ No newline at end of file diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/OperationsListSamples.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..820de9b40e6cf --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/OperationsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: + * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/misc/ + * OperationsList.json + */ + /** + * Sample code: OperationsList. + * + * @param manager Entry point to StorageActionsManager. + */ + public static void operationsList(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentListSamples.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentListSamples.java new file mode 100644 index 0000000000000..6b377965535d6 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +/** + * Samples for StorageTaskAssignment List. + */ +public final class StorageTaskAssignmentListSamples { + /* + * x-ms-original-file: + * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ + * storageTasksList/ListStorageTaskAssignmentIds.json + */ + /** + * Sample code: ListStorageTaskAssignmentsByResourceGroup. + * + * @param manager Entry point to StorageActionsManager. + */ + public static void listStorageTaskAssignmentsByResourceGroup( + com.azure.resourcemanager.storageactions.StorageActionsManager manager) { + manager.storageTaskAssignments().list("rgroup1", "mytask1", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksCreateSamples.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksCreateSamples.java new file mode 100644 index 0000000000000..0a071bb87adc0 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksCreateSamples.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.resourcemanager.storageactions.models.ElseCondition; +import com.azure.resourcemanager.storageactions.models.IfCondition; +import com.azure.resourcemanager.storageactions.models.OnFailure; +import com.azure.resourcemanager.storageactions.models.OnSuccess; +import com.azure.resourcemanager.storageactions.models.StorageTaskAction; +import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; +import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; +import com.azure.resourcemanager.storageactions.models.StorageTaskProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for StorageTasks Create. + */ +public final class StorageTasksCreateSamples { + /* + * x-ms-original-file: + * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ + * storageTasksCrud/PutStorageTask.json + */ + /** + * Sample code: PutStorageTask. + * + * @param manager Entry point to StorageActionsManager. + */ + public static void putStorageTask(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { + manager.storageTasks().define("mytask1").withRegion("westus").withExistingResourceGroup("res4228") + .withProperties(new StorageTaskProperties().withEnabled(true).withDescription("My Storage task") + .withAction(new StorageTaskAction() + .withIfProperty(new IfCondition().withCondition("[[equals(AccessTier, 'Cool')]]") + .withOperations(Arrays.asList(new StorageTaskOperation() + .withName(StorageTaskOperationName.SET_BLOB_TIER).withParameters(mapOf("tier", "Hot")) + .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))) + .withElseProperty(new ElseCondition().withOperations( + Arrays.asList(new StorageTaskOperation().withName(StorageTaskOperationName.DELETE_BLOB) + .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksDeleteSamples.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksDeleteSamples.java new file mode 100644 index 0000000000000..b6e14148befa8 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +/** + * Samples for StorageTasks Delete. + */ +public final class StorageTasksDeleteSamples { + /* + * x-ms-original-file: + * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ + * storageTasksCrud/DeleteStorageTask.json + */ + /** + * Sample code: DeleteStorageTask. + * + * @param manager Entry point to StorageActionsManager. + */ + public static void deleteStorageTask(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { + manager.storageTasks().delete("res4228", "mytask1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksGetByResourceGroupSamples.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..cf1ef73a4d69f --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksGetByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +/** + * Samples for StorageTasks GetByResourceGroup. + */ +public final class StorageTasksGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ + * storageTasksCrud/GetStorageTask.json + */ + /** + * Sample code: GetStorageTask. + * + * @param manager Entry point to StorageActionsManager. + */ + public static void getStorageTask(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { + manager.storageTasks().getByResourceGroupWithResponse("res4228", "mytask1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListByResourceGroupSamples.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListByResourceGroupSamples.java new file mode 100644 index 0000000000000..98748277e806b --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +/** + * Samples for StorageTasks ListByResourceGroup. + */ +public final class StorageTasksListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ + * storageTasksList/ListStorageTasksByResourceGroup.json + */ + /** + * Sample code: ListStorageTasksByResourceGroup. + * + * @param manager Entry point to StorageActionsManager. + */ + public static void + listStorageTasksByResourceGroup(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { + manager.storageTasks().listByResourceGroup("res6117", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListSamples.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListSamples.java new file mode 100644 index 0000000000000..e64256bddcc0a --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +/** + * Samples for StorageTasks List. + */ +public final class StorageTasksListSamples { + /* + * x-ms-original-file: + * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ + * storageTasksList/ListStorageTasksBySubscription.json + */ + /** + * Sample code: ListStorageTasksBySubscription. + * + * @param manager Entry point to StorageActionsManager. + */ + public static void + listStorageTasksBySubscription(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { + manager.storageTasks().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksPreviewActionsSamples.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksPreviewActionsSamples.java new file mode 100644 index 0000000000000..809b6a47a5279 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksPreviewActionsSamples.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskPreviewActionInner; +import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionCondition; +import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionIfCondition; +import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionProperties; +import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewBlobProperties; +import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewContainerProperties; +import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewKeyValueProperties; +import java.util.Arrays; + +/** + * Samples for StorageTasks PreviewActions. + */ +public final class StorageTasksPreviewActionsSamples { + /* + * x-ms-original-file: + * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/misc/ + * PerformStorageTaskActionsPreview.json + */ + /** + * Sample code: PerformStorageTaskActionsPreview. + * + * @param manager Entry point to StorageActionsManager. + */ + public static void + performStorageTaskActionsPreview(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { + manager.storageTasks().previewActionsWithResponse("eastus", + new StorageTaskPreviewActionInner().withProperties(new StorageTaskPreviewActionProperties() + .withContainer(new StorageTaskPreviewContainerProperties().withName("firstContainer") + .withMetadata(Arrays.asList(new StorageTaskPreviewKeyValueProperties() + .withKey("fakeTokenPlaceholder").withValue("mContainerValue1")))) + .withBlobs(Arrays.asList( + new StorageTaskPreviewBlobProperties().withName("folder1/file1.txt").withProperties(Arrays.asList( + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("Wed, 07 Jun 2023 05:23:29 GMT"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("Wed, 07 Jun 2023 05:23:29 GMT"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("0x8DB67175454D36D"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue("38619"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("text/xml"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue(""), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue(""), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue(""), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("njr6iDrmU9+FC89WMK22EA=="), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue(""), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue(""), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("BlockBlob"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue("Hot"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue("true"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("unlocked"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("available"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue("true"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue("1"))) + .withMetadata(Arrays.asList(new StorageTaskPreviewKeyValueProperties() + .withKey("fakeTokenPlaceholder").withValue("mValue1"))) + .withTags(Arrays.asList(new StorageTaskPreviewKeyValueProperties() + .withKey("fakeTokenPlaceholder").withValue("tValue1"))), + new StorageTaskPreviewBlobProperties().withName("folder2/file1.txt") + .withProperties(Arrays.asList( + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("Wed, 06 Jun 2023 05:23:29 GMT"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("Wed, 06 Jun 2023 05:23:29 GMT"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("0x6FB67175454D36D"))) + .withMetadata(Arrays.asList(new StorageTaskPreviewKeyValueProperties() + .withKey("fakeTokenPlaceholder").withValue("mValue2"))) + .withTags(Arrays.asList(new StorageTaskPreviewKeyValueProperties() + .withKey("fakeTokenPlaceholder").withValue("tValue2"))))) + .withAction(new StorageTaskPreviewActionCondition() + .withIfProperty( + new StorageTaskPreviewActionIfCondition().withCondition("[[equals(AccessTier, 'Hot')]]")) + .withElseBlockExists(true))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksReportListSamples.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksReportListSamples.java new file mode 100644 index 0000000000000..404c20cead316 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksReportListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +/** + * Samples for StorageTasksReport List. + */ +public final class StorageTasksReportListSamples { + /* + * x-ms-original-file: + * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ + * storageTasksList/ListStorageTasksRunReportSummary.json + */ + /** + * Sample code: ListStorageTasksByResourceGroup. + * + * @param manager Entry point to StorageActionsManager. + */ + public static void + listStorageTasksByResourceGroup(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { + manager.storageTasksReports().list("rgroup1", "mytask1", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksUpdateSamples.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksUpdateSamples.java new file mode 100644 index 0000000000000..93b56725c2701 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksUpdateSamples.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.resourcemanager.storageactions.models.ElseCondition; +import com.azure.resourcemanager.storageactions.models.IfCondition; +import com.azure.resourcemanager.storageactions.models.OnFailure; +import com.azure.resourcemanager.storageactions.models.OnSuccess; +import com.azure.resourcemanager.storageactions.models.StorageTask; +import com.azure.resourcemanager.storageactions.models.StorageTaskAction; +import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; +import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; +import com.azure.resourcemanager.storageactions.models.StorageTaskProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for StorageTasks Update. + */ +public final class StorageTasksUpdateSamples { + /* + * x-ms-original-file: + * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ + * storageTasksCrud/PatchStorageTask.json + */ + /** + * Sample code: PatchStorageTask. + * + * @param manager Entry point to StorageActionsManager. + */ + public static void patchStorageTask(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { + StorageTask resource = manager.storageTasks() + .getByResourceGroupWithResponse("res4228", "mytask1", com.azure.core.util.Context.NONE).getValue(); + resource.update() + .withProperties(new StorageTaskProperties().withEnabled(true).withDescription("My Storage task") + .withAction(new StorageTaskAction() + .withIfProperty(new IfCondition().withCondition("[[equals(AccessTier, 'Cool')]]") + .withOperations(Arrays.asList(new StorageTaskOperation() + .withName(StorageTaskOperationName.SET_BLOB_TIER).withParameters(mapOf("tier", "Hot")) + .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))) + .withElseProperty(new ElseCondition().withOperations( + Arrays.asList(new StorageTaskOperation().withName(StorageTaskOperationName.DELETE_BLOB) + .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))))) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/ElseConditionTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/ElseConditionTests.java new file mode 100644 index 0000000000000..d8a65e226975e --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/ElseConditionTests.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.storageactions.models.ElseCondition; +import com.azure.resourcemanager.storageactions.models.OnFailure; +import com.azure.resourcemanager.storageactions.models.OnSuccess; +import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; +import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ElseConditionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ElseCondition model = BinaryData.fromString( + "{\"operations\":[{\"name\":\"SetBlobTier\",\"parameters\":{\"glu\":\"xscpaierhhbc\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]}") + .toObject(ElseCondition.class); + Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TIER, model.operations().get(0).name()); + Assertions.assertEquals("xscpaierhhbc", model.operations().get(0).parameters().get("glu")); + Assertions.assertEquals(OnSuccess.CONTINUE, model.operations().get(0).onSuccess()); + Assertions.assertEquals(OnFailure.BREAK, model.operations().get(0).onFailure()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ElseCondition model = new ElseCondition().withOperations(Arrays.asList(new StorageTaskOperation() + .withName(StorageTaskOperationName.SET_BLOB_TIER).withParameters(mapOf("glu", "xscpaierhhbc")) + .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK))); + model = BinaryData.fromObject(model).toObject(ElseCondition.class); + Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TIER, model.operations().get(0).name()); + Assertions.assertEquals("xscpaierhhbc", model.operations().get(0).parameters().get("glu")); + Assertions.assertEquals(OnSuccess.CONTINUE, model.operations().get(0).onSuccess()); + Assertions.assertEquals(OnFailure.BREAK, model.operations().get(0).onFailure()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/IfConditionTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/IfConditionTests.java new file mode 100644 index 0000000000000..9827d7e88b832 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/IfConditionTests.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.storageactions.models.IfCondition; +import com.azure.resourcemanager.storageactions.models.OnFailure; +import com.azure.resourcemanager.storageactions.models.OnSuccess; +import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; +import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class IfConditionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IfCondition model = BinaryData.fromString( + "{\"condition\":\"nteiwaopv\",\"operations\":[{\"name\":\"UndeleteBlob\",\"parameters\":{\"uf\":\"mmxdcu\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobTier\",\"parameters\":{\"xtbzsgfyccsne\":\"nsez\",\"flnrosfqpteehzz\":\"mdwzjeiachboo\",\"swjdkirso\":\"ypyqrimzinp\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"UndeleteBlob\",\"parameters\":{\"kwh\":\"nohjt\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"DeleteBlob\",\"parameters\":{\"jxvsnbyxqabn\":\"pjxsqwpgrjbznor\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]}") + .toObject(IfCondition.class); + Assertions.assertEquals("nteiwaopv", model.condition()); + Assertions.assertEquals(StorageTaskOperationName.UNDELETE_BLOB, model.operations().get(0).name()); + Assertions.assertEquals("mmxdcu", model.operations().get(0).parameters().get("uf")); + Assertions.assertEquals(OnSuccess.CONTINUE, model.operations().get(0).onSuccess()); + Assertions.assertEquals(OnFailure.BREAK, model.operations().get(0).onFailure()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IfCondition model = new IfCondition().withCondition("nteiwaopv") + .withOperations(Arrays.asList(new StorageTaskOperation().withName(StorageTaskOperationName.UNDELETE_BLOB) + .withParameters(mapOf("uf", "mmxdcu")).withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK), + new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TIER) + .withParameters( + mapOf("xtbzsgfyccsne", "nsez", "flnrosfqpteehzz", "mdwzjeiachboo", "swjdkirso", "ypyqrimzinp")) + .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK), + new StorageTaskOperation().withName(StorageTaskOperationName.UNDELETE_BLOB) + .withParameters(mapOf("kwh", "nohjt")).withOnSuccess(OnSuccess.CONTINUE) + .withOnFailure(OnFailure.BREAK), + new StorageTaskOperation().withName(StorageTaskOperationName.DELETE_BLOB) + .withParameters(mapOf("jxvsnbyxqabn", "pjxsqwpgrjbznor")).withOnSuccess(OnSuccess.CONTINUE) + .withOnFailure(OnFailure.BREAK))); + model = BinaryData.fromObject(model).toObject(IfCondition.class); + Assertions.assertEquals("nteiwaopv", model.condition()); + Assertions.assertEquals(StorageTaskOperationName.UNDELETE_BLOB, model.operations().get(0).name()); + Assertions.assertEquals("mmxdcu", model.operations().get(0).parameters().get("uf")); + Assertions.assertEquals(OnSuccess.CONTINUE, model.operations().get(0).onSuccess()); + Assertions.assertEquals(OnFailure.BREAK, model.operations().get(0).onFailure()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/ManagedServiceIdentityTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/ManagedServiceIdentityTests.java new file mode 100644 index 0000000000000..6c3385fdd86fe --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/ManagedServiceIdentityTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentity; +import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.storageactions.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ManagedServiceIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedServiceIdentity model = BinaryData.fromString( + "{\"principalId\":\"c7c2252e-661f-461c-b249-8ed6bfc8ea3f\",\"tenantId\":\"7e41176b-a8ab-48ac-87b1-1f9250f19a54\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"e\":{\"principalId\":\"75b05ff5-5ece-4cbf-a936-11d006dda614\",\"clientId\":\"54985df1-3210-423f-a85d-23847133573a\"},\"qjbasvms\":{\"principalId\":\"b471ffbc-1a28-4a9a-847d-812dbede0efe\",\"clientId\":\"0c3b6ea4-faab-4b86-858b-f60192d10283\"}}}") + .toObject(ManagedServiceIdentity.class); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedServiceIdentity model = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("e", new UserAssignedIdentity(), "qjbasvms", new UserAssignedIdentity())); + model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationDisplayTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationDisplayTests.java new file mode 100644 index 0000000000000..866ba919bb889 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationDisplayTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.storageactions.models.OperationDisplay; + +public final class OperationDisplayTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationDisplay model = BinaryData.fromString( + "{\"provider\":\"yrtih\",\"resource\":\"tijbpzvgnwzsymgl\",\"operation\":\"fcyzkohdbihanufh\",\"description\":\"bj\"}") + .toObject(OperationDisplay.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OperationDisplay model = new OperationDisplay(); + model = BinaryData.fromObject(model).toObject(OperationDisplay.class); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationInnerTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationInnerTests.java new file mode 100644 index 0000000000000..576f41e748794 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationInnerTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.storageactions.fluent.models.OperationInner; +import com.azure.resourcemanager.storageactions.models.OperationDisplay; + +public final class OperationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationInner model = BinaryData.fromString( + "{\"name\":\"usarhmofc\",\"isDataAction\":false,\"display\":{\"provider\":\"urkdtmlx\",\"resource\":\"kuksjtxukcdm\",\"operation\":\"rcryuanzwuxzdxta\",\"description\":\"lhmwhfpmrqobm\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") + .toObject(OperationInner.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); + model = BinaryData.fromObject(model).toObject(OperationInner.class); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationListResultTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationListResultTests.java new file mode 100644 index 0000000000000..8afd40f84e30a --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationListResultTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.storageactions.models.OperationListResult; + +public final class OperationListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationListResult model = BinaryData.fromString( + "{\"value\":[{\"name\":\"quvgjxpybczme\",\"isDataAction\":true,\"display\":{\"provider\":\"pbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"izhwlrxy\",\"isDataAction\":false,\"display\":{\"provider\":\"ijgkdm\",\"resource\":\"azlobcufpdznrbt\",\"operation\":\"qjnqglhqgnufoooj\",\"description\":\"ifsqesaagdfmg\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"rifkwm\",\"isDataAction\":true,\"display\":{\"provider\":\"izntocipao\",\"resource\":\"jpsq\",\"operation\":\"mpoyfd\",\"description\":\"ogknygjofjdd\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"upewnwreitjzy\"}") + .toObject(OperationListResult.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OperationListResult model = new OperationListResult(); + model = BinaryData.fromObject(model).toObject(OperationListResult.class); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationsListMockTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationsListMockTests.java new file mode 100644 index 0000000000000..c2c7327046d7c --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationsListMockTests.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.storageactions.StorageActionsManager; +import com.azure.resourcemanager.storageactions.models.Operation; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class OperationsListMockTests { + @Test + public void testList() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr + = "{\"value\":[{\"name\":\"hashsfwxosow\",\"isDataAction\":true,\"display\":{\"provider\":\"i\",\"resource\":\"ooxdjebwpuc\",\"operation\":\"fvovbvmeuecivy\",\"description\":\"ce\"},\"origin\":\"system\",\"actionType\":\"Internal\"}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito.when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito.when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + StorageActionsManager manager = StorageActionsManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskActionTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskActionTests.java new file mode 100644 index 0000000000000..76636f6a8970c --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskActionTests.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.storageactions.models.ElseCondition; +import com.azure.resourcemanager.storageactions.models.IfCondition; +import com.azure.resourcemanager.storageactions.models.OnFailure; +import com.azure.resourcemanager.storageactions.models.OnSuccess; +import com.azure.resourcemanager.storageactions.models.StorageTaskAction; +import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; +import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class StorageTaskActionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + StorageTaskAction model = BinaryData.fromString( + "{\"if\":{\"condition\":\"dmgloug\",\"operations\":[{\"name\":\"SetBlobTier\",\"parameters\":{\"wgcu\":\"mutduqktaps\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]},\"else\":{\"operations\":[{\"name\":\"UndeleteBlob\",\"parameters\":{\"bmdg\":\"qw\",\"dgmb\":\"bjf\",\"tq\":\"bexppb\",\"algbquxigjyjg\":\"rolfpfp\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobExpiry\",\"parameters\":{\"vlejuvfqa\":\"txilnerkujy\",\"xgjvtbv\":\"rlyxwjkcprbnw\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobTags\",\"parameters\":{\"guhmuouqfpr\":\"uj\",\"nguitnwuizgazxu\":\"zw\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"UndeleteBlob\",\"parameters\":{\"rfidfvzwdz\":\"i\",\"sdkf\":\"htymw\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]}}") + .toObject(StorageTaskAction.class); + Assertions.assertEquals("dmgloug", model.ifProperty().condition()); + Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TIER, model.ifProperty().operations().get(0).name()); + Assertions.assertEquals("mutduqktaps", model.ifProperty().operations().get(0).parameters().get("wgcu")); + Assertions.assertEquals(OnSuccess.CONTINUE, model.ifProperty().operations().get(0).onSuccess()); + Assertions.assertEquals(OnFailure.BREAK, model.ifProperty().operations().get(0).onFailure()); + Assertions.assertEquals(StorageTaskOperationName.UNDELETE_BLOB, + model.elseProperty().operations().get(0).name()); + Assertions.assertEquals("qw", model.elseProperty().operations().get(0).parameters().get("bmdg")); + Assertions.assertEquals(OnSuccess.CONTINUE, model.elseProperty().operations().get(0).onSuccess()); + Assertions.assertEquals(OnFailure.BREAK, model.elseProperty().operations().get(0).onFailure()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + StorageTaskAction model + = new StorageTaskAction() + .withIfProperty(new IfCondition().withCondition("dmgloug") + .withOperations(Arrays.asList(new StorageTaskOperation() + .withName(StorageTaskOperationName.SET_BLOB_TIER).withParameters(mapOf("wgcu", "mutduqktaps")) + .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))) + .withElseProperty( + new ElseCondition() + .withOperations( + Arrays + .asList( + new StorageTaskOperation().withName(StorageTaskOperationName.UNDELETE_BLOB) + .withParameters(mapOf("bmdg", "qw", "dgmb", "bjf", "tq", "bexppb", + "algbquxigjyjg", "rolfpfp")) + .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK), + new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_EXPIRY) + .withParameters(mapOf("vlejuvfqa", "txilnerkujy", "xgjvtbv", "rlyxwjkcprbnw")) + .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK), + new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TAGS) + .withParameters(mapOf("guhmuouqfpr", "uj", "nguitnwuizgazxu", "zw")) + .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK), + new StorageTaskOperation().withName(StorageTaskOperationName.UNDELETE_BLOB) + .withParameters(mapOf("rfidfvzwdz", "i", "sdkf", "htymw")) + .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))); + model = BinaryData.fromObject(model).toObject(StorageTaskAction.class); + Assertions.assertEquals("dmgloug", model.ifProperty().condition()); + Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TIER, model.ifProperty().operations().get(0).name()); + Assertions.assertEquals("mutduqktaps", model.ifProperty().operations().get(0).parameters().get("wgcu")); + Assertions.assertEquals(OnSuccess.CONTINUE, model.ifProperty().operations().get(0).onSuccess()); + Assertions.assertEquals(OnFailure.BREAK, model.ifProperty().operations().get(0).onFailure()); + Assertions.assertEquals(StorageTaskOperationName.UNDELETE_BLOB, + model.elseProperty().operations().get(0).name()); + Assertions.assertEquals("qw", model.elseProperty().operations().get(0).parameters().get("bmdg")); + Assertions.assertEquals(OnSuccess.CONTINUE, model.elseProperty().operations().get(0).onSuccess()); + Assertions.assertEquals(OnFailure.BREAK, model.elseProperty().operations().get(0).onFailure()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentInnerTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentInnerTests.java new file mode 100644 index 0000000000000..88283064e6eba --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentInnerTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskAssignmentInner; + +public final class StorageTaskAssignmentInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + StorageTaskAssignmentInner model + = BinaryData.fromString("{\"id\":\"zi\"}").toObject(StorageTaskAssignmentInner.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + StorageTaskAssignmentInner model = new StorageTaskAssignmentInner(); + model = BinaryData.fromObject(model).toObject(StorageTaskAssignmentInner.class); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentsListMockTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentsListMockTests.java new file mode 100644 index 0000000000000..0702b457614d0 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentsListMockTests.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.storageactions.StorageActionsManager; +import com.azure.resourcemanager.storageactions.models.StorageTaskAssignment; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class StorageTaskAssignmentsListMockTests { + @Test + public void testList() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = "{\"value\":[{\"id\":\"pjflcxogao\"}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito.when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito.when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + StorageActionsManager manager = StorageActionsManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response + = manager.storageTaskAssignments().list("d", "lvwiwubmwmbesl", "nkww", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentsListResultTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentsListResultTests.java new file mode 100644 index 0000000000000..f88f2582efc63 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentsListResultTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.storageactions.models.StorageTaskAssignmentsListResult; + +public final class StorageTaskAssignmentsListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + StorageTaskAssignmentsListResult model = BinaryData + .fromString( + "{\"value\":[{\"id\":\"qzntypm\"},{\"id\":\"p\"},{\"id\":\"c\"}],\"nextLink\":\"qjsdpydnfyhxdeo\"}") + .toObject(StorageTaskAssignmentsListResult.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + StorageTaskAssignmentsListResult model = new StorageTaskAssignmentsListResult(); + model = BinaryData.fromObject(model).toObject(StorageTaskAssignmentsListResult.class); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskInnerTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskInnerTests.java new file mode 100644 index 0000000000000..0319a0b785c2e --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskInnerTests.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskInner; +import com.azure.resourcemanager.storageactions.models.ElseCondition; +import com.azure.resourcemanager.storageactions.models.IfCondition; +import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentity; +import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.storageactions.models.OnFailure; +import com.azure.resourcemanager.storageactions.models.OnSuccess; +import com.azure.resourcemanager.storageactions.models.StorageTaskAction; +import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; +import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; +import com.azure.resourcemanager.storageactions.models.StorageTaskProperties; +import com.azure.resourcemanager.storageactions.models.UserAssignedIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class StorageTaskInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + StorageTaskInner model = BinaryData.fromString( + "{\"identity\":{\"principalId\":\"83e808b7-a5bb-4ef8-a32b-f52fe6ced0ed\",\"tenantId\":\"c81a3be9-9282-4f3a-aa0c-95ae338b9393\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"hab\":{\"principalId\":\"ad933690-5ed8-40f7-b652-331cf3feabe7\",\"clientId\":\"5cb20f5d-ec49-4423-be2d-2f29f4987496\"}}},\"properties\":{\"taskVersion\":4747702920878176636,\"enabled\":true,\"description\":\"wczbys\",\"action\":{\"if\":{\"condition\":\"npqxuh\",\"operations\":[{\"name\":\"UndeleteBlob\",\"parameters\":{\"tfwvukxgaudc\":\"iwbybrkxvdumjg\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]},\"else\":{\"operations\":[{\"name\":\"SetBlobTags\",\"parameters\":{\"kryhtnapczwlokj\":\"j\",\"jnchgej\":\"emkkvnipjox\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobTier\",\"parameters\":{\"o\":\"zyde\",\"wixjsprozvcp\":\"wyahuxinpmqnja\",\"atscmd\":\"tegjvwmf\",\"zkrwfn\":\"pjhulsuuvmkj\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"DeleteBlob\",\"parameters\":{\"jdpvwryo\":\"w\",\"hbcryffdfdosyge\":\"psoacctazakljl\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobTags\",\"parameters\":{\"vdphlxaolthqtr\":\"msbzjhcrz\",\"gvfcj\":\"qjbpfzfsin\",\"xjtfelluwfzit\":\"wzo\",\"qfpjk\":\"np\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]}},\"provisioningState\":\"ValidateSubscriptionQuotaEnd\",\"creationTimeInUtc\":\"2021-11-04T07:17:51Z\"},\"location\":\"fxxypininmayhuy\",\"tags\":{\"inuvamiheogn\":\"podepoo\",\"usivye\":\"rxzxtheo\"},\"id\":\"cciqihnhungbwjz\",\"name\":\"nfygxgispemvtz\",\"type\":\"kufubljo\"}") + .toObject(StorageTaskInner.class); + Assertions.assertEquals("fxxypininmayhuy", model.location()); + Assertions.assertEquals("podepoo", model.tags().get("inuvamiheogn")); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); + Assertions.assertEquals(true, model.properties().enabled()); + Assertions.assertEquals("wczbys", model.properties().description()); + Assertions.assertEquals("npqxuh", model.properties().action().ifProperty().condition()); + Assertions.assertEquals(StorageTaskOperationName.UNDELETE_BLOB, + model.properties().action().ifProperty().operations().get(0).name()); + Assertions.assertEquals("iwbybrkxvdumjg", + model.properties().action().ifProperty().operations().get(0).parameters().get("tfwvukxgaudc")); + Assertions.assertEquals(OnSuccess.CONTINUE, + model.properties().action().ifProperty().operations().get(0).onSuccess()); + Assertions.assertEquals(OnFailure.BREAK, + model.properties().action().ifProperty().operations().get(0).onFailure()); + Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TAGS, + model.properties().action().elseProperty().operations().get(0).name()); + Assertions.assertEquals("j", + model.properties().action().elseProperty().operations().get(0).parameters().get("kryhtnapczwlokj")); + Assertions.assertEquals(OnSuccess.CONTINUE, + model.properties().action().elseProperty().operations().get(0).onSuccess()); + Assertions.assertEquals(OnFailure.BREAK, + model.properties().action().elseProperty().operations().get(0).onFailure()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + StorageTaskInner model + = new StorageTaskInner().withLocation("fxxypininmayhuy") + .withTags( + mapOf("inuvamiheogn", "podepoo", "usivye", "rxzxtheo")) + .withIdentity( + new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.USER_ASSIGNED).withUserAssignedIdentities( + mapOf("hab", new UserAssignedIdentity()))) + .withProperties(new StorageTaskProperties().withEnabled(true).withDescription("wczbys") + .withAction(new StorageTaskAction() + .withIfProperty(new IfCondition().withCondition("npqxuh").withOperations( + Arrays.asList(new StorageTaskOperation().withName(StorageTaskOperationName.UNDELETE_BLOB) + .withParameters(mapOf("tfwvukxgaudc", "iwbybrkxvdumjg")) + .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))) + .withElseProperty(new ElseCondition().withOperations(Arrays.asList( + new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TAGS) + .withParameters(mapOf("kryhtnapczwlokj", "j", "jnchgej", "emkkvnipjox")) + .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK), + new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TIER) + .withParameters(mapOf("o", "zyde", "wixjsprozvcp", "wyahuxinpmqnja", "atscmd", + "tegjvwmf", "zkrwfn", "pjhulsuuvmkj")) + .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK), + new StorageTaskOperation().withName(StorageTaskOperationName.DELETE_BLOB) + .withParameters(mapOf("jdpvwryo", "w", "hbcryffdfdosyge", "psoacctazakljl")) + .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK), + new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TAGS) + .withParameters(mapOf("vdphlxaolthqtr", "msbzjhcrz", "gvfcj", "qjbpfzfsin", + "xjtfelluwfzit", "wzo", "qfpjk", "np")) + .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))))); + model = BinaryData.fromObject(model).toObject(StorageTaskInner.class); + Assertions.assertEquals("fxxypininmayhuy", model.location()); + Assertions.assertEquals("podepoo", model.tags().get("inuvamiheogn")); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); + Assertions.assertEquals(true, model.properties().enabled()); + Assertions.assertEquals("wczbys", model.properties().description()); + Assertions.assertEquals("npqxuh", model.properties().action().ifProperty().condition()); + Assertions.assertEquals(StorageTaskOperationName.UNDELETE_BLOB, + model.properties().action().ifProperty().operations().get(0).name()); + Assertions.assertEquals("iwbybrkxvdumjg", + model.properties().action().ifProperty().operations().get(0).parameters().get("tfwvukxgaudc")); + Assertions.assertEquals(OnSuccess.CONTINUE, + model.properties().action().ifProperty().operations().get(0).onSuccess()); + Assertions.assertEquals(OnFailure.BREAK, + model.properties().action().ifProperty().operations().get(0).onFailure()); + Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TAGS, + model.properties().action().elseProperty().operations().get(0).name()); + Assertions.assertEquals("j", + model.properties().action().elseProperty().operations().get(0).parameters().get("kryhtnapczwlokj")); + Assertions.assertEquals(OnSuccess.CONTINUE, + model.properties().action().elseProperty().operations().get(0).onSuccess()); + Assertions.assertEquals(OnFailure.BREAK, + model.properties().action().elseProperty().operations().get(0).onFailure()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskOperationTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskOperationTests.java new file mode 100644 index 0000000000000..6575399d44ace --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskOperationTests.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.storageactions.models.OnFailure; +import com.azure.resourcemanager.storageactions.models.OnSuccess; +import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; +import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class StorageTaskOperationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + StorageTaskOperation model = BinaryData.fromString( + "{\"name\":\"SetBlobImmutabilityPolicy\",\"parameters\":{\"jjgpb\":\"urzafb\",\"jmkljavbqidtqajz\":\"oq\",\"hbzhfepg\":\"ulpkudjkrl\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}") + .toObject(StorageTaskOperation.class); + Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_IMMUTABILITY_POLICY, model.name()); + Assertions.assertEquals("urzafb", model.parameters().get("jjgpb")); + Assertions.assertEquals(OnSuccess.CONTINUE, model.onSuccess()); + Assertions.assertEquals(OnFailure.BREAK, model.onFailure()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + StorageTaskOperation model + = new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_IMMUTABILITY_POLICY) + .withParameters(mapOf("jjgpb", "urzafb", "jmkljavbqidtqajz", "oq", "hbzhfepg", "ulpkudjkrl")) + .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK); + model = BinaryData.fromObject(model).toObject(StorageTaskOperation.class); + Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_IMMUTABILITY_POLICY, model.name()); + Assertions.assertEquals("urzafb", model.parameters().get("jjgpb")); + Assertions.assertEquals(OnSuccess.CONTINUE, model.onSuccess()); + Assertions.assertEquals(OnFailure.BREAK, model.onFailure()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPreviewActionConditionTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPreviewActionConditionTests.java new file mode 100644 index 0000000000000..a9c02d7d40ab7 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPreviewActionConditionTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionCondition; +import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionIfCondition; +import org.junit.jupiter.api.Assertions; + +public final class StorageTaskPreviewActionConditionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + StorageTaskPreviewActionCondition model + = BinaryData.fromString("{\"if\":{\"condition\":\"k\"},\"elseBlockExists\":true}") + .toObject(StorageTaskPreviewActionCondition.class); + Assertions.assertEquals("k", model.ifProperty().condition()); + Assertions.assertEquals(true, model.elseBlockExists()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + StorageTaskPreviewActionCondition model = new StorageTaskPreviewActionCondition() + .withIfProperty(new StorageTaskPreviewActionIfCondition().withCondition("k")).withElseBlockExists(true); + model = BinaryData.fromObject(model).toObject(StorageTaskPreviewActionCondition.class); + Assertions.assertEquals("k", model.ifProperty().condition()); + Assertions.assertEquals(true, model.elseBlockExists()); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPreviewActionIfConditionTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPreviewActionIfConditionTests.java new file mode 100644 index 0000000000000..dbdc55c628993 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPreviewActionIfConditionTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionIfCondition; +import org.junit.jupiter.api.Assertions; + +public final class StorageTaskPreviewActionIfConditionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + StorageTaskPreviewActionIfCondition model = BinaryData.fromString("{\"condition\":\"liourqhak\"}") + .toObject(StorageTaskPreviewActionIfCondition.class); + Assertions.assertEquals("liourqhak", model.condition()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + StorageTaskPreviewActionIfCondition model + = new StorageTaskPreviewActionIfCondition().withCondition("liourqhak"); + model = BinaryData.fromObject(model).toObject(StorageTaskPreviewActionIfCondition.class); + Assertions.assertEquals("liourqhak", model.condition()); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPropertiesTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPropertiesTests.java new file mode 100644 index 0000000000000..4be310dfae801 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPropertiesTests.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.storageactions.models.ElseCondition; +import com.azure.resourcemanager.storageactions.models.IfCondition; +import com.azure.resourcemanager.storageactions.models.OnFailure; +import com.azure.resourcemanager.storageactions.models.OnSuccess; +import com.azure.resourcemanager.storageactions.models.StorageTaskAction; +import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; +import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; +import com.azure.resourcemanager.storageactions.models.StorageTaskProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class StorageTaskPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + StorageTaskProperties model = BinaryData.fromString( + "{\"taskVersion\":8951881074960566818,\"enabled\":true,\"description\":\"sntnbybkzgcw\",\"action\":{\"if\":{\"condition\":\"wclxxwrl\",\"operations\":[{\"name\":\"UndeleteBlob\",\"parameters\":{\"dkwt\":\"kcqvkocrc\",\"ssainqpjwnzll\":\"hxbnjbiksqrg\",\"bvmgxsabkyqduuji\":\"fmppe\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobTier\",\"parameters\":{\"sbdkvwr\":\"vndhkrwpdapp\",\"tjelt\":\"jfeusnh\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobTier\",\"parameters\":{\"tqxhocdgeab\":\"zzd\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobTier\",\"parameters\":{\"aozwyiftyhxhu\":\"ndv\",\"fkgiawxk\":\"okftyxolniwpwcuk\",\"dhsgcba\":\"ryplwckbasyypn\",\"dlikwyqkgfgibma\":\"phejkotynqgoulz\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]},\"else\":{\"operations\":[{\"name\":\"SetBlobTier\",\"parameters\":{\"ouf\":\"bzqqedqytbciq\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]}},\"provisioningState\":\"ValidateSubscriptionQuotaEnd\",\"creationTimeInUtc\":\"2021-10-01T10:06:40Z\"}") + .toObject(StorageTaskProperties.class); + Assertions.assertEquals(true, model.enabled()); + Assertions.assertEquals("sntnbybkzgcw", model.description()); + Assertions.assertEquals("wclxxwrl", model.action().ifProperty().condition()); + Assertions.assertEquals(StorageTaskOperationName.UNDELETE_BLOB, + model.action().ifProperty().operations().get(0).name()); + Assertions.assertEquals("kcqvkocrc", model.action().ifProperty().operations().get(0).parameters().get("dkwt")); + Assertions.assertEquals(OnSuccess.CONTINUE, model.action().ifProperty().operations().get(0).onSuccess()); + Assertions.assertEquals(OnFailure.BREAK, model.action().ifProperty().operations().get(0).onFailure()); + Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TIER, + model.action().elseProperty().operations().get(0).name()); + Assertions.assertEquals("bzqqedqytbciq", + model.action().elseProperty().operations().get(0).parameters().get("ouf")); + Assertions.assertEquals(OnSuccess.CONTINUE, model.action().elseProperty().operations().get(0).onSuccess()); + Assertions.assertEquals(OnFailure.BREAK, model.action().elseProperty().operations().get(0).onFailure()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + StorageTaskProperties model = new StorageTaskProperties().withEnabled(true).withDescription("sntnbybkzgcw") + .withAction(new StorageTaskAction() + .withIfProperty(new IfCondition().withCondition("wclxxwrl") + .withOperations(Arrays.asList( + new StorageTaskOperation().withName(StorageTaskOperationName.UNDELETE_BLOB) + .withParameters(mapOf("dkwt", "kcqvkocrc", "ssainqpjwnzll", "hxbnjbiksqrg", + "bvmgxsabkyqduuji", "fmppe")) + .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK), + new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TIER) + .withParameters(mapOf("sbdkvwr", "vndhkrwpdapp", "tjelt", "jfeusnh")) + .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK), + new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TIER) + .withParameters(mapOf("tqxhocdgeab", "zzd")).withOnSuccess(OnSuccess.CONTINUE) + .withOnFailure(OnFailure.BREAK), + new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TIER) + .withParameters(mapOf("aozwyiftyhxhu", "ndv", "fkgiawxk", "okftyxolniwpwcuk", "dhsgcba", + "ryplwckbasyypn", "dlikwyqkgfgibma", "phejkotynqgoulz")) + .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))) + .withElseProperty(new ElseCondition().withOperations(Arrays.asList(new StorageTaskOperation() + .withName(StorageTaskOperationName.SET_BLOB_TIER).withParameters(mapOf("ouf", "bzqqedqytbciq")) + .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK))))); + model = BinaryData.fromObject(model).toObject(StorageTaskProperties.class); + Assertions.assertEquals(true, model.enabled()); + Assertions.assertEquals("sntnbybkzgcw", model.description()); + Assertions.assertEquals("wclxxwrl", model.action().ifProperty().condition()); + Assertions.assertEquals(StorageTaskOperationName.UNDELETE_BLOB, + model.action().ifProperty().operations().get(0).name()); + Assertions.assertEquals("kcqvkocrc", model.action().ifProperty().operations().get(0).parameters().get("dkwt")); + Assertions.assertEquals(OnSuccess.CONTINUE, model.action().ifProperty().operations().get(0).onSuccess()); + Assertions.assertEquals(OnFailure.BREAK, model.action().ifProperty().operations().get(0).onFailure()); + Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TIER, + model.action().elseProperty().operations().get(0).name()); + Assertions.assertEquals("bzqqedqytbciq", + model.action().elseProperty().operations().get(0).parameters().get("ouf")); + Assertions.assertEquals(OnSuccess.CONTINUE, model.action().elseProperty().operations().get(0).onSuccess()); + Assertions.assertEquals(OnFailure.BREAK, model.action().elseProperty().operations().get(0).onFailure()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportInstanceInnerTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportInstanceInnerTests.java new file mode 100644 index 0000000000000..84e420fa609e9 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportInstanceInnerTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskReportInstanceInner; +import com.azure.resourcemanager.storageactions.models.StorageTaskReportProperties; + +public final class StorageTaskReportInstanceInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + StorageTaskReportInstanceInner model = BinaryData.fromString( + "{\"properties\":{\"taskAssignmentId\":\"baiuebbaumny\",\"storageAccountId\":\"ped\",\"startTime\":\"jn\",\"finishTime\":\"ckhsmtxpsieb\",\"objectsTargetedCount\":\"hvpesapskrdqm\",\"objectsOperatedOnCount\":\"jdhtldwkyzxu\",\"objectFailedCount\":\"kn\",\"objectsSucceededCount\":\"scwsv\",\"runStatusError\":\"otogtwrupqs\",\"runStatusEnum\":\"InProgress\",\"summaryReportPath\":\"i\",\"taskId\":\"kvceoveilovnotyf\",\"taskVersion\":\"cnjbkcnxdhbt\",\"runResult\":\"Succeeded\"},\"id\":\"ywpnvjt\",\"name\":\"qnermclfplphoxu\",\"type\":\"crpab\"}") + .toObject(StorageTaskReportInstanceInner.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + StorageTaskReportInstanceInner model + = new StorageTaskReportInstanceInner().withProperties(new StorageTaskReportProperties()); + model = BinaryData.fromObject(model).toObject(StorageTaskReportInstanceInner.class); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportPropertiesTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportPropertiesTests.java new file mode 100644 index 0000000000000..ce106294ec42b --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportPropertiesTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.storageactions.models.StorageTaskReportProperties; + +public final class StorageTaskReportPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + StorageTaskReportProperties model = BinaryData.fromString( + "{\"taskAssignmentId\":\"epsbjtazqu\",\"storageAccountId\":\"ywpmueefjzwfqkq\",\"startTime\":\"ids\",\"finishTime\":\"onobglaocqx\",\"objectsTargetedCount\":\"cmgyud\",\"objectsOperatedOnCount\":\"tlmoyrx\",\"objectFailedCount\":\"fudwpznt\",\"objectsSucceededCount\":\"dzhlrq\",\"runStatusError\":\"hckfrlhrx\",\"runStatusEnum\":\"InProgress\",\"summaryReportPath\":\"vpycanuzbp\",\"taskId\":\"afkuwb\",\"taskVersion\":\"nwbmeh\",\"runResult\":\"Failed\"}") + .toObject(StorageTaskReportProperties.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + StorageTaskReportProperties model = new StorageTaskReportProperties(); + model = BinaryData.fromObject(model).toObject(StorageTaskReportProperties.class); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportSummaryTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportSummaryTests.java new file mode 100644 index 0000000000000..3eff706d35b67 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportSummaryTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.storageactions.models.StorageTaskReportSummary; + +public final class StorageTaskReportSummaryTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + StorageTaskReportSummary model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"taskAssignmentId\":\"jttgzf\",\"storageAccountId\":\"shcbkhajdeyeamdp\",\"startTime\":\"g\",\"finishTime\":\"pbuxwgipwhon\",\"objectsTargetedCount\":\"kgshwa\",\"objectsOperatedOnCount\":\"ixzbinjeputtmryw\",\"objectFailedCount\":\"zoqftiyqzrnkcqvy\",\"objectsSucceededCount\":\"whzlsicohoq\",\"runStatusError\":\"wvl\",\"runStatusEnum\":\"Finished\",\"summaryReportPath\":\"w\",\"taskId\":\"eun\",\"taskVersion\":\"qhgyxzkonocukok\",\"runResult\":\"Succeeded\"},\"id\":\"uconuqszfkbey\",\"name\":\"ewrmjmwvvjektc\",\"type\":\"senhwlrs\"},{\"properties\":{\"taskAssignmentId\":\"zpwv\",\"storageAccountId\":\"dqgbiqylihkaetc\",\"startTime\":\"vfcivfsnkymuc\",\"finishTime\":\"hjfbebrjcxe\",\"objectsTargetedCount\":\"uwutttxfvjrbi\",\"objectsOperatedOnCount\":\"hxepcyvahfnlj\",\"objectFailedCount\":\"qxj\",\"objectsSucceededCount\":\"ujqgidok\",\"runStatusError\":\"ljyoxgvcltb\",\"runStatusEnum\":\"InProgress\",\"summaryReportPath\":\"ghkjeszzhbi\",\"taskId\":\"txfvgx\",\"taskVersion\":\"smx\",\"runResult\":\"Succeeded\"},\"id\":\"pvecxgodeb\",\"name\":\"qkkrb\",\"type\":\"pukgriwflzlfb\"},{\"properties\":{\"taskAssignmentId\":\"uzycispnqza\",\"storageAccountId\":\"gkbrpyyd\",\"startTime\":\"bnuqqkpik\",\"finishTime\":\"rgvtqag\",\"objectsTargetedCount\":\"uynhijg\",\"objectsOperatedOnCount\":\"ebf\",\"objectFailedCount\":\"arbu\",\"objectsSucceededCount\":\"cvpnazzmhjrunmpx\",\"runStatusError\":\"dbhrbnlankxm\",\"runStatusEnum\":\"InProgress\",\"summaryReportPath\":\"bhenbtkcxywnyt\",\"taskId\":\"synlqidybyxczfc\",\"taskVersion\":\"aaxdbabphlwrq\",\"runResult\":\"Failed\"},\"id\":\"sthsu\",\"name\":\"ocmnyyazttbtwwrq\",\"type\":\"uedck\"},{\"properties\":{\"taskAssignmentId\":\"biexzfeyu\",\"storageAccountId\":\"xibxujwbhqwalm\",\"startTime\":\"yoxa\",\"finishTime\":\"dkzjancuxrh\",\"objectsTargetedCount\":\"bavxbniwdjswzt\",\"objectsOperatedOnCount\":\"bpg\",\"objectFailedCount\":\"ytxhp\",\"objectsSucceededCount\":\"bzpfzab\",\"runStatusError\":\"cuh\",\"runStatusEnum\":\"InProgress\",\"summaryReportPath\":\"tyq\",\"taskId\":\"lbbovplw\",\"taskVersion\":\"hvgyuguosvmk\",\"runResult\":\"Succeeded\"},\"id\":\"qukkfp\",\"name\":\"gmgsxnkjzkde\",\"type\":\"lpvlopw\"}],\"nextLink\":\"ighxpk\"}") + .toObject(StorageTaskReportSummary.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + StorageTaskReportSummary model = new StorageTaskReportSummary(); + model = BinaryData.fromObject(model).toObject(StorageTaskReportSummary.class); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskUpdateParametersTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskUpdateParametersTests.java new file mode 100644 index 0000000000000..f563f2f49af37 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskUpdateParametersTests.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.storageactions.models.ElseCondition; +import com.azure.resourcemanager.storageactions.models.IfCondition; +import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentity; +import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.storageactions.models.OnFailure; +import com.azure.resourcemanager.storageactions.models.OnSuccess; +import com.azure.resourcemanager.storageactions.models.StorageTaskAction; +import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; +import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; +import com.azure.resourcemanager.storageactions.models.StorageTaskProperties; +import com.azure.resourcemanager.storageactions.models.StorageTaskUpdateParameters; +import com.azure.resourcemanager.storageactions.models.UserAssignedIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class StorageTaskUpdateParametersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + StorageTaskUpdateParameters model = BinaryData.fromString( + "{\"identity\":{\"principalId\":\"420e56ab-ec1e-461b-a795-2283ac80f946\",\"tenantId\":\"9481aa93-0af4-463c-a199-e281d8165022\",\"type\":\"None\",\"userAssignedIdentities\":{\"bdxkqpxokaj\":{\"principalId\":\"69920218-4471-49e7-a35e-acb644abe102\",\"clientId\":\"17505a17-f98c-476b-ae2d-cff2ac30ec0e\"},\"pimexgstxgcpodg\":{\"principalId\":\"3d014324-4819-48e2-ad99-9041cef9a290\",\"clientId\":\"40460eb0-b187-4fac-9696-8aacb6896bea\"},\"jrmvdjwzrlo\":{\"principalId\":\"09a96325-100a-499f-9ae5-54486760a915\",\"clientId\":\"a2350f52-3d8e-4218-a582-c9580f266c87\"},\"lwhijcoejctbzaq\":{\"principalId\":\"69e520ad-8c41-444d-9741-ada98a58689d\",\"clientId\":\"4a000af0-b8dc-4aed-9d4d-be3bb0cd380e\"}}},\"tags\":{\"bkbfkgukdkex\":\"y\",\"ocjjxhvpmouexh\":\"ppofmxaxcfjpgdd\"},\"properties\":{\"taskVersion\":986313719569038785,\"enabled\":true,\"description\":\"eojnxqbzvddn\",\"action\":{\"if\":{\"condition\":\"wndeicbtwnp\",\"operations\":[{\"name\":\"SetBlobLegalHold\",\"parameters\":{\"jthjqkwpyei\":\"uhrhcffcyddgl\",\"q\":\"xmqci\",\"xuigdtopbobj\":\"hkh\",\"uhrzayvvt\":\"ghmewuam\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobTags\",\"parameters\":{\"efgugnxk\":\"tkftutqxlngx\",\"hjybigehoqfbo\":\"xdqmidtthzrvqdra\",\"zlcuiywgqywgndrv\":\"skanyk\",\"ocpecfvmmco\":\"nhzgpphrcgyn\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]},\"else\":{\"operations\":[{\"name\":\"SetBlobTags\",\"parameters\":{\"jqabcypmivkwlzuv\":\"m\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"DeleteBlob\",\"parameters\":{\"nlebxetqgtzxd\":\"acfi\",\"feallnwsu\":\"nqbqqwxr\",\"c\":\"isnjampmngnz\",\"ochcbonqvpkvl\":\"aqw\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]}},\"provisioningState\":\"Failed\",\"creationTimeInUtc\":\"2021-02-05T10:28:18Z\"}}") + .toObject(StorageTaskUpdateParameters.class); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); + Assertions.assertEquals("y", model.tags().get("bkbfkgukdkex")); + Assertions.assertEquals(true, model.properties().enabled()); + Assertions.assertEquals("eojnxqbzvddn", model.properties().description()); + Assertions.assertEquals("wndeicbtwnp", model.properties().action().ifProperty().condition()); + Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_LEGAL_HOLD, + model.properties().action().ifProperty().operations().get(0).name()); + Assertions.assertEquals("uhrhcffcyddgl", + model.properties().action().ifProperty().operations().get(0).parameters().get("jthjqkwpyei")); + Assertions.assertEquals(OnSuccess.CONTINUE, + model.properties().action().ifProperty().operations().get(0).onSuccess()); + Assertions.assertEquals(OnFailure.BREAK, + model.properties().action().ifProperty().operations().get(0).onFailure()); + Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TAGS, + model.properties().action().elseProperty().operations().get(0).name()); + Assertions.assertEquals("m", + model.properties().action().elseProperty().operations().get(0).parameters().get("jqabcypmivkwlzuv")); + Assertions.assertEquals(OnSuccess.CONTINUE, + model.properties().action().elseProperty().operations().get(0).onSuccess()); + Assertions.assertEquals(OnFailure.BREAK, + model.properties().action().elseProperty().operations().get(0).onFailure()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + StorageTaskUpdateParameters model + = new StorageTaskUpdateParameters() + .withIdentity( + new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) + .withUserAssignedIdentities(mapOf( + "bdxkqpxokaj", new UserAssignedIdentity(), "pimexgstxgcpodg", new UserAssignedIdentity(), + "jrmvdjwzrlo", new UserAssignedIdentity(), "lwhijcoejctbzaq", new UserAssignedIdentity()))) + .withTags(mapOf("bkbfkgukdkex", "y", "ocjjxhvpmouexh", "ppofmxaxcfjpgdd")) + .withProperties(new StorageTaskProperties().withEnabled(true).withDescription("eojnxqbzvddn") + .withAction(new StorageTaskAction() + .withIfProperty(new IfCondition().withCondition("wndeicbtwnp").withOperations(Arrays.asList( + new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_LEGAL_HOLD) + .withParameters(mapOf("jthjqkwpyei", "uhrhcffcyddgl", "q", "xmqci", "xuigdtopbobj", + "hkh", "uhrzayvvt", "ghmewuam")) + .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK), + new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TAGS) + .withParameters(mapOf("efgugnxk", "tkftutqxlngx", "hjybigehoqfbo", "xdqmidtthzrvqdra", + "zlcuiywgqywgndrv", "skanyk", "ocpecfvmmco", "nhzgpphrcgyn")) + .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))) + .withElseProperty(new ElseCondition().withOperations(Arrays.asList( + new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TAGS) + .withParameters(mapOf("jqabcypmivkwlzuv", "m")).withOnSuccess(OnSuccess.CONTINUE) + .withOnFailure(OnFailure.BREAK), + new StorageTaskOperation().withName(StorageTaskOperationName.DELETE_BLOB) + .withParameters(mapOf("nlebxetqgtzxd", "acfi", "feallnwsu", "nqbqqwxr", "c", + "isnjampmngnz", "ochcbonqvpkvl", "aqw")) + .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))))); + model = BinaryData.fromObject(model).toObject(StorageTaskUpdateParameters.class); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); + Assertions.assertEquals("y", model.tags().get("bkbfkgukdkex")); + Assertions.assertEquals(true, model.properties().enabled()); + Assertions.assertEquals("eojnxqbzvddn", model.properties().description()); + Assertions.assertEquals("wndeicbtwnp", model.properties().action().ifProperty().condition()); + Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_LEGAL_HOLD, + model.properties().action().ifProperty().operations().get(0).name()); + Assertions.assertEquals("uhrhcffcyddgl", + model.properties().action().ifProperty().operations().get(0).parameters().get("jthjqkwpyei")); + Assertions.assertEquals(OnSuccess.CONTINUE, + model.properties().action().ifProperty().operations().get(0).onSuccess()); + Assertions.assertEquals(OnFailure.BREAK, + model.properties().action().ifProperty().operations().get(0).onFailure()); + Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TAGS, + model.properties().action().elseProperty().operations().get(0).name()); + Assertions.assertEquals("m", + model.properties().action().elseProperty().operations().get(0).parameters().get("jqabcypmivkwlzuv")); + Assertions.assertEquals(OnSuccess.CONTINUE, + model.properties().action().elseProperty().operations().get(0).onSuccess()); + Assertions.assertEquals(OnFailure.BREAK, + model.properties().action().elseProperty().operations().get(0).onFailure()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksCreateMockTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksCreateMockTests.java new file mode 100644 index 0000000000000..6a9d48ce9e003 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksCreateMockTests.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.storageactions.StorageActionsManager; +import com.azure.resourcemanager.storageactions.models.ElseCondition; +import com.azure.resourcemanager.storageactions.models.IfCondition; +import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentity; +import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.storageactions.models.StorageTask; +import com.azure.resourcemanager.storageactions.models.StorageTaskAction; +import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; +import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; +import com.azure.resourcemanager.storageactions.models.StorageTaskProperties; +import com.azure.resourcemanager.storageactions.models.UserAssignedIdentity; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class StorageTasksCreateMockTests { + @Test + public void testCreate() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr + = "{\"identity\":{\"principalId\":\"496531ec-078c-41a1-b292-20c319031924\",\"tenantId\":\"99cc0d84-e433-4f1e-a62b-8a869c838859\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"gynduha\":{\"principalId\":\"4dbef6ab-4ed9-4317-8e11-7edb11a24e8d\",\"clientId\":\"6d0d556f-0590-49e0-be15-8310379ae856\"}}},\"properties\":{\"taskVersion\":5319393141348418027,\"enabled\":false,\"description\":\"humaqolbgyc\",\"action\":{\"if\":{\"condition\":\"uie\",\"operations\":[{\"name\":\"SetBlobImmutabilityPolicy\"},{\"name\":\"SetBlobImmutabilityPolicy\"},{\"name\":\"SetBlobTier\"},{\"name\":\"SetBlobImmutabilityPolicy\"}]},\"else\":{\"operations\":[{\"name\":\"DeleteBlob\"},{\"name\":\"SetBlobTier\"},{\"name\":\"DeleteBlob\"}]}},\"provisioningState\":\"Succeeded\",\"creationTimeInUtc\":\"2021-10-20T11:28:50Z\"},\"location\":\"lfmmdnbbglzpswi\",\"tags\":{\"bzmnvdfznud\":\"cwyhzdxssa\",\"xzb\":\"od\",\"dzu\":\"cblylpstdbhhxsr\",\"fiwjmygtdssls\":\"erscdntne\"},\"id\":\"tmweriofzpyq\",\"name\":\"emwabnet\",\"type\":\"hhszh\"}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito.when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito.when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + StorageActionsManager manager = StorageActionsManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + StorageTask response + = manager.storageTasks().define("xoblytkbl").withRegion("l").withExistingResourceGroup("qmcbxvwvxyslqbhs") + .withTags(mapOf("jmkcjhwqytj", "fqqnvwpmqtaruo", "jewgdrjerv", "ybn")) + .withIdentity(new ManagedServiceIdentity() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("rvrnsvshqjohxc", new UserAssignedIdentity(), "fovasr", + new UserAssignedIdentity(), "wbhsqfsub", new UserAssignedIdentity()))) + .withProperties( + new StorageTaskProperties() + .withEnabled(false).withDescription( + "xb") + .withAction(new StorageTaskAction() + .withIfProperty(new IfCondition().withCondition("ybsrfbjfdtwss") + .withOperations(Arrays.asList( + new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TIER)))) + .withElseProperty(new ElseCondition().withOperations(Arrays.asList( + new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TAGS), + new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TIER)))))) + .create(); + + Assertions.assertEquals("lfmmdnbbglzpswi", response.location()); + Assertions.assertEquals("cwyhzdxssa", response.tags().get("bzmnvdfznud")); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); + Assertions.assertEquals(false, response.properties().enabled()); + Assertions.assertEquals("humaqolbgyc", response.properties().description()); + Assertions.assertEquals("uie", response.properties().action().ifProperty().condition()); + Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_IMMUTABILITY_POLICY, + response.properties().action().ifProperty().operations().get(0).name()); + Assertions.assertEquals(StorageTaskOperationName.DELETE_BLOB, + response.properties().action().elseProperty().operations().get(0).name()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksGetByResourceGroupWithResponseMockTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksGetByResourceGroupWithResponseMockTests.java new file mode 100644 index 0000000000000..9742712f9b1e7 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksGetByResourceGroupWithResponseMockTests.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.storageactions.StorageActionsManager; +import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.storageactions.models.StorageTask; +import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class StorageTasksGetByResourceGroupWithResponseMockTests { + @Test + public void testGetByResourceGroupWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr + = "{\"identity\":{\"principalId\":\"463cdcac-3402-4d57-9df7-28ca146dd88d\",\"tenantId\":\"36fc4815-7972-499e-910d-60a44d18aecb\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"awgqwgxhni\":{\"principalId\":\"f2cfa7dc-89ee-4bc2-8ba3-8ebd33522cf1\",\"clientId\":\"acdf96ff-d771-4c5c-a1b0-0b0677e5d05f\"},\"fbkp\":{\"principalId\":\"64b2a031-8cdf-4384-bb80-2f2d6db78c23\",\"clientId\":\"8d3c9b0b-c5a4-4bc6-8cba-de46f6fb809e\"},\"klwndnhjdauwhv\":{\"principalId\":\"11301dfe-ca41-45c0-9ca2-6f76e1ae32c6\",\"clientId\":\"cfb214ab-25d6-400d-8d72-7260f7c080fe\"}}},\"properties\":{\"taskVersion\":3762934959589982311,\"enabled\":true,\"description\":\"dhxujznbmpo\",\"action\":{\"if\":{\"condition\":\"uwprzql\",\"operations\":[{\"name\":\"SetBlobTier\"},{\"name\":\"DeleteBlob\"},{\"name\":\"SetBlobLegalHold\"}]},\"else\":{\"operations\":[{\"name\":\"SetBlobImmutabilityPolicy\"},{\"name\":\"SetBlobImmutabilityPolicy\"},{\"name\":\"SetBlobTier\"}]}},\"provisioningState\":\"Creating\",\"creationTimeInUtc\":\"2021-08-19T13:39:55Z\"},\"location\":\"bcswsrt\",\"tags\":{\"blcg\":\"plrbpbewtghf\",\"nmxiebwwaloayqc\":\"xzvlvqhjkbegib\",\"uzgwyzmhtx\":\"wrtz\",\"wxqpsrknftguvri\":\"ngmtsavjcb\"},\"id\":\"hprwmdyv\",\"name\":\"qtayri\",\"type\":\"wroyqbexrmcq\"}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito.when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito.when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + StorageActionsManager manager = StorageActionsManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + StorageTask response = manager.storageTasks() + .getByResourceGroupWithResponse("rw", "ueiotwmcdyt", com.azure.core.util.Context.NONE).getValue(); + + Assertions.assertEquals("bcswsrt", response.location()); + Assertions.assertEquals("plrbpbewtghf", response.tags().get("blcg")); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); + Assertions.assertEquals(true, response.properties().enabled()); + Assertions.assertEquals("dhxujznbmpo", response.properties().description()); + Assertions.assertEquals("uwprzql", response.properties().action().ifProperty().condition()); + Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TIER, + response.properties().action().ifProperty().operations().get(0).name()); + Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_IMMUTABILITY_POLICY, + response.properties().action().elseProperty().operations().get(0).name()); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListByResourceGroupMockTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListByResourceGroupMockTests.java new file mode 100644 index 0000000000000..ee2b043ad06e3 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListByResourceGroupMockTests.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.storageactions.StorageActionsManager; +import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.storageactions.models.StorageTask; +import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class StorageTasksListByResourceGroupMockTests { + @Test + public void testListByResourceGroup() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr + = "{\"value\":[{\"identity\":{\"principalId\":\"04894d15-04e7-4cf0-9d69-feb5cb2982c4\",\"tenantId\":\"a70029d4-c9aa-48ba-83d8-09382897cab2\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"knalaulppg\":{\"principalId\":\"d25de069-4463-4b96-a6ce-b75be33579b7\",\"clientId\":\"2ed22701-4c3b-49c0-a58c-5827995f4b22\"},\"pnapnyiropuh\":{\"principalId\":\"04e0fd22-d9a0-452c-af94-8043f84f6985\",\"clientId\":\"b64a58c0-2002-4c24-962f-f926f17784a0\"},\"vpgylgqgitxmed\":{\"principalId\":\"4f8c14cc-d7d3-4aa0-86a7-d0c8f7372886\",\"clientId\":\"370dbdfa-13ca-4fa7-b3c9-b06259ff16ee\"},\"slynqwwnc\":{\"principalId\":\"f742c410-7782-4883-a37e-8cdf109f5cf1\",\"clientId\":\"84c64f10-9ebc-48f0-a2ff-683b551ecbda\"}}},\"properties\":{\"taskVersion\":2313446192917643442,\"enabled\":true,\"description\":\"ktrmgucnapkt\",\"action\":{\"if\":{\"condition\":\"oellwp\",\"operations\":[{\"name\":\"SetBlobImmutabilityPolicy\"},{\"name\":\"SetBlobLegalHold\"},{\"name\":\"SetBlobImmutabilityPolicy\"},{\"name\":\"SetBlobTags\"}]},\"else\":{\"operations\":[{\"name\":\"DeleteBlob\"},{\"name\":\"SetBlobImmutabilityPolicy\"},{\"name\":\"SetBlobTags\"}]}},\"provisioningState\":\"Canceled\",\"creationTimeInUtc\":\"2021-03-25T11:42:18Z\"},\"location\":\"fqrhhuaopppc\",\"tags\":{\"t\":\"xolzdahzx\",\"grcfb\":\"bgbkdmoizpost\",\"bpvjymjhx\":\"nrmfqjhhk\"},\"id\":\"j\",\"name\":\"n\",\"type\":\"u\"}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito.when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito.when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + StorageActionsManager manager = StorageActionsManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response + = manager.storageTasks().listByResourceGroup("exznelixhnr", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("fqrhhuaopppc", response.iterator().next().location()); + Assertions.assertEquals("xolzdahzx", response.iterator().next().tags().get("t")); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, + response.iterator().next().identity().type()); + Assertions.assertEquals(true, response.iterator().next().properties().enabled()); + Assertions.assertEquals("ktrmgucnapkt", response.iterator().next().properties().description()); + Assertions.assertEquals("oellwp", response.iterator().next().properties().action().ifProperty().condition()); + Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_IMMUTABILITY_POLICY, + response.iterator().next().properties().action().ifProperty().operations().get(0).name()); + Assertions.assertEquals(StorageTaskOperationName.DELETE_BLOB, + response.iterator().next().properties().action().elseProperty().operations().get(0).name()); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListMockTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListMockTests.java new file mode 100644 index 0000000000000..46d8979e48d09 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListMockTests.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.storageactions.StorageActionsManager; +import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.storageactions.models.StorageTask; +import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class StorageTasksListMockTests { + @Test + public void testList() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr + = "{\"value\":[{\"identity\":{\"principalId\":\"0e0baf01-1b68-440e-974d-6b605a3fedc2\",\"tenantId\":\"af70cd24-bae4-4560-8ee0-49baf3d800ea\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"nmefqsgzvahapj\":{\"principalId\":\"1a05b8c0-edfb-4099-ba60-c988cab9e389\",\"clientId\":\"2eb95787-91f2-445a-b5f6-db0733e622f6\"}}},\"properties\":{\"taskVersion\":7368048825846520103,\"enabled\":false,\"description\":\"qzcjrvxdj\",\"action\":{\"if\":{\"condition\":\"lmwlxkvugfhzo\",\"operations\":[{\"name\":\"UndeleteBlob\"},{\"name\":\"SetBlobLegalHold\"},{\"name\":\"SetBlobImmutabilityPolicy\"},{\"name\":\"SetBlobTags\"}]},\"else\":{\"operations\":[{\"name\":\"UndeleteBlob\"},{\"name\":\"SetBlobExpiry\"}]}},\"provisioningState\":\"Creating\",\"creationTimeInUtc\":\"2021-09-06T05:22:37Z\"},\"location\":\"rnxipei\",\"tags\":{\"ltskzbbtd\":\"zuaejxd\",\"bsjyofdx\":\"umveekgpwozuhkf\",\"oekqvk\":\"uusdttouwa\",\"vbxwyjsflhh\":\"lns\"},\"id\":\"aalnjixi\",\"name\":\"xyawj\",\"type\":\"yaqcslyjpkiidz\"}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito.when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito.when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + StorageActionsManager manager = StorageActionsManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = manager.storageTasks().list(com.azure.core.util.Context.NONE); + + Assertions.assertEquals("rnxipei", response.iterator().next().location()); + Assertions.assertEquals("zuaejxd", response.iterator().next().tags().get("ltskzbbtd")); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); + Assertions.assertEquals(false, response.iterator().next().properties().enabled()); + Assertions.assertEquals("qzcjrvxdj", response.iterator().next().properties().description()); + Assertions.assertEquals("lmwlxkvugfhzo", + response.iterator().next().properties().action().ifProperty().condition()); + Assertions.assertEquals(StorageTaskOperationName.UNDELETE_BLOB, + response.iterator().next().properties().action().ifProperty().operations().get(0).name()); + Assertions.assertEquals(StorageTaskOperationName.UNDELETE_BLOB, + response.iterator().next().properties().action().elseProperty().operations().get(0).name()); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListResultTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListResultTests.java new file mode 100644 index 0000000000000..d97c53c63771d --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListResultTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.storageactions.models.StorageTasksListResult; + +public final class StorageTasksListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + StorageTasksListResult model = BinaryData.fromString( + "{\"value\":[{\"identity\":{\"principalId\":\"6613f253-9fd6-49d3-aaf1-39b1f4674a7b\",\"tenantId\":\"5b5fa0e9-af96-4b6d-a6ea-852061ff7406\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"y\":{\"principalId\":\"8f5806c4-4011-4c2b-bbe2-f5050050c424\",\"clientId\":\"944b8738-cc8e-4f67-96c0-140d3c657b94\"},\"jbdlwtgrhpdjpju\":{\"principalId\":\"89c29dea-77ec-4330-b8e8-c79d77ed905b\",\"clientId\":\"0bf7a360-f498-476b-8d31-4a6092de7d0b\"}}},\"properties\":{\"taskVersion\":4349636942449523138,\"enabled\":false,\"description\":\"jpqyegu\",\"action\":{\"if\":{\"condition\":\"lhbxxhejjzzvdud\",\"operations\":[{\"name\":\"SetBlobImmutabilityPolicy\"},{\"name\":\"SetBlobExpiry\"},{\"name\":\"SetBlobTier\"}]},\"else\":{\"operations\":[{\"name\":\"SetBlobExpiry\"},{\"name\":\"DeleteBlob\"},{\"name\":\"DeleteBlob\"},{\"name\":\"SetBlobTags\"}]}},\"provisioningState\":\"Deleting\",\"creationTimeInUtc\":\"2021-01-27T06:45:01Z\"},\"location\":\"lbjnpgacftadehx\",\"tags\":{\"uesnzwdejbavo\":\"yfsoppu\",\"vudwx\":\"xzdmohctb\",\"gujjugwdkcglh\":\"ndnvo\",\"ofqweykhmenevfye\":\"lazjdyggdtjixhbk\"},\"id\":\"fwhybcibvy\",\"name\":\"dcsi\",\"type\":\"ynnaam\"},{\"identity\":{\"principalId\":\"3908ea50-3495-4dc1-ad41-ba0c33429fe5\",\"tenantId\":\"f388df6a-e9e5-444a-b1cb-b4f3244a0a74\",\"type\":\"None\",\"userAssignedIdentities\":{\"scjeypv\":{\"principalId\":\"b25d4190-798a-43b4-a2e2-1be710a92a95\",\"clientId\":\"e2e792fd-d5f4-4e1a-a823-0dc13df1e4fc\"}}},\"properties\":{\"taskVersion\":3144809064731797978,\"enabled\":true,\"description\":\"q\",\"action\":{\"if\":{\"condition\":\"c\",\"operations\":[{\"name\":\"SetBlobTier\"},{\"name\":\"SetBlobLegalHold\"},{\"name\":\"SetBlobTags\"},{\"name\":\"UndeleteBlob\"}]},\"else\":{\"operations\":[{\"name\":\"DeleteBlob\"},{\"name\":\"SetBlobLegalHold\"},{\"name\":\"SetBlobExpiry\"}]}},\"provisioningState\":\"Deleting\",\"creationTimeInUtc\":\"2021-08-20T18:32:02Z\"},\"location\":\"xyqj\",\"tags\":{\"jh\":\"attpngjcrcczsq\",\"ysou\":\"mdajv\",\"canoaeupf\":\"q\",\"tuo\":\"yhltrpmopjmcm\"},\"id\":\"thfuiuaodsfcpkvx\",\"name\":\"dpuozmyz\",\"type\":\"dagfuaxbezyiuok\"},{\"identity\":{\"principalId\":\"3c2ba404-ec2a-4735-b73f-83da124badfb\",\"tenantId\":\"9cca81f9-dc9c-4f88-bed3-15986fec25fa\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"ywqsmbsurexim\":{\"principalId\":\"a0c9881e-8c73-4560-9ed2-caf1199e6488\",\"clientId\":\"b60b4c02-30c4-4919-8ae6-b020228fd456\"}}},\"properties\":{\"taskVersion\":4342038682597268889,\"enabled\":true,\"description\":\"sfksy\",\"action\":{\"if\":{\"condition\":\"ddystkiiuxhqy\",\"operations\":[{\"name\":\"SetBlobLegalHold\"},{\"name\":\"SetBlobTier\"},{\"name\":\"SetBlobExpiry\"},{\"name\":\"SetBlobTags\"}]},\"else\":{\"operations\":[{\"name\":\"SetBlobImmutabilityPolicy\"},{\"name\":\"SetBlobTags\"},{\"name\":\"DeleteBlob\"},{\"name\":\"SetBlobImmutabilityPolicy\"}]}},\"provisioningState\":\"Canceled\",\"creationTimeInUtc\":\"2021-06-20T18:48:12Z\"},\"location\":\"qrvkdv\",\"tags\":{\"d\":\"lrmv\"},\"id\":\"watkpnpulexxb\",\"name\":\"zwtruwiqzbqjvsov\",\"type\":\"yokacspkw\"},{\"identity\":{\"principalId\":\"179c4c3b-0f99-46d5-b43b-3e01c294e634\",\"tenantId\":\"79816dcb-5a8f-44d5-8a0a-953fc00c16a6\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"mflbv\":{\"principalId\":\"cf1dcccc-c16a-4c0e-ba40-4dacdd3e0ba6\",\"clientId\":\"0931525f-5d9d-404e-ae55-57da621548b4\"},\"hrk\":{\"principalId\":\"06784bd0-88cc-4cce-aa43-be92061d5241\",\"clientId\":\"5f36602a-3494-4491-86d2-15137916c487\"},\"wwzjuqkhrsajiwku\":{\"principalId\":\"0502c9a5-51c0-4ed9-a128-bbf42b8a79b5\",\"clientId\":\"cac87cdd-5f91-47ee-8ddc-dc664a92f7a1\"},\"skghsauuimj\":{\"principalId\":\"42df09e5-44c8-4bf9-b5a1-11c94e7ec222\",\"clientId\":\"4452d8a5-8698-44a8-9ad6-55d052468711\"}}},\"properties\":{\"taskVersion\":2519768107676496444,\"enabled\":true,\"description\":\"uugidyjrrfby\",\"action\":{\"if\":{\"condition\":\"osvexcsonpclhoc\",\"operations\":[{\"name\":\"SetBlobImmutabilityPolicy\"},{\"name\":\"SetBlobTier\"},{\"name\":\"UndeleteBlob\"}]},\"else\":{\"operations\":[{\"name\":\"DeleteBlob\"},{\"name\":\"SetBlobExpiry\"},{\"name\":\"SetBlobExpiry\"},{\"name\":\"SetBlobExpiry\"}]}},\"provisioningState\":\"ValidateSubscriptionQuotaBegin\",\"creationTimeInUtc\":\"2021-09-05T06:09:57Z\"},\"location\":\"fmvfaxkffeiit\",\"tags\":{\"zy\":\"m\",\"burvjxxjnspy\":\"shxmzsbbzoggigrx\"},\"id\":\"ptkoenkoukn\",\"name\":\"udwtiukbl\",\"type\":\"ngkpocipazy\"}],\"nextLink\":\"egukgjnpiucg\"}") + .toObject(StorageTasksListResult.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + StorageTasksListResult model = new StorageTasksListResult(); + model = BinaryData.fromObject(model).toObject(StorageTasksListResult.class); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksReportsListMockTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksReportsListMockTests.java new file mode 100644 index 0000000000000..2ff9d267bd2bc --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksReportsListMockTests.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.storageactions.StorageActionsManager; +import com.azure.resourcemanager.storageactions.models.StorageTaskReportInstance; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class StorageTasksReportsListMockTests { + @Test + public void testList() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr + = "{\"value\":[{\"properties\":{\"taskAssignmentId\":\"dxbx\",\"storageAccountId\":\"kbogqxndlkzgx\",\"startTime\":\"ripl\",\"finishTime\":\"odxun\",\"objectsTargetedCount\":\"ebxmubyynt\",\"objectsOperatedOnCount\":\"rbqtkoie\",\"objectFailedCount\":\"eotg\",\"objectsSucceededCount\":\"l\",\"runStatusError\":\"muwlauwzizxbm\",\"runStatusEnum\":\"InProgress\",\"summaryReportPath\":\"efuzmuvpbttd\",\"taskId\":\"orppxebmnzbtb\",\"taskVersion\":\"pglkf\",\"runResult\":\"Failed\"},\"id\":\"neuelfphsdyhtoz\",\"name\":\"ikdowwquuvx\",\"type\":\"xclvit\"}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito.when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito.when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + StorageActionsManager manager = StorageActionsManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = manager.storageTasksReports().list("onz", "nsikvmkqzeqqkdl", + "fzxmhhvhgureodkw", "bdagxt", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/UserAssignedIdentityTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/UserAssignedIdentityTests.java new file mode 100644 index 0000000000000..4340ab3211902 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/UserAssignedIdentityTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storageactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.storageactions.models.UserAssignedIdentity; + +public final class UserAssignedIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UserAssignedIdentity model = BinaryData.fromString( + "{\"principalId\":\"5279c20c-c056-4247-a8ee-309b3043f9bf\",\"clientId\":\"be706a55-5203-4fb2-a765-1dfc2f3df44a\"}") + .toObject(UserAssignedIdentity.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UserAssignedIdentity model = new UserAssignedIdentity(); + model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker new file mode 100644 index 0000000000000..1f0955d450f0d --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker @@ -0,0 +1 @@ +mock-maker-inline diff --git a/sdk/storageactions/ci.yml b/sdk/storageactions/ci.yml new file mode 100644 index 0000000000000..cdbb9f2c1c142 --- /dev/null +++ b/sdk/storageactions/ci.yml @@ -0,0 +1,47 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/storageactions/ci.yml + - sdk/storageactions/azure-resourcemanager-storageactions/ + exclude: + - sdk/storageactions/pom.xml + - sdk/storageactions/azure-resourcemanager-storageactions/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storageactions/ci.yml + - sdk/storageactions/azure-resourcemanager-storageactions/ + exclude: + - sdk/storageactions/pom.xml + - sdk/storageactions/azure-resourcemanager-storageactions/pom.xml + +parameters: + - name: release_azureresourcemanagerstorageactions + displayName: azure-resourcemanager-storageactions + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: storageactions + EnableBatchRelease: true + Artifacts: + - name: azure-resourcemanager-storageactions + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerstorageactions + releaseInBatch: ${{ parameters.release_azureresourcemanagerstorageactions }} diff --git a/sdk/storageactions/pom.xml b/sdk/storageactions/pom.xml new file mode 100644 index 0000000000000..eee578024b2c3 --- /dev/null +++ b/sdk/storageactions/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-storageactions-service + pom + 1.0.0 + + + azure-resourcemanager-storageactions + + From 6fa7e3f76d2860ef417389817fcadc81851014cb Mon Sep 17 00:00:00 2001 From: Bill Wert Date: Tue, 12 Mar 2024 11:45:17 -0700 Subject: [PATCH 25/90] Version update for EventGrid March 2024 release (#39186) --- eng/versioning/version_client.txt | 2 +- .../pom.xml | 2 +- sdk/eventgrid/azure-messaging-eventgrid/CHANGELOG.md | 10 ++++++++++ sdk/eventgrid/azure-messaging-eventgrid/pom.xml | 2 +- sdk/eventgrid/azure-resourcemanager-eventgrid/pom.xml | 2 +- sdk/spring/spring-cloud-azure-autoconfigure/pom.xml | 2 +- sdk/spring/spring-cloud-azure-service/pom.xml | 2 +- .../spring-cloud-azure-starter-eventgrid/pom.xml | 2 +- 8 files changed, 17 insertions(+), 7 deletions(-) diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index c1e0233b53456..3b88b3ab56a79 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -146,7 +146,7 @@ com.azure:azure-maps-render;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-maps-route;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-maps-search;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-media-videoanalyzer-edge;1.0.0-beta.6;1.0.0-beta.7 -com.azure:azure-messaging-eventgrid;4.21.0;4.22.0 +com.azure:azure-messaging-eventgrid;4.22.0;4.23.0-beta.1 com.azure:azure-messaging-eventgrid-cloudnative-cloudevents;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-messaging-eventhubs;5.18.1;5.19.0-beta.1 com.azure:azure-messaging-eventhubs-checkpointstore-blob;1.19.1;1.20.0-beta.1 diff --git a/sdk/eventgrid/azure-messaging-eventgrid-cloudnative-cloudevents/pom.xml b/sdk/eventgrid/azure-messaging-eventgrid-cloudnative-cloudevents/pom.xml index 30da011e6384c..e013f2db06594 100644 --- a/sdk/eventgrid/azure-messaging-eventgrid-cloudnative-cloudevents/pom.xml +++ b/sdk/eventgrid/azure-messaging-eventgrid-cloudnative-cloudevents/pom.xml @@ -88,7 +88,7 @@ com.azure azure-messaging-eventgrid - 4.21.0 + 4.22.0 io.cloudevents diff --git a/sdk/eventgrid/azure-messaging-eventgrid/CHANGELOG.md b/sdk/eventgrid/azure-messaging-eventgrid/CHANGELOG.md index ad545476221db..690b9dd40f7b5 100644 --- a/sdk/eventgrid/azure-messaging-eventgrid/CHANGELOG.md +++ b/sdk/eventgrid/azure-messaging-eventgrid/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 4.23.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 4.22.0 (2024-03-11) ### Features Added diff --git a/sdk/eventgrid/azure-messaging-eventgrid/pom.xml b/sdk/eventgrid/azure-messaging-eventgrid/pom.xml index fcfb726735ebe..a47a0fcebd1b9 100644 --- a/sdk/eventgrid/azure-messaging-eventgrid/pom.xml +++ b/sdk/eventgrid/azure-messaging-eventgrid/pom.xml @@ -12,7 +12,7 @@ com.azure azure-messaging-eventgrid - 4.22.0 + 4.23.0-beta.1 jar Microsoft Azure SDK for eventgrid diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/pom.xml b/sdk/eventgrid/azure-resourcemanager-eventgrid/pom.xml index 0a00b15ad44b4..35a4c9a9944ad 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/pom.xml +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/pom.xml @@ -117,7 +117,7 @@ com.azure azure-messaging-eventgrid - 4.21.0 + 4.22.0 test diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/pom.xml b/sdk/spring/spring-cloud-azure-autoconfigure/pom.xml index 8582aa032d25f..7b2b3a2efa7a9 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/pom.xml +++ b/sdk/spring/spring-cloud-azure-autoconfigure/pom.xml @@ -187,7 +187,7 @@ com.azure azure-messaging-eventgrid - 4.21.0 + 4.22.0 true diff --git a/sdk/spring/spring-cloud-azure-service/pom.xml b/sdk/spring/spring-cloud-azure-service/pom.xml index 4c2b686d8589a..ccfb41a7a8560 100644 --- a/sdk/spring/spring-cloud-azure-service/pom.xml +++ b/sdk/spring/spring-cloud-azure-service/pom.xml @@ -68,7 +68,7 @@ com.azure azure-messaging-eventgrid - 4.21.0 + 4.22.0 true diff --git a/sdk/spring/spring-cloud-azure-starter-eventgrid/pom.xml b/sdk/spring/spring-cloud-azure-starter-eventgrid/pom.xml index 11a7525638b33..3dcdb7c14cc4a 100644 --- a/sdk/spring/spring-cloud-azure-starter-eventgrid/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-eventgrid/pom.xml @@ -93,7 +93,7 @@ com.azure azure-messaging-eventgrid - 4.21.0 + 4.22.0 From 4fb3af19bc0635ea759d874374c9ae06bfed605a Mon Sep 17 00:00:00 2001 From: James Suplizio Date: Tue, 12 Mar 2024 11:45:47 -0700 Subject: [PATCH 26/90] Set version of org.apache.maven.plugins:maven-gpg-plugin in publish script (#39185) * Set version of org.apache.maven.plugins:maven-gpg-plugin in publish script * there's supposed to be a ; before the version, not a : --- eng/scripts/Publish-MavenPackages.ps1 | 21 +++++++++++++++------ eng/versioning/external_dependencies.txt | 1 + 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/eng/scripts/Publish-MavenPackages.ps1 b/eng/scripts/Publish-MavenPackages.ps1 index 4973e8fce742a..2501556d15d7d 100644 --- a/eng/scripts/Publish-MavenPackages.ps1 +++ b/eng/scripts/Publish-MavenPackages.ps1 @@ -161,6 +161,15 @@ foreach ($packageDetail in $packageDetails) { $gpgexeOption = "-Dgpgexe=$GPGExecutablePath" Write-Information "GPG Executable Option is: $gpgexeOption" + $gpgPluginVersion = . $PSScriptRoot\Get-ExternalDependencyVersion.ps1 -GroupId 'org.apache.maven.plugins' -ArtifactId 'maven-gpg-plugin' + if ($LASTEXITCODE) { + Write-Information "##vso[task.logissue type=error]Unable to resolve version of external dependency 'org.apache.maven.plugins:maven-gpg-plugin'" + exit $LASTEXITCODE + } + + $gpgSignAndDeployWithVer = "org.apache.maven.plugins:maven-gpg-plugin:$gpgPluginVersion`:sign-and-deploy-file" + + if ($requiresLocalGpg) { $localRepositoryDirectory = Get-RandomRepositoryDirectory $localRepositoryDirectoryUri = $([Uri]$localRepositoryDirectory.FullName).AbsoluteUri @@ -170,8 +179,8 @@ foreach ($packageDetail in $packageDetails) { Write-Information "URL Option is: $urlOption" Write-Information "Signing and deploying package to $localRepositoryDirectoryUri" - Write-Information "mvn gpg:sign-and-deploy-file `"--batch-mode`" `"$pomOption`" `"$fileOption`" `"$javadocOption`" `"$sourcesOption`" `"$filesOption`" $classifiersOption `"$typesOption`" `"$urlOption`" `"$gpgexeOption`" `"-DrepositoryId=target-repo`" `"--settings=$PSScriptRoot\..\maven.publish.settings.xml`"" - mvn gpg:sign-and-deploy-file "--batch-mode" "$pomOption" "$fileOption" "$javadocOption" "$sourcesOption" "$filesOption" $classifiersOption "$typesOption" "$urlOption" "$gpgexeOption" "-DrepositoryId=target-repo" "--settings=$PSScriptRoot\..\maven.publish.settings.xml" + Write-Information "mvn $gpgSignAndDeployWithVer `"--batch-mode`" `"$pomOption`" `"$fileOption`" `"$javadocOption`" `"$sourcesOption`" `"$filesOption`" $classifiersOption `"$typesOption`" `"$urlOption`" `"$gpgexeOption`" `"-DrepositoryId=target-repo`" `"--settings=$PSScriptRoot\..\maven.publish.settings.xml`"" + mvn $gpgSignAndDeployWithVer "--batch-mode" "$pomOption" "$fileOption" "$javadocOption" "$sourcesOption" "$filesOption" $classifiersOption "$typesOption" "$urlOption" "$gpgexeOption" "-DrepositoryId=target-repo" "--settings=$PSScriptRoot\..\maven.publish.settings.xml" if ($LASTEXITCODE) { exit $LASTEXITCODE } } @@ -183,8 +192,8 @@ foreach ($packageDetail in $packageDetails) { if ($releaseType -eq 'AzureDevOps') { Write-Information "GPG Signing and deploying package in one step to devops feed: $packageReposityUrl" - Write-Information "mvn gpg:sign-and-deploy-file `"--batch-mode`" `"$pomOption`" `"$fileOption`" `"$javadocOption`" `"$sourcesOption`" `"$filesOption`" $classifiersOption `"$typesOption`" `"-Durl=$packageReposityUrl`" `"$gpgexeOption`" `"-DrepositoryId=target-repo`" `"-Drepo.password=[redacted]`" `"--settings=$PSScriptRoot\..\maven.publish.settings.xml`"" - mvn gpg:sign-and-deploy-file "--batch-mode" "$pomOption" "$fileOption" "$javadocOption" "$sourcesOption" "$filesOption" $classifiersOption "$typesOption" "-Durl=$packageReposityUrl" "$gpgexeOption" "-DrepositoryId=target-repo" "-Drepo.password=$RepositoryPassword" "--settings=$PSScriptRoot\..\maven.publish.settings.xml" + Write-Information "mvn $gpgSignAndDeployWithVer `"--batch-mode`" `"$pomOption`" `"$fileOption`" `"$javadocOption`" `"$sourcesOption`" `"$filesOption`" $classifiersOption `"$typesOption`" `"-Durl=$packageReposityUrl`" `"$gpgexeOption`" `"-DrepositoryId=target-repo`" `"-Drepo.password=[redacted]`" `"--settings=$PSScriptRoot\..\maven.publish.settings.xml`"" + mvn $gpgSignAndDeployWithVer "--batch-mode" "$pomOption" "$fileOption" "$javadocOption" "$sourcesOption" "$filesOption" $classifiersOption "$typesOption" "-Durl=$packageReposityUrl" "$gpgexeOption" "-DrepositoryId=target-repo" "-Drepo.password=$RepositoryPassword" "--settings=$PSScriptRoot\..\maven.publish.settings.xml" if ($LASTEXITCODE -eq 0) { Write-Information "Package $($packageDetail.FullyQualifiedName) deployed" @@ -202,8 +211,8 @@ foreach ($packageDetail in $packageDetails) { } elseif ($releaseType -eq 'MavenCentralSnapshot') { Write-Information "GPG Signing and deploying package in one step to Sonatype snapshots: $packageReposityUrl" - Write-Information "mvn gpg:sign-and-deploy-file `"--batch-mode`" `"$pomOption`" `"$fileOption`" `"$javadocOption`" `"$sourcesOption`" `"$filesOption`" $classifiersOption `"$typesOption`" `"-Durl=$packageReposityUrl`" `"$gpgexeOption`" `"-DrepositoryId=target-repo`" `"-Drepo.username=`"`"$RepositoryUsername`"`"`" `"-Drepo.password=[redacted]`" `"--settings=$PSScriptRoot\..\maven.publish.settings.xml`"" - mvn gpg:sign-and-deploy-file "--batch-mode" "$pomOption" "$fileOption" "$javadocOption" "$sourcesOption" "$filesOption" $classifiersOption "$typesOption" "-Durl=$packageReposityUrl" "$gpgexeOption" "-DrepositoryId=target-repo" "-Drepo.username=""$RepositoryUsername""" "-Drepo.password=""$RepositoryPassword""" "--settings=$PSScriptRoot\..\maven.publish.settings.xml" + Write-Information "mvn $gpgSignAndDeployWithVer `"--batch-mode`" `"$pomOption`" `"$fileOption`" `"$javadocOption`" `"$sourcesOption`" `"$filesOption`" $classifiersOption `"$typesOption`" `"-Durl=$packageReposityUrl`" `"$gpgexeOption`" `"-DrepositoryId=target-repo`" `"-Drepo.username=`"`"$RepositoryUsername`"`"`" `"-Drepo.password=[redacted]`" `"--settings=$PSScriptRoot\..\maven.publish.settings.xml`"" + mvn $gpgSignAndDeployWithVer "--batch-mode" "$pomOption" "$fileOption" "$javadocOption" "$sourcesOption" "$filesOption" $classifiersOption "$typesOption" "-Durl=$packageReposityUrl" "$gpgexeOption" "-DrepositoryId=target-repo" "-Drepo.username=""$RepositoryUsername""" "-Drepo.password=""$RepositoryPassword""" "--settings=$PSScriptRoot\..\maven.publish.settings.xml" if ($LASTEXITCODE) { exit $LASTEXITCODE } } else { diff --git a/eng/versioning/external_dependencies.txt b/eng/versioning/external_dependencies.txt index 7d36b82ed9289..67ead947493f2 100644 --- a/eng/versioning/external_dependencies.txt +++ b/eng/versioning/external_dependencies.txt @@ -92,6 +92,7 @@ org.apache.logging.log4j:log4j-slf4j-impl;2.17.2 org.apache.maven:maven-core;3.5.4 org.apache.maven.archetype:archetype-packaging;3.2.0 org.apache.maven.plugins:maven-archetype-plugin;3.2.0 +org.apache.maven.plugins:maven-gpg-plugin;3.1.0 org.apache.qpid:proton-j;0.33.8 org.apache.qpid:qpid-jms-client;0.53.0 org.apache.tinkerpop:gremlin-driver;3.2.4 From 42be6f46763a5add1212c85d164d00e702497cdb Mon Sep 17 00:00:00 2001 From: Ronnie Geraghty Date: Tue, 12 Mar 2024 14:57:12 -0700 Subject: [PATCH 27/90] Turn on EnforceMaxLifeOfIssues (#39171) Turning on GitHub Action to enforce the max life of issues. "Close stale issues" --- .github/event-processor.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/event-processor.config b/.github/event-processor.config index 3cecb54ae77d1..52e731644b0fd 100644 --- a/.github/event-processor.config +++ b/.github/event-processor.config @@ -22,5 +22,5 @@ "IdentifyStalePullRequests": "On", "CloseAddressedIssues": "On", "LockClosedIssues": "On", - "EnforceMaxLifeOfIssues": "Off" + "EnforceMaxLifeOfIssues": "On" } From 44cc51c9c11354f878cd653b905354752e618c8b Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 12 Mar 2024 19:21:59 -0400 Subject: [PATCH 28/90] Increment package versions for monitor releases (#39164) --- eng/versioning/version_client.txt | 2 +- sdk/eventhubs/azure-messaging-eventhubs-stress/pom.xml | 2 +- .../azure-monitor-opentelemetry-exporter/CHANGELOG.md | 10 ++++++++++ .../azure-monitor-opentelemetry-exporter/pom.xml | 2 +- .../azure-messaging-servicebus-stress/pom.xml | 2 +- sdk/spring/spring-cloud-azure-starter-monitor/pom.xml | 2 +- sdk/template/azure-template-stress/pom.xml | 2 +- 7 files changed, 16 insertions(+), 6 deletions(-) diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 3b88b3ab56a79..d79c5c2cd24df 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -162,7 +162,7 @@ com.azure:azure-messaging-webpubsub;1.2.12;1.3.0-beta.1 com.azure:azure-messaging-webpubsub-client;1.0.0;1.1.0-beta.1 com.azure:azure-mixedreality-authentication;1.2.21;1.3.0-beta.1 com.azure:azure-mixedreality-remoterendering;1.1.26;1.2.0-beta.1 -com.azure:azure-monitor-opentelemetry-exporter;1.0.0-beta.20;1.0.0-beta.21 +com.azure:azure-monitor-opentelemetry-exporter;1.0.0-beta.21;1.0.0-beta.22 com.azure:azure-monitor-ingestion;1.1.4;1.1.5 com.azure:azure-monitor-ingestion-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-monitor-query;1.2.9;1.3.0-beta.3 diff --git a/sdk/eventhubs/azure-messaging-eventhubs-stress/pom.xml b/sdk/eventhubs/azure-messaging-eventhubs-stress/pom.xml index 2d3f85884370a..aaebd9208a0f7 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs-stress/pom.xml +++ b/sdk/eventhubs/azure-messaging-eventhubs-stress/pom.xml @@ -50,7 +50,7 @@ com.azure azure-monitor-opentelemetry-exporter - 1.0.0-beta.20 + 1.0.0-beta.21 io.opentelemetry.instrumentation diff --git a/sdk/monitor/azure-monitor-opentelemetry-exporter/CHANGELOG.md b/sdk/monitor/azure-monitor-opentelemetry-exporter/CHANGELOG.md index 050071f84af81..c5f9897de936d 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-exporter/CHANGELOG.md +++ b/sdk/monitor/azure-monitor-opentelemetry-exporter/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.0.0-beta.22 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.0.0-beta.21 (2024-03-11) ### Bugs Fixed diff --git a/sdk/monitor/azure-monitor-opentelemetry-exporter/pom.xml b/sdk/monitor/azure-monitor-opentelemetry-exporter/pom.xml index b4ebfa319d4b8..a5c63d140f81c 100644 --- a/sdk/monitor/azure-monitor-opentelemetry-exporter/pom.xml +++ b/sdk/monitor/azure-monitor-opentelemetry-exporter/pom.xml @@ -14,7 +14,7 @@ com.azure azure-monitor-opentelemetry-exporter - 1.0.0-beta.21 + 1.0.0-beta.22 Microsoft Azure SDK for OpenTelemetry Azure Monitor Exporter This package contains Microsoft Azure SDK for OpenTelemetry Azure Monitor Exporter. diff --git a/sdk/servicebus/azure-messaging-servicebus-stress/pom.xml b/sdk/servicebus/azure-messaging-servicebus-stress/pom.xml index 8e90868ecf133..613a0d7fa4139 100644 --- a/sdk/servicebus/azure-messaging-servicebus-stress/pom.xml +++ b/sdk/servicebus/azure-messaging-servicebus-stress/pom.xml @@ -52,7 +52,7 @@ com.azure azure-monitor-opentelemetry-exporter - 1.0.0-beta.20 + 1.0.0-beta.21 io.opentelemetry.instrumentation diff --git a/sdk/spring/spring-cloud-azure-starter-monitor/pom.xml b/sdk/spring/spring-cloud-azure-starter-monitor/pom.xml index 5ef4507e17dfe..43b1bfc42605c 100644 --- a/sdk/spring/spring-cloud-azure-starter-monitor/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-monitor/pom.xml @@ -98,7 +98,7 @@ com.azure azure-monitor-opentelemetry-exporter - 1.0.0-beta.20 + 1.0.0-beta.21 diff --git a/sdk/template/azure-template-stress/pom.xml b/sdk/template/azure-template-stress/pom.xml index 803dfda610137..19438571b222e 100644 --- a/sdk/template/azure-template-stress/pom.xml +++ b/sdk/template/azure-template-stress/pom.xml @@ -71,7 +71,7 @@ com.azure azure-monitor-opentelemetry-exporter - 1.0.0-beta.20 + 1.0.0-beta.21 io.opentelemetry.instrumentation From 4ed10f746773bca1504fe71962f74ae0089bffdf Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 12 Mar 2024 19:26:12 -0400 Subject: [PATCH 29/90] Increment package versions for search releases (#39165) --- eng/versioning/version_client.txt | 2 +- sdk/search/azure-search-documents/CHANGELOG.md | 10 ++++++++++ sdk/search/azure-search-documents/pom.xml | 2 +- sdk/search/azure-search-perf/pom.xml | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index d79c5c2cd24df..a110e3971cebb 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -169,7 +169,7 @@ com.azure:azure-monitor-query;1.2.9;1.3.0-beta.3 com.azure:azure-monitor-query-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-perf-test-parent;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-quantum-jobs;1.0.0-beta.1;1.0.0-beta.2 -com.azure:azure-search-documents;11.6.2;11.7.0-beta.2 +com.azure:azure-search-documents;11.6.2;11.7.0-beta.3 com.azure:azure-search-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-security-attestation;1.1.21;1.2.0-beta.1 com.azure:azure-security-confidentialledger;1.0.17;1.1.0-beta.1 diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index cb266dd6656c0..a4b4197db5e24 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 11.7.0-beta.3 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 11.7.0-beta.2 (2024-03-11) ### Features Added diff --git a/sdk/search/azure-search-documents/pom.xml b/sdk/search/azure-search-documents/pom.xml index 2e6c2fa5460d1..87a09f0058dd4 100644 --- a/sdk/search/azure-search-documents/pom.xml +++ b/sdk/search/azure-search-documents/pom.xml @@ -16,7 +16,7 @@ com.azure azure-search-documents - 11.7.0-beta.2 + 11.7.0-beta.3 jar diff --git a/sdk/search/azure-search-perf/pom.xml b/sdk/search/azure-search-perf/pom.xml index e1036ef48ed60..23784663b388e 100644 --- a/sdk/search/azure-search-perf/pom.xml +++ b/sdk/search/azure-search-perf/pom.xml @@ -29,7 +29,7 @@ com.azure azure-search-documents - 11.7.0-beta.2 + 11.7.0-beta.3 From 42767d7cbbb8221bd54531e85a10967458a9c7d1 Mon Sep 17 00:00:00 2001 From: Jair Myree Date: Tue, 12 Mar 2024 16:32:13 -0700 Subject: [PATCH 30/90] Incrementing Versions for Tables Release (Cherry-Pick) (#39191) * Incrementing Versions for Tables Release (Cherry-Pick) * Updating Tables README.md --------- Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> --- eng/versioning/version_client.txt | 2 +- sdk/tables/azure-data-tables/CHANGELOG.md | 12 ++++++++++++ sdk/tables/azure-data-tables/README.md | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index a110e3971cebb..6307e7010fd0f 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -118,7 +118,7 @@ com.azure:azure-data-appconfiguration-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-data-schemaregistry;1.4.3;1.5.0-beta.1 com.azure:azure-data-schemaregistry-apacheavro;1.1.14;1.2.0-beta.2 com.azure:azure-data-schemaregistry-jsonschema;1.0.0-beta.1;1.0.0-beta.2 -com.azure:azure-data-tables;12.3.19;12.4.0-beta.1 +com.azure:azure-data-tables;12.3.20;12.4.0-beta.1 com.azure:azure-data-tables-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-developer-devcenter;1.0.0-beta.3;1.0.0-beta.4 com.azure:azure-developer-loadtesting;1.0.10;1.1.0-beta.1 diff --git a/sdk/tables/azure-data-tables/CHANGELOG.md b/sdk/tables/azure-data-tables/CHANGELOG.md index 34a6f93dffeb3..c2a1df4e7c9ab 100644 --- a/sdk/tables/azure-data-tables/CHANGELOG.md +++ b/sdk/tables/azure-data-tables/CHANGELOG.md @@ -8,10 +8,20 @@ ### Bugs Fixed +### Other Changes + +## 12.3.20 (2024-03-07) + +### Bugs Fixed - Removed the 409 status-code error-level log message "TableAlreadyExists" that was printed when calling `TableServiceClient.createTableIfNotExists()` on a table that already exists. ### Other Changes +#### Dependency Updates + +- Upgraded `azure-core` from `1.46.0` to version `1.47.0`. +- Upgraded `azure-core-http-netty` from `1.14.0` to version `1.14.1`. + ## 12.3.19 (2024-02-20) ### Other Changes @@ -31,6 +41,7 @@ - Upgraded `azure-core-http-netty` from `1.13.10` to version `1.13.11`. - Upgraded `azure-core` from `1.45.0` to version `1.45.1`. + ## 12.3.17 (2023-11-20) ### Other Changes @@ -50,6 +61,7 @@ - Upgraded `azure-core-http-netty` from `1.13.7` to version `1.13.9`. - Upgraded `azure-core` from `1.43.0` to version `1.44.1`. + ## 12.3.15 (2023-09-18) ### Bugs Fixed diff --git a/sdk/tables/azure-data-tables/README.md b/sdk/tables/azure-data-tables/README.md index 4af218cb6fa59..431efc4d305f2 100644 --- a/sdk/tables/azure-data-tables/README.md +++ b/sdk/tables/azure-data-tables/README.md @@ -46,7 +46,7 @@ add the direct dependency to your project as follows. com.azure azure-data-tables - 12.3.15 + 12.3.20 ``` [//]: # ({x-version-update-end}) From 25765b9c55eb402febeb30593bf6a93f5c843803 Mon Sep 17 00:00:00 2001 From: Muyao Feng <92105726+Netyyyy@users.noreply.github.com> Date: Wed, 13 Mar 2024 10:25:48 +0800 Subject: [PATCH 31/90] Upgrade Spring Cloud and Spring Framework version (#39179) * upgrade spring cloud 2021.0.9 * upgrade springframework 5.3.32 * fix FileNotFoundError * update dependencies --- eng/versioning/external_dependencies.txt | 42 +- eng/versioning/update_versions.py | 10 +- .../azure-security-test-keyvault-jca/pom.xml | 2 +- sdk/spring/azure-spring-data-cosmos/pom.xml | 24 +- ...t_2.7.18_managed_external_dependencies.txt | 424 +++++++++--------- .../pom.xml | 4 +- .../pom.xml | 8 +- .../spring-cloud-azure-autoconfigure/pom.xml | 18 +- sdk/spring/spring-cloud-azure-core/pom.xml | 6 +- .../pom.xml | 8 +- .../pom.xml | 4 +- .../pom.xml | 2 +- sdk/spring/spring-cloud-azure-service/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 6 +- .../pom.xml | 2 +- .../pom.xml | 6 +- .../pom.xml | 2 +- .../spring-cloud-azure-trace-sleuth/pom.xml | 4 +- .../spring-integration-azure-core/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../spring-messaging-azure-eventhubs/pom.xml | 8 +- .../spring-messaging-azure-servicebus/pom.xml | 6 +- sdk/spring/spring-messaging-azure/pom.xml | 8 +- 25 files changed, 303 insertions(+), 301 deletions(-) diff --git a/eng/versioning/external_dependencies.txt b/eng/versioning/external_dependencies.txt index 67ead947493f2..19617ca41e7f6 100644 --- a/eng/versioning/external_dependencies.txt +++ b/eng/versioning/external_dependencies.txt @@ -158,31 +158,31 @@ org.springframework.security:spring-security-oauth2-resource-server;5.7.11 org.springframework.security:spring-security-oauth2-core;5.7.11 org.springframework.security:spring-security-oauth2-jose;5.7.11 org.springframework.security:spring-security-web;5.7.11 -org.springframework:spring-beans;5.3.31 -org.springframework:spring-context-support;5.3.31 -org.springframework:spring-context;5.3.31 -org.springframework:spring-core;5.3.31 -org.springframework:spring-expression;5.3.31 -org.springframework:spring-jdbc;5.3.31 -org.springframework:spring-jms;5.3.31 -org.springframework:spring-messaging;5.3.31 -org.springframework:spring-tx;5.3.31 -org.springframework:spring-web;5.3.31 -org.springframework:spring-webmvc;5.3.31 -org.springframework:spring-test;5.3.31 +org.springframework:spring-beans;5.3.32 +org.springframework:spring-context-support;5.3.32 +org.springframework:spring-context;5.3.32 +org.springframework:spring-core;5.3.32 +org.springframework:spring-expression;5.3.32 +org.springframework:spring-jdbc;5.3.32 +org.springframework:spring-jms;5.3.32 +org.springframework:spring-messaging;5.3.32 +org.springframework:spring-tx;5.3.32 +org.springframework:spring-web;5.3.32 +org.springframework:spring-webmvc;5.3.32 +org.springframework:spring-test;5.3.32 org.springframework.retry:spring-retry;1.3.4 org.springframework.boot:spring-boot-starter-parent;2.7.18 ## Spring cloud dependency versions -org.springframework.cloud:spring-cloud-dependencies;2021.0.8 -org.springframework.cloud:spring-cloud-starter-bootstrap;3.1.7 -org.springframework.cloud:spring-cloud-bus;3.1.2 -org.springframework.cloud:spring-cloud-context;3.1.7 -org.springframework.cloud:spring-cloud-sleuth-api;3.1.9 -org.springframework.cloud:spring-cloud-starter-sleuth;3.1.9 -org.springframework.cloud:spring-cloud-starter-stream-kafka;3.2.9 -org.springframework.cloud:spring-cloud-stream-binder-test;3.2.9 -org.springframework.cloud:spring-cloud-stream;3.2.9 +org.springframework.cloud:spring-cloud-dependencies;2021.0.9 +org.springframework.cloud:spring-cloud-starter-bootstrap;3.1.8 +org.springframework.cloud:spring-cloud-bus;3.1.3 +org.springframework.cloud:spring-cloud-context;3.1.8 +org.springframework.cloud:spring-cloud-sleuth-api;3.1.10 +org.springframework.cloud:spring-cloud-starter-sleuth;3.1.10 +org.springframework.cloud:spring-cloud-starter-stream-kafka;3.2.10 +org.springframework.cloud:spring-cloud-stream-binder-test;3.2.10 +org.springframework.cloud:spring-cloud-stream;3.2.10 ## Test dependency versions org.objenesis:objenesis;3.1 diff --git a/eng/versioning/update_versions.py b/eng/versioning/update_versions.py index 73072995fabc1..f223ffc06c379 100644 --- a/eng/versioning/update_versions.py +++ b/eng/versioning/update_versions.py @@ -235,11 +235,13 @@ def update_versions_all(update_type, build_type, target_file, skip_readme, auto_ # Load the version and/or external dependency file for the given UpdateType # into the verion_map. If UpdateType.all is selected then versions for both # the libraries and external dependencies are being updated. - version_file = os.path.normpath('eng/versioning/version_' + build_type.name + '.txt') - load_version_map_from_file(version_file, version_map) + if update_type == UpdateType.library or update_type == UpdateType.all: + version_file = os.path.normpath('eng/versioning/version_' + build_type.name + '.txt') + load_version_map_from_file(version_file, version_map) - dependency_file = os.path.normpath('eng/versioning/external_dependencies.txt') - load_version_map_from_file(dependency_file, ext_dep_map) + if update_type == UpdateType.external_dependency or update_type == UpdateType.all: + dependency_file = os.path.normpath('eng/versioning/external_dependencies.txt') + load_version_map_from_file(dependency_file, ext_dep_map) if version_overrides and not version_overrides.startswith('$'): # Azure DevOps passes '$(VersionOverrides)' when the variable value is not set diff --git a/sdk/keyvault/azure-security-test-keyvault-jca/pom.xml b/sdk/keyvault/azure-security-test-keyvault-jca/pom.xml index cb364dd08d266..c542b165e3d67 100644 --- a/sdk/keyvault/azure-security-test-keyvault-jca/pom.xml +++ b/sdk/keyvault/azure-security-test-keyvault-jca/pom.xml @@ -76,7 +76,7 @@ org.springframework spring-core - 5.3.31 + 5.3.32 test diff --git a/sdk/spring/azure-spring-data-cosmos/pom.xml b/sdk/spring/azure-spring-data-cosmos/pom.xml index 00cffb679cc33..b731653a01443 100644 --- a/sdk/spring/azure-spring-data-cosmos/pom.xml +++ b/sdk/spring/azure-spring-data-cosmos/pom.xml @@ -51,7 +51,7 @@ org.springframework spring-core - 5.3.31 + 5.3.32 commons-logging @@ -62,22 +62,22 @@ org.springframework spring-web - 5.3.31 + 5.3.32 org.springframework spring-beans - 5.3.31 + 5.3.32 org.springframework spring-context - 5.3.31 + 5.3.32 org.springframework spring-tx - 5.3.31 + 5.3.32 org.springframework.data @@ -93,7 +93,7 @@ org.springframework spring-expression - 5.3.31 + 5.3.32 com.azure @@ -219,12 +219,12 @@ - org.springframework:spring-beans:[5.3.31] - org.springframework:spring-web:[5.3.31] - org.springframework:spring-tx:[5.3.31] - org.springframework:spring-expression:[5.3.31] - org.springframework:spring-core:[5.3.31] - org.springframework:spring-context:[5.3.31] + org.springframework:spring-beans:[5.3.32] + org.springframework:spring-web:[5.3.32] + org.springframework:spring-tx:[5.3.32] + org.springframework:spring-expression:[5.3.32] + org.springframework:spring-core:[5.3.32] + org.springframework:spring-context:[5.3.32] org.springframework.data:spring-data-commons:[2.7.18] org.javatuples:javatuples:[1.2] com.fasterxml.jackson.datatype:jackson-datatype-jdk8:[2.13.5] diff --git a/sdk/spring/scripts/spring_boot_2.7.18_managed_external_dependencies.txt b/sdk/spring/scripts/spring_boot_2.7.18_managed_external_dependencies.txt index b57ddbb793da8..af9baa762c817 100644 --- a/sdk/spring/scripts/spring_boot_2.7.18_managed_external_dependencies.txt +++ b/sdk/spring/scripts/spring_boot_2.7.18_managed_external_dependencies.txt @@ -87,7 +87,7 @@ com.github.ben-manes.caffeine:jcache;2.9.3 com.github.ben-manes.caffeine:simulator;2.9.3 com.github.mxab.thymeleaf.extras:thymeleaf-extras-data-attribute;2.0.1 com.github.tomakehurst:wiremock-jre8;2.26.3 -com.github.tomakehurst:wiremock-jre8-standalone;2.33.0 +com.github.tomakehurst:wiremock-jre8-standalone;2.33.2 com.google.appengine:appengine-api-1.0-sdk;1.9.98 com.google.code.gson:gson;2.9.1 com.graphql-java:graphql-java;18.5 @@ -101,8 +101,8 @@ com.jayway.jsonpath:json-path;2.7.0 com.jayway.jsonpath:json-path-assert;2.7.0 com.microsoft.sqlserver:mssql-jdbc;10.2.3.jre8 com.mysql:mysql-connector-j;8.0.33 -com.netflix.eureka:eureka-client;1.10.17 -com.netflix.eureka:eureka-core;1.10.17 +com.netflix.eureka:eureka-client;1.10.18 +com.netflix.eureka:eureka-core;1.10.18 com.oracle.database.ha:ons;21.5.0.0 com.oracle.database.ha:simplefan;21.5.0.0 com.oracle.database.jdbc.debug:ojdbc11-debug;21.5.0.0 @@ -309,7 +309,7 @@ io.fabric8:volumesnapshot-examples;5.10.2 io.fabric8:volumesnapshot-model;5.10.2 io.fabric8:volumesnapshot-server-mock;5.10.2 io.fabric8:volumesnapshot-tests;5.10.2 -io.github.lognet:grpc-spring-boot-starter;4.2.2 +io.github.lognet:grpc-spring-boot-starter;4.2.3 io.github.openfeign.form:feign-form-spring;3.8.0 io.github.openfeign:feign-annotation-error-decoder;11.10 io.github.openfeign:feign-bom;11.10 @@ -430,7 +430,7 @@ io.netty:netty-transport-native-unix-common;4.1.101.Final io.netty:netty-transport-rxtx;4.1.101.Final io.netty:netty-transport-sctp;4.1.101.Final io.netty:netty-transport-udt;4.1.101.Final -io.opentracing.brave:brave-opentracing;0.37.4 +io.opentracing.brave:brave-opentracing;0.37.5 io.projectreactor.addons:reactor-adapter;3.4.10 io.projectreactor.addons:reactor-extra;3.4.10 io.projectreactor.addons:reactor-pool;0.2.12 @@ -510,42 +510,42 @@ io.spring.gradle:dependency-management-plugin;1.0.15.RELEASE io.undertow:undertow-core;2.2.28.Final io.undertow:undertow-servlet;2.2.28.Final io.undertow:undertow-websockets-jsr;2.2.28.Final -io.zipkin.brave:brave;5.13.9 -io.zipkin.brave:brave-bom;5.13.9 -io.zipkin.brave:brave-context-jfr;5.13.9 -io.zipkin.brave:brave-context-log4j12;5.13.9 -io.zipkin.brave:brave-context-log4j2;5.13.9 -io.zipkin.brave:brave-context-rxjava2;5.13.9 -io.zipkin.brave:brave-context-slf4j;5.13.9 -io.zipkin.brave:brave-instrumentation-dubbo;5.13.9 -io.zipkin.brave:brave-instrumentation-dubbo-rpc;5.13.9 -io.zipkin.brave:brave-instrumentation-grpc;5.13.9 -io.zipkin.brave:brave-instrumentation-http;5.13.9 -io.zipkin.brave:brave-instrumentation-http-tests;5.13.9 -io.zipkin.brave:brave-instrumentation-httpasyncclient;5.13.9 -io.zipkin.brave:brave-instrumentation-httpclient;5.13.9 -io.zipkin.brave:brave-instrumentation-jaxrs2;5.13.9 -io.zipkin.brave:brave-instrumentation-jersey-server;5.13.9 -io.zipkin.brave:brave-instrumentation-jms;5.13.9 -io.zipkin.brave:brave-instrumentation-kafka-clients;5.13.9 -io.zipkin.brave:brave-instrumentation-kafka-streams;5.13.9 -io.zipkin.brave:brave-instrumentation-messaging;5.13.9 -io.zipkin.brave:brave-instrumentation-mongodb;5.13.9 -io.zipkin.brave:brave-instrumentation-mysql;5.13.9 -io.zipkin.brave:brave-instrumentation-mysql6;5.13.9 -io.zipkin.brave:brave-instrumentation-mysql8;5.13.9 -io.zipkin.brave:brave-instrumentation-netty-codec-http;5.13.9 -io.zipkin.brave:brave-instrumentation-okhttp3;5.13.9 -io.zipkin.brave:brave-instrumentation-p6spy;5.13.9 -io.zipkin.brave:brave-instrumentation-rpc;5.13.9 -io.zipkin.brave:brave-instrumentation-servlet;5.13.9 -io.zipkin.brave:brave-instrumentation-sparkjava;5.13.9 -io.zipkin.brave:brave-instrumentation-spring-rabbit;5.13.9 -io.zipkin.brave:brave-instrumentation-spring-web;5.13.9 -io.zipkin.brave:brave-instrumentation-spring-webmvc;5.13.9 -io.zipkin.brave:brave-instrumentation-vertx-web;5.13.9 -io.zipkin.brave:brave-spring-beans;5.13.9 -io.zipkin.brave:brave-tests;5.13.9 +io.zipkin.brave:brave;5.13.11 +io.zipkin.brave:brave-bom;5.13.11 +io.zipkin.brave:brave-context-jfr;5.13.11 +io.zipkin.brave:brave-context-log4j12;5.13.11 +io.zipkin.brave:brave-context-log4j2;5.13.11 +io.zipkin.brave:brave-context-rxjava2;5.13.11 +io.zipkin.brave:brave-context-slf4j;5.13.11 +io.zipkin.brave:brave-instrumentation-dubbo;5.13.11 +io.zipkin.brave:brave-instrumentation-dubbo-rpc;5.13.11 +io.zipkin.brave:brave-instrumentation-grpc;5.13.11 +io.zipkin.brave:brave-instrumentation-http;5.13.11 +io.zipkin.brave:brave-instrumentation-http-tests;5.13.11 +io.zipkin.brave:brave-instrumentation-httpasyncclient;5.13.11 +io.zipkin.brave:brave-instrumentation-httpclient;5.13.11 +io.zipkin.brave:brave-instrumentation-jaxrs2;5.13.11 +io.zipkin.brave:brave-instrumentation-jersey-server;5.13.11 +io.zipkin.brave:brave-instrumentation-jms;5.13.11 +io.zipkin.brave:brave-instrumentation-kafka-clients;5.13.11 +io.zipkin.brave:brave-instrumentation-kafka-streams;5.13.11 +io.zipkin.brave:brave-instrumentation-messaging;5.13.11 +io.zipkin.brave:brave-instrumentation-mongodb;5.13.11 +io.zipkin.brave:brave-instrumentation-mysql;5.13.11 +io.zipkin.brave:brave-instrumentation-mysql6;5.13.11 +io.zipkin.brave:brave-instrumentation-mysql8;5.13.11 +io.zipkin.brave:brave-instrumentation-netty-codec-http;5.13.11 +io.zipkin.brave:brave-instrumentation-okhttp3;5.13.11 +io.zipkin.brave:brave-instrumentation-p6spy;5.13.11 +io.zipkin.brave:brave-instrumentation-rpc;5.13.11 +io.zipkin.brave:brave-instrumentation-servlet;5.13.11 +io.zipkin.brave:brave-instrumentation-sparkjava;5.13.11 +io.zipkin.brave:brave-instrumentation-spring-rabbit;5.13.11 +io.zipkin.brave:brave-instrumentation-spring-web;5.13.11 +io.zipkin.brave:brave-instrumentation-spring-webmvc;5.13.11 +io.zipkin.brave:brave-instrumentation-vertx-web;5.13.11 +io.zipkin.brave:brave-spring-beans;5.13.11 +io.zipkin.brave:brave-tests;5.13.11 io.zipkin.proto3:zipkin-proto3;1.0.0 io.zipkin.reporter2:zipkin-reporter;2.16.3 io.zipkin.reporter2:zipkin-reporter-bom;2.16.3 @@ -891,10 +891,10 @@ org.eclipse.jetty:jetty-util;9.4.53.v20231009 org.eclipse.jetty:jetty-util-ajax;9.4.53.v20231009 org.eclipse.jetty:jetty-webapp;9.4.53.v20231009 org.eclipse.jetty:jetty-xml;9.4.53.v20231009 -org.eclipse.jgit:org.eclipse.jgit;5.13.1.202206130422-r -org.eclipse.jgit:org.eclipse.jgit.http.apache;5.13.1.202206130422-r -org.eclipse.jgit:org.eclipse.jgit.junit.http;5.13.1.202206130422-r -org.eclipse.jgit:org.eclipse.jgit.ssh.apache;5.13.1.202206130422-r +org.eclipse.jgit:org.eclipse.jgit;5.13.2.202306221912-r +org.eclipse.jgit:org.eclipse.jgit.http.apache;5.13.2.202306221912-r +org.eclipse.jgit:org.eclipse.jgit.junit.http;5.13.2.202306221912-r +org.eclipse.jgit:org.eclipse.jgit.ssh.apache;5.13.2.202306221912-r org.ehcache:ehcache;3.10.8 org.ehcache:ehcache-clustered;3.10.8 org.ehcache:ehcache-transactions;3.10.8 @@ -1288,154 +1288,154 @@ org.springframework.boot:spring-boot-starter-webflux;2.7.18 org.springframework.boot:spring-boot-starter-websocket;2.7.18 org.springframework.boot:spring-boot-test;2.7.18 org.springframework.boot:spring-boot-test-autoconfigure;2.7.18 -org.springframework.cloud:spring-cloud-bus;3.1.2 -org.springframework.cloud:spring-cloud-bus-dependencies;3.1.2 -org.springframework.cloud:spring-cloud-bus-rsocket;3.1.2 -org.springframework.cloud:spring-cloud-circuitbreaker-dependencies;2.1.7 -org.springframework.cloud:spring-cloud-circuitbreaker-resilience4j;2.1.7 -org.springframework.cloud:spring-cloud-circuitbreaker-spring-retry;2.1.7 -org.springframework.cloud:spring-cloud-cloudfoundry-commons;3.1.3 -org.springframework.cloud:spring-cloud-cloudfoundry-dependencies;3.1.3 -org.springframework.cloud:spring-cloud-cloudfoundry-discovery;3.1.3 -org.springframework.cloud:spring-cloud-cloudfoundry-web;3.1.3 -org.springframework.cloud:spring-cloud-commons;3.1.7 -org.springframework.cloud:spring-cloud-commons-dependencies;3.1.7 -org.springframework.cloud:spring-cloud-config-client;3.1.8 -org.springframework.cloud:spring-cloud-config-dependencies;3.1.8 -org.springframework.cloud:spring-cloud-config-monitor;3.1.8 -org.springframework.cloud:spring-cloud-config-server;3.1.8 -org.springframework.cloud:spring-cloud-consul-binder;3.1.4 -org.springframework.cloud:spring-cloud-consul-config;3.1.4 -org.springframework.cloud:spring-cloud-consul-core;3.1.4 -org.springframework.cloud:spring-cloud-consul-dependencies;3.1.4 -org.springframework.cloud:spring-cloud-consul-discovery;3.1.4 -org.springframework.cloud:spring-cloud-context;3.1.7 -org.springframework.cloud:spring-cloud-contract-converters;3.1.8 -org.springframework.cloud:spring-cloud-contract-dependencies;3.1.8 -org.springframework.cloud:spring-cloud-contract-gradle-plugin;3.1.8 -org.springframework.cloud:spring-cloud-contract-maven-plugin;3.1.8 -org.springframework.cloud:spring-cloud-contract-pact;3.1.8 -org.springframework.cloud:spring-cloud-contract-shade;3.1.8 -org.springframework.cloud:spring-cloud-contract-spec;3.1.8 -org.springframework.cloud:spring-cloud-contract-spec-groovy;3.1.8 -org.springframework.cloud:spring-cloud-contract-spec-java;3.1.8 -org.springframework.cloud:spring-cloud-contract-spec-kotlin;3.1.8 -org.springframework.cloud:spring-cloud-contract-stub-runner;3.1.8 -org.springframework.cloud:spring-cloud-contract-stub-runner-boot;3.1.8 -org.springframework.cloud:spring-cloud-contract-verifier;3.1.8 -org.springframework.cloud:spring-cloud-contract-wiremock;3.1.8 -org.springframework.cloud:spring-cloud-dependencies;2021.0.8 -org.springframework.cloud:spring-cloud-function-adapter-aws;3.2.11 -org.springframework.cloud:spring-cloud-function-adapter-azure;3.2.11 -org.springframework.cloud:spring-cloud-function-adapter-gcp;3.2.11 -org.springframework.cloud:spring-cloud-function-adapter-openwhisk;3.2.11 -org.springframework.cloud:spring-cloud-function-context;3.2.11 -org.springframework.cloud:spring-cloud-function-core;3.2.11 -org.springframework.cloud:spring-cloud-function-dependencies;3.2.11 -org.springframework.cloud:spring-cloud-function-deployer;3.2.11 -org.springframework.cloud:spring-cloud-function-grpc;3.2.11 -org.springframework.cloud:spring-cloud-function-grpc-cloudevent-ext;3.2.11 -org.springframework.cloud:spring-cloud-function-kotlin;3.2.11 -org.springframework.cloud:spring-cloud-function-rsocket;3.2.11 -org.springframework.cloud:spring-cloud-function-web;3.2.11 -org.springframework.cloud:spring-cloud-gateway-dependencies;3.1.8 -org.springframework.cloud:spring-cloud-gateway-mvc;3.1.8 -org.springframework.cloud:spring-cloud-gateway-server;3.1.8 -org.springframework.cloud:spring-cloud-gateway-webflux;3.1.8 -org.springframework.cloud:spring-cloud-kubernetes-client-autoconfig;2.1.8 -org.springframework.cloud:spring-cloud-kubernetes-client-config;2.1.8 -org.springframework.cloud:spring-cloud-kubernetes-client-discovery;2.1.8 -org.springframework.cloud:spring-cloud-kubernetes-client-loadbalancer;2.1.8 -org.springframework.cloud:spring-cloud-kubernetes-commons;2.1.8 -org.springframework.cloud:spring-cloud-kubernetes-dependencies;2.1.8 -org.springframework.cloud:spring-cloud-kubernetes-discovery;2.1.8 -org.springframework.cloud:spring-cloud-kubernetes-fabric8-autoconfig;2.1.8 -org.springframework.cloud:spring-cloud-kubernetes-fabric8-config;2.1.8 -org.springframework.cloud:spring-cloud-kubernetes-fabric8-discovery;2.1.8 -org.springframework.cloud:spring-cloud-kubernetes-fabric8-istio;2.1.8 -org.springframework.cloud:spring-cloud-kubernetes-fabric8-leader;2.1.8 -org.springframework.cloud:spring-cloud-kubernetes-fabric8-loadbalancer;2.1.8 -org.springframework.cloud:spring-cloud-kubernetes-test-support;2.1.8 -org.springframework.cloud:spring-cloud-loadbalancer;3.1.7 -org.springframework.cloud:spring-cloud-netflix-dependencies;3.1.7 -org.springframework.cloud:spring-cloud-netflix-eureka-client;3.1.7 -org.springframework.cloud:spring-cloud-netflix-eureka-server;3.1.7 -org.springframework.cloud:spring-cloud-openfeign-core;3.1.8 -org.springframework.cloud:spring-cloud-openfeign-dependencies;3.1.8 -org.springframework.cloud:spring-cloud-sleuth-api;3.1.9 -org.springframework.cloud:spring-cloud-sleuth-autoconfigure;3.1.9 -org.springframework.cloud:spring-cloud-sleuth-brave;3.1.9 -org.springframework.cloud:spring-cloud-sleuth-dependencies;3.1.9 -org.springframework.cloud:spring-cloud-sleuth-instrumentation;3.1.9 -org.springframework.cloud:spring-cloud-sleuth-tests-common;3.1.9 -org.springframework.cloud:spring-cloud-sleuth-zipkin;3.1.9 -org.springframework.cloud:spring-cloud-starter;3.1.7 -org.springframework.cloud:spring-cloud-starter-bootstrap;3.1.7 -org.springframework.cloud:spring-cloud-starter-bus-amqp;3.1.2 -org.springframework.cloud:spring-cloud-starter-bus-kafka;3.1.2 -org.springframework.cloud:spring-cloud-starter-bus-stream;3.1.2 -org.springframework.cloud:spring-cloud-starter-circuitbreaker-reactor-resilience4j;2.1.7 -org.springframework.cloud:spring-cloud-starter-circuitbreaker-resilience4j;2.1.7 -org.springframework.cloud:spring-cloud-starter-cloudfoundry;3.1.3 -org.springframework.cloud:spring-cloud-starter-config;3.1.8 -org.springframework.cloud:spring-cloud-starter-consul;3.1.4 -org.springframework.cloud:spring-cloud-starter-consul-all;3.1.4 -org.springframework.cloud:spring-cloud-starter-consul-bus;3.1.4 -org.springframework.cloud:spring-cloud-starter-consul-config;3.1.4 -org.springframework.cloud:spring-cloud-starter-consul-discovery;3.1.4 -org.springframework.cloud:spring-cloud-starter-contract-stub-runner;3.1.8 -org.springframework.cloud:spring-cloud-starter-contract-stub-runner-jetty;3.1.8 -org.springframework.cloud:spring-cloud-starter-contract-verifier;3.1.8 -org.springframework.cloud:spring-cloud-starter-function-web;3.2.11 -org.springframework.cloud:spring-cloud-starter-function-webflux;3.2.11 -org.springframework.cloud:spring-cloud-starter-gateway;3.1.8 -org.springframework.cloud:spring-cloud-starter-kubernetes-client;2.1.8 -org.springframework.cloud:spring-cloud-starter-kubernetes-client-all;2.1.8 -org.springframework.cloud:spring-cloud-starter-kubernetes-client-config;2.1.8 -org.springframework.cloud:spring-cloud-starter-kubernetes-client-loadbalancer;2.1.8 -org.springframework.cloud:spring-cloud-starter-kubernetes-discoveryclient;2.1.8 -org.springframework.cloud:spring-cloud-starter-kubernetes-fabric8;2.1.8 -org.springframework.cloud:spring-cloud-starter-kubernetes-fabric8-all;2.1.8 -org.springframework.cloud:spring-cloud-starter-kubernetes-fabric8-config;2.1.8 -org.springframework.cloud:spring-cloud-starter-kubernetes-fabric8-loadbalancer;2.1.8 -org.springframework.cloud:spring-cloud-starter-loadbalancer;3.1.7 -org.springframework.cloud:spring-cloud-starter-netflix-eureka-client;3.1.7 -org.springframework.cloud:spring-cloud-starter-netflix-eureka-server;3.1.7 -org.springframework.cloud:spring-cloud-starter-openfeign;3.1.8 -org.springframework.cloud:spring-cloud-starter-sleuth;3.1.9 -org.springframework.cloud:spring-cloud-starter-stream-kafka;3.2.9 -org.springframework.cloud:spring-cloud-starter-stream-rabbit;3.2.9 +org.springframework.cloud:spring-cloud-bus;3.1.3 +org.springframework.cloud:spring-cloud-bus-dependencies;3.1.3 +org.springframework.cloud:spring-cloud-bus-rsocket;3.1.3 +org.springframework.cloud:spring-cloud-circuitbreaker-dependencies;2.1.8 +org.springframework.cloud:spring-cloud-circuitbreaker-resilience4j;2.1.8 +org.springframework.cloud:spring-cloud-circuitbreaker-spring-retry;2.1.8 +org.springframework.cloud:spring-cloud-cloudfoundry-commons;3.1.4 +org.springframework.cloud:spring-cloud-cloudfoundry-dependencies;3.1.4 +org.springframework.cloud:spring-cloud-cloudfoundry-discovery;3.1.4 +org.springframework.cloud:spring-cloud-cloudfoundry-web;3.1.4 +org.springframework.cloud:spring-cloud-commons;3.1.8 +org.springframework.cloud:spring-cloud-commons-dependencies;3.1.8 +org.springframework.cloud:spring-cloud-config-client;3.1.9 +org.springframework.cloud:spring-cloud-config-dependencies;3.1.9 +org.springframework.cloud:spring-cloud-config-monitor;3.1.9 +org.springframework.cloud:spring-cloud-config-server;3.1.9 +org.springframework.cloud:spring-cloud-consul-binder;3.1.5 +org.springframework.cloud:spring-cloud-consul-config;3.1.5 +org.springframework.cloud:spring-cloud-consul-core;3.1.5 +org.springframework.cloud:spring-cloud-consul-dependencies;3.1.5 +org.springframework.cloud:spring-cloud-consul-discovery;3.1.5 +org.springframework.cloud:spring-cloud-context;3.1.8 +org.springframework.cloud:spring-cloud-contract-converters;3.1.9 +org.springframework.cloud:spring-cloud-contract-dependencies;3.1.9 +org.springframework.cloud:spring-cloud-contract-gradle-plugin;3.1.9 +org.springframework.cloud:spring-cloud-contract-maven-plugin;3.1.9 +org.springframework.cloud:spring-cloud-contract-pact;3.1.9 +org.springframework.cloud:spring-cloud-contract-shade;3.1.9 +org.springframework.cloud:spring-cloud-contract-spec;3.1.9 +org.springframework.cloud:spring-cloud-contract-spec-groovy;3.1.9 +org.springframework.cloud:spring-cloud-contract-spec-java;3.1.9 +org.springframework.cloud:spring-cloud-contract-spec-kotlin;3.1.9 +org.springframework.cloud:spring-cloud-contract-stub-runner;3.1.9 +org.springframework.cloud:spring-cloud-contract-stub-runner-boot;3.1.9 +org.springframework.cloud:spring-cloud-contract-verifier;3.1.9 +org.springframework.cloud:spring-cloud-contract-wiremock;3.1.9 +org.springframework.cloud:spring-cloud-dependencies;2021.0.9 +org.springframework.cloud:spring-cloud-function-adapter-aws;3.2.12 +org.springframework.cloud:spring-cloud-function-adapter-azure;3.2.12 +org.springframework.cloud:spring-cloud-function-adapter-gcp;3.2.12 +org.springframework.cloud:spring-cloud-function-adapter-openwhisk;3.2.12 +org.springframework.cloud:spring-cloud-function-context;3.2.12 +org.springframework.cloud:spring-cloud-function-core;3.2.12 +org.springframework.cloud:spring-cloud-function-dependencies;3.2.12 +org.springframework.cloud:spring-cloud-function-deployer;3.2.12 +org.springframework.cloud:spring-cloud-function-grpc;3.2.12 +org.springframework.cloud:spring-cloud-function-grpc-cloudevent-ext;3.2.12 +org.springframework.cloud:spring-cloud-function-kotlin;3.2.12 +org.springframework.cloud:spring-cloud-function-rsocket;3.2.12 +org.springframework.cloud:spring-cloud-function-web;3.2.12 +org.springframework.cloud:spring-cloud-gateway-dependencies;3.1.9 +org.springframework.cloud:spring-cloud-gateway-mvc;3.1.9 +org.springframework.cloud:spring-cloud-gateway-server;3.1.9 +org.springframework.cloud:spring-cloud-gateway-webflux;3.1.9 +org.springframework.cloud:spring-cloud-kubernetes-client-autoconfig;2.1.9 +org.springframework.cloud:spring-cloud-kubernetes-client-config;2.1.9 +org.springframework.cloud:spring-cloud-kubernetes-client-discovery;2.1.9 +org.springframework.cloud:spring-cloud-kubernetes-client-loadbalancer;2.1.9 +org.springframework.cloud:spring-cloud-kubernetes-commons;2.1.9 +org.springframework.cloud:spring-cloud-kubernetes-dependencies;2.1.9 +org.springframework.cloud:spring-cloud-kubernetes-discovery;2.1.9 +org.springframework.cloud:spring-cloud-kubernetes-fabric8-autoconfig;2.1.9 +org.springframework.cloud:spring-cloud-kubernetes-fabric8-config;2.1.9 +org.springframework.cloud:spring-cloud-kubernetes-fabric8-discovery;2.1.9 +org.springframework.cloud:spring-cloud-kubernetes-fabric8-istio;2.1.9 +org.springframework.cloud:spring-cloud-kubernetes-fabric8-leader;2.1.9 +org.springframework.cloud:spring-cloud-kubernetes-fabric8-loadbalancer;2.1.9 +org.springframework.cloud:spring-cloud-kubernetes-test-support;2.1.9 +org.springframework.cloud:spring-cloud-loadbalancer;3.1.8 +org.springframework.cloud:spring-cloud-netflix-dependencies;3.1.8 +org.springframework.cloud:spring-cloud-netflix-eureka-client;3.1.8 +org.springframework.cloud:spring-cloud-netflix-eureka-server;3.1.8 +org.springframework.cloud:spring-cloud-openfeign-core;3.1.9 +org.springframework.cloud:spring-cloud-openfeign-dependencies;3.1.9 +org.springframework.cloud:spring-cloud-sleuth-api;3.1.10 +org.springframework.cloud:spring-cloud-sleuth-autoconfigure;3.1.10 +org.springframework.cloud:spring-cloud-sleuth-brave;3.1.10 +org.springframework.cloud:spring-cloud-sleuth-dependencies;3.1.10 +org.springframework.cloud:spring-cloud-sleuth-instrumentation;3.1.10 +org.springframework.cloud:spring-cloud-sleuth-tests-common;3.1.10 +org.springframework.cloud:spring-cloud-sleuth-zipkin;3.1.10 +org.springframework.cloud:spring-cloud-starter;3.1.8 +org.springframework.cloud:spring-cloud-starter-bootstrap;3.1.8 +org.springframework.cloud:spring-cloud-starter-bus-amqp;3.1.3 +org.springframework.cloud:spring-cloud-starter-bus-kafka;3.1.3 +org.springframework.cloud:spring-cloud-starter-bus-stream;3.1.3 +org.springframework.cloud:spring-cloud-starter-circuitbreaker-reactor-resilience4j;2.1.8 +org.springframework.cloud:spring-cloud-starter-circuitbreaker-resilience4j;2.1.8 +org.springframework.cloud:spring-cloud-starter-cloudfoundry;3.1.4 +org.springframework.cloud:spring-cloud-starter-config;3.1.9 +org.springframework.cloud:spring-cloud-starter-consul;3.1.5 +org.springframework.cloud:spring-cloud-starter-consul-all;3.1.5 +org.springframework.cloud:spring-cloud-starter-consul-bus;3.1.5 +org.springframework.cloud:spring-cloud-starter-consul-config;3.1.5 +org.springframework.cloud:spring-cloud-starter-consul-discovery;3.1.5 +org.springframework.cloud:spring-cloud-starter-contract-stub-runner;3.1.9 +org.springframework.cloud:spring-cloud-starter-contract-stub-runner-jetty;3.1.9 +org.springframework.cloud:spring-cloud-starter-contract-verifier;3.1.9 +org.springframework.cloud:spring-cloud-starter-function-web;3.2.12 +org.springframework.cloud:spring-cloud-starter-function-webflux;3.2.12 +org.springframework.cloud:spring-cloud-starter-gateway;3.1.9 +org.springframework.cloud:spring-cloud-starter-kubernetes-client;2.1.9 +org.springframework.cloud:spring-cloud-starter-kubernetes-client-all;2.1.9 +org.springframework.cloud:spring-cloud-starter-kubernetes-client-config;2.1.9 +org.springframework.cloud:spring-cloud-starter-kubernetes-client-loadbalancer;2.1.9 +org.springframework.cloud:spring-cloud-starter-kubernetes-discoveryclient;2.1.9 +org.springframework.cloud:spring-cloud-starter-kubernetes-fabric8;2.1.9 +org.springframework.cloud:spring-cloud-starter-kubernetes-fabric8-all;2.1.9 +org.springframework.cloud:spring-cloud-starter-kubernetes-fabric8-config;2.1.9 +org.springframework.cloud:spring-cloud-starter-kubernetes-fabric8-loadbalancer;2.1.9 +org.springframework.cloud:spring-cloud-starter-loadbalancer;3.1.8 +org.springframework.cloud:spring-cloud-starter-netflix-eureka-client;3.1.8 +org.springframework.cloud:spring-cloud-starter-netflix-eureka-server;3.1.8 +org.springframework.cloud:spring-cloud-starter-openfeign;3.1.9 +org.springframework.cloud:spring-cloud-starter-sleuth;3.1.10 +org.springframework.cloud:spring-cloud-starter-stream-kafka;3.2.10 +org.springframework.cloud:spring-cloud-starter-stream-rabbit;3.2.10 org.springframework.cloud:spring-cloud-starter-task;2.4.6 -org.springframework.cloud:spring-cloud-starter-vault-config;3.1.3 -org.springframework.cloud:spring-cloud-starter-zookeeper;3.1.4 -org.springframework.cloud:spring-cloud-starter-zookeeper-all;3.1.4 -org.springframework.cloud:spring-cloud-starter-zookeeper-config;3.1.4 -org.springframework.cloud:spring-cloud-starter-zookeeper-discovery;3.1.4 -org.springframework.cloud:spring-cloud-stream;3.2.9 -org.springframework.cloud:spring-cloud-stream-binder-kafka;3.2.9 -org.springframework.cloud:spring-cloud-stream-binder-kafka-core;3.2.9 -org.springframework.cloud:spring-cloud-stream-binder-kafka-streams;3.2.9 -org.springframework.cloud:spring-cloud-stream-binder-rabbit;3.2.9 -org.springframework.cloud:spring-cloud-stream-binder-rabbit-core;3.2.9 -org.springframework.cloud:spring-cloud-stream-binder-rabbit-test-support;3.2.9 -org.springframework.cloud:spring-cloud-stream-binder-test;3.2.9 -org.springframework.cloud:spring-cloud-stream-dependencies;3.2.9 -org.springframework.cloud:spring-cloud-stream-test-support;3.2.9 +org.springframework.cloud:spring-cloud-starter-vault-config;3.1.4 +org.springframework.cloud:spring-cloud-starter-zookeeper;3.1.5 +org.springframework.cloud:spring-cloud-starter-zookeeper-all;3.1.5 +org.springframework.cloud:spring-cloud-starter-zookeeper-config;3.1.5 +org.springframework.cloud:spring-cloud-starter-zookeeper-discovery;3.1.5 +org.springframework.cloud:spring-cloud-stream;3.2.10 +org.springframework.cloud:spring-cloud-stream-binder-kafka;3.2.10 +org.springframework.cloud:spring-cloud-stream-binder-kafka-core;3.2.10 +org.springframework.cloud:spring-cloud-stream-binder-kafka-streams;3.2.10 +org.springframework.cloud:spring-cloud-stream-binder-rabbit;3.2.10 +org.springframework.cloud:spring-cloud-stream-binder-rabbit-core;3.2.10 +org.springframework.cloud:spring-cloud-stream-binder-rabbit-test-support;3.2.10 +org.springframework.cloud:spring-cloud-stream-binder-test;3.2.10 +org.springframework.cloud:spring-cloud-stream-dependencies;3.2.10 +org.springframework.cloud:spring-cloud-stream-test-support;3.2.10 org.springframework.cloud:spring-cloud-task-batch;2.4.6 org.springframework.cloud:spring-cloud-task-core;2.4.6 org.springframework.cloud:spring-cloud-task-dependencies;2.4.6 org.springframework.cloud:spring-cloud-task-stream;2.4.6 -org.springframework.cloud:spring-cloud-test-support;3.1.7 -org.springframework.cloud:spring-cloud-vault-config;3.1.3 -org.springframework.cloud:spring-cloud-vault-config-aws;3.1.3 -org.springframework.cloud:spring-cloud-vault-config-consul;3.1.3 -org.springframework.cloud:spring-cloud-vault-config-databases;3.1.3 -org.springframework.cloud:spring-cloud-vault-config-rabbitmq;3.1.3 -org.springframework.cloud:spring-cloud-vault-dependencies;3.1.3 -org.springframework.cloud:spring-cloud-zookeeper-config;3.1.4 -org.springframework.cloud:spring-cloud-zookeeper-core;3.1.4 -org.springframework.cloud:spring-cloud-zookeeper-dependencies;3.1.4 -org.springframework.cloud:spring-cloud-zookeeper-discovery;3.1.4 +org.springframework.cloud:spring-cloud-test-support;3.1.8 +org.springframework.cloud:spring-cloud-vault-config;3.1.4 +org.springframework.cloud:spring-cloud-vault-config-aws;3.1.4 +org.springframework.cloud:spring-cloud-vault-config-consul;3.1.4 +org.springframework.cloud:spring-cloud-vault-config-databases;3.1.4 +org.springframework.cloud:spring-cloud-vault-config-rabbitmq;3.1.4 +org.springframework.cloud:spring-cloud-vault-dependencies;3.1.4 +org.springframework.cloud:spring-cloud-zookeeper-config;3.1.5 +org.springframework.cloud:spring-cloud-zookeeper-core;3.1.5 +org.springframework.cloud:spring-cloud-zookeeper-dependencies;3.1.5 +org.springframework.cloud:spring-cloud-zookeeper-discovery;3.1.5 org.springframework.credhub:spring-credhub-core;2.1.1.RELEASE org.springframework.data:spring-data-bom;2021.2.18 org.springframework.data:spring-data-cassandra;3.4.18 @@ -1527,7 +1527,7 @@ org.springframework.security:spring-security-oauth2-jose;5.7.11 org.springframework.security:spring-security-oauth2-resource-server;5.7.11 org.springframework.security:spring-security-openid;5.7.11 org.springframework.security:spring-security-remoting;5.7.11 -org.springframework.security:spring-security-rsa;1.0.11.RELEASE +org.springframework.security:spring-security-rsa;1.0.12.RELEASE org.springframework.security:spring-security-rsocket;5.7.11 org.springframework.security:spring-security-saml2-service-provider;5.7.11 org.springframework.security:spring-security-taglibs;5.7.11 @@ -1546,29 +1546,29 @@ org.springframework.ws:spring-ws-security;3.1.8 org.springframework.ws:spring-ws-support;3.1.8 org.springframework.ws:spring-ws-test;3.1.8 org.springframework.ws:spring-xml;3.1.8 -org.springframework:spring-aop;5.3.31 -org.springframework:spring-aspects;5.3.31 -org.springframework:spring-beans;5.3.31 -org.springframework:spring-context;5.3.31 -org.springframework:spring-context-indexer;5.3.31 -org.springframework:spring-context-support;5.3.31 -org.springframework:spring-core;5.3.31 -org.springframework:spring-expression;5.3.31 -org.springframework:spring-framework-bom;5.3.31 -org.springframework:spring-instrument;5.3.31 -org.springframework:spring-jcl;5.3.31 -org.springframework:spring-jdbc;5.3.31 -org.springframework:spring-jms;5.3.31 -org.springframework:spring-messaging;5.3.31 -org.springframework:spring-orm;5.3.31 -org.springframework:spring-oxm;5.3.31 -org.springframework:spring-r2dbc;5.3.31 -org.springframework:spring-test;5.3.31 -org.springframework:spring-tx;5.3.31 -org.springframework:spring-web;5.3.31 -org.springframework:spring-webflux;5.3.31 -org.springframework:spring-webmvc;5.3.31 -org.springframework:spring-websocket;5.3.31 +org.springframework:spring-aop;5.3.32 +org.springframework:spring-aspects;5.3.32 +org.springframework:spring-beans;5.3.32 +org.springframework:spring-context;5.3.32 +org.springframework:spring-context-indexer;5.3.32 +org.springframework:spring-context-support;5.3.32 +org.springframework:spring-core;5.3.32 +org.springframework:spring-expression;5.3.32 +org.springframework:spring-framework-bom;5.3.32 +org.springframework:spring-instrument;5.3.32 +org.springframework:spring-jcl;5.3.32 +org.springframework:spring-jdbc;5.3.32 +org.springframework:spring-jms;5.3.32 +org.springframework:spring-messaging;5.3.32 +org.springframework:spring-orm;5.3.32 +org.springframework:spring-oxm;5.3.32 +org.springframework:spring-r2dbc;5.3.32 +org.springframework:spring-test;5.3.32 +org.springframework:spring-tx;5.3.32 +org.springframework:spring-web;5.3.32 +org.springframework:spring-webflux;5.3.32 +org.springframework:spring-webmvc;5.3.32 +org.springframework:spring-websocket;5.3.32 org.thymeleaf.extras:thymeleaf-extras-java8time;3.0.4.RELEASE org.thymeleaf.extras:thymeleaf-extras-springsecurity5;3.0.5.RELEASE org.thymeleaf:thymeleaf;3.0.15.RELEASE diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config-web/pom.xml b/sdk/spring/spring-cloud-azure-appconfiguration-config-web/pom.xml index 9afd67b4e39ff..6bf4e10fc8789 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config-web/pom.xml +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config-web/pom.xml @@ -40,7 +40,7 @@ org.springframework.cloud spring-cloud-bus - 3.1.2 + 3.1.3 true @@ -83,7 +83,7 @@ org.springframework.boot:spring-boot-starter-actuator:[2.7.18] org.springframework.boot:spring-boot-starter-web:[2.7.18] - org.springframework.cloud:spring-cloud-bus:[3.1.2] + org.springframework.cloud:spring-cloud-bus:[3.1.3] diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/pom.xml b/sdk/spring/spring-cloud-azure-appconfiguration-config/pom.xml index 570b2721ed5a4..cbd6e29f72411 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/pom.xml +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/pom.xml @@ -26,12 +26,12 @@ org.springframework.cloud spring-cloud-starter-bootstrap - 3.1.7 + 3.1.8 org.springframework.cloud spring-cloud-context - 3.1.7 + 3.1.8 org.springframework.boot @@ -129,8 +129,8 @@ org.hibernate.validator:hibernate-validator:[6.2.5.Final] org.springframework.boot:spring-boot-actuator:[2.7.18] org.springframework.boot:spring-boot-autoconfigure:[2.7.18] - org.springframework.cloud:spring-cloud-context:[3.1.7] - org.springframework.cloud:spring-cloud-starter-bootstrap:[3.1.7] + org.springframework.cloud:spring-cloud-context:[3.1.8] + org.springframework.cloud:spring-cloud-starter-bootstrap:[3.1.8] diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/pom.xml b/sdk/spring/spring-cloud-azure-autoconfigure/pom.xml index 7b2b3a2efa7a9..d077bfd559590 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/pom.xml +++ b/sdk/spring/spring-cloud-azure-autoconfigure/pom.xml @@ -95,7 +95,7 @@ org.springframework.cloud spring-cloud-starter-stream-kafka - 3.2.9 + 3.2.10 true @@ -119,7 +119,7 @@ org.springframework spring-jms - 5.3.31 + 5.3.32 true @@ -230,7 +230,7 @@ org.springframework spring-context-support - 5.3.31 + 5.3.32 true @@ -359,7 +359,7 @@ org.springframework.cloud spring-cloud-starter-sleuth - 3.1.9 + 3.1.10 test @@ -389,7 +389,7 @@ org.springframework spring-jdbc - 5.3.31 + 5.3.32 test @@ -432,14 +432,14 @@ org.springframework.data:spring-data-mongodb:[3.4.18] org.springframework.data:spring-data-redis:[2.7.18] org.springframework.kafka:spring-kafka:[2.9.11] - org.springframework.cloud:spring-cloud-starter-stream-kafka:[3.2.9] - org.springframework:spring-context-support:[5.3.31] + org.springframework.cloud:spring-cloud-starter-stream-kafka:[3.2.10] + org.springframework:spring-context-support:[5.3.32] org.springframework.security:spring-security-oauth2-client:[5.7.11] org.springframework.security:spring-security-oauth2-resource-server:[5.7.11] org.springframework.security:spring-security-oauth2-jose:[5.7.11] org.springframework.security:spring-security-config:[5.7.11] - org.springframework:spring-jms:[5.3.31] - org.springframework:spring-jdbc:[5.3.31] + org.springframework:spring-jms:[5.3.32] + org.springframework:spring-jdbc:[5.3.32] redis.clients:jedis:[3.8.0] diff --git a/sdk/spring/spring-cloud-azure-core/pom.xml b/sdk/spring/spring-cloud-azure-core/pom.xml index 94710d8e62331..91103ae22152d 100644 --- a/sdk/spring/spring-cloud-azure-core/pom.xml +++ b/sdk/spring/spring-cloud-azure-core/pom.xml @@ -36,7 +36,7 @@ org.springframework spring-context - 5.3.31 + 5.3.32 com.azure @@ -120,7 +120,7 @@ org.springframework spring-test - 5.3.31 + 5.3.32 test @@ -146,7 +146,7 @@ - org.springframework:spring-context:[5.3.31] + org.springframework:spring-context:[5.3.32] diff --git a/sdk/spring/spring-cloud-azure-feature-management-web/pom.xml b/sdk/spring/spring-cloud-azure-feature-management-web/pom.xml index 2660557f4ba13..7dbdc930f0d65 100644 --- a/sdk/spring/spring-cloud-azure-feature-management-web/pom.xml +++ b/sdk/spring/spring-cloud-azure-feature-management-web/pom.xml @@ -30,12 +30,12 @@ org.springframework spring-web - 5.3.31 + 5.3.32 org.springframework spring-webmvc - 5.3.31 + 5.3.32 javax.servlet @@ -67,8 +67,8 @@ com.azure.spring:spring-cloud-azure-feature-management:[4.17.0-beta.1] javax.servlet:javax.servlet-api:[4.0.1] - org.springframework:spring-web:[5.3.31] - org.springframework:spring-webmvc:[5.3.31] + org.springframework:spring-web:[5.3.32] + org.springframework:spring-webmvc:[5.3.32] diff --git a/sdk/spring/spring-cloud-azure-feature-management/pom.xml b/sdk/spring/spring-cloud-azure-feature-management/pom.xml index 46b3774568558..34f0cf9961092 100644 --- a/sdk/spring/spring-cloud-azure-feature-management/pom.xml +++ b/sdk/spring/spring-cloud-azure-feature-management/pom.xml @@ -32,7 +32,7 @@ org.springframework spring-context - 5.3.31 + 5.3.32 org.springframework.boot @@ -75,7 +75,7 @@ com.fasterxml.jackson.core:jackson-databind:[2.13.5] io.projectreactor.netty:reactor-netty:[1.0.40] org.springframework.boot:spring-boot-starter:[2.7.18] - org.springframework:spring-context:[5.3.31] + org.springframework:spring-context:[5.3.32] diff --git a/sdk/spring/spring-cloud-azure-resourcemanager/pom.xml b/sdk/spring/spring-cloud-azure-resourcemanager/pom.xml index 734139cc43751..6dd762da20279 100644 --- a/sdk/spring/spring-cloud-azure-resourcemanager/pom.xml +++ b/sdk/spring/spring-cloud-azure-resourcemanager/pom.xml @@ -75,7 +75,7 @@ org.springframework spring-test - 5.3.31 + 5.3.32 test diff --git a/sdk/spring/spring-cloud-azure-service/pom.xml b/sdk/spring/spring-cloud-azure-service/pom.xml index ccfb41a7a8560..a150b767c7600 100644 --- a/sdk/spring/spring-cloud-azure-service/pom.xml +++ b/sdk/spring/spring-cloud-azure-service/pom.xml @@ -155,7 +155,7 @@ org.springframework spring-test - 5.3.31 + 5.3.32 test diff --git a/sdk/spring/spring-cloud-azure-starter-servicebus-jms/pom.xml b/sdk/spring/spring-cloud-azure-starter-servicebus-jms/pom.xml index 0255b4451157d..f60142c655473 100644 --- a/sdk/spring/spring-cloud-azure-starter-servicebus-jms/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-servicebus-jms/pom.xml @@ -95,7 +95,7 @@ org.springframework spring-jms - 5.3.31 + 5.3.32 org.messaginghub diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/pom.xml b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/pom.xml index 630a6a7756d37..b9448c9e4b01d 100644 --- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/pom.xml +++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/pom.xml @@ -43,7 +43,7 @@ spring-integration-core - 3.2.9 + 3.2.10 @@ -88,7 +88,7 @@ org.springframework spring-test - 5.3.31 + 5.3.32 test @@ -125,7 +125,7 @@ org.springframework.boot:spring-boot-configuration-processor:[2.7.18] - org.springframework.cloud:spring-cloud-stream:[3.2.9] + org.springframework.cloud:spring-cloud-stream:[3.2.10] diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/pom.xml b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/pom.xml index 03e7561374906..dc6e34b92784b 100644 --- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/pom.xml +++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/pom.xml @@ -66,7 +66,7 @@ org.springframework.cloud spring-cloud-stream-binder-test - 3.2.9 + 3.2.10 test diff --git a/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/pom.xml b/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/pom.xml index a0c07569da8e3..20c36428e3bef 100644 --- a/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/pom.xml +++ b/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/pom.xml @@ -37,7 +37,7 @@ org.springframework.cloud spring-cloud-stream - 3.2.9 + 3.2.10 @@ -86,7 +86,7 @@ org.springframework spring-test - 5.3.31 + 5.3.32 test @@ -124,7 +124,7 @@ org.springframework.boot:spring-boot-configuration-processor:[2.7.18] - org.springframework.cloud:spring-cloud-stream:[3.2.9] + org.springframework.cloud:spring-cloud-stream:[3.2.10] diff --git a/sdk/spring/spring-cloud-azure-stream-binder-servicebus/pom.xml b/sdk/spring/spring-cloud-azure-stream-binder-servicebus/pom.xml index 1e8f4be5656a4..fe1db49052f1f 100644 --- a/sdk/spring/spring-cloud-azure-stream-binder-servicebus/pom.xml +++ b/sdk/spring/spring-cloud-azure-stream-binder-servicebus/pom.xml @@ -68,7 +68,7 @@ org.springframework.cloud spring-cloud-stream-binder-test - 3.2.9 + 3.2.10 test diff --git a/sdk/spring/spring-cloud-azure-trace-sleuth/pom.xml b/sdk/spring/spring-cloud-azure-trace-sleuth/pom.xml index f432204504a9c..0e932518e4da5 100644 --- a/sdk/spring/spring-cloud-azure-trace-sleuth/pom.xml +++ b/sdk/spring/spring-cloud-azure-trace-sleuth/pom.xml @@ -41,7 +41,7 @@ org.springframework.cloud spring-cloud-sleuth-api - 3.1.9 + 3.1.10 org.mockito @@ -116,7 +116,7 @@ - org.springframework.cloud:spring-cloud-sleuth-api:[3.1.9] + org.springframework.cloud:spring-cloud-sleuth-api:[3.1.10] diff --git a/sdk/spring/spring-integration-azure-core/pom.xml b/sdk/spring/spring-integration-azure-core/pom.xml index 491b9948dcc9f..7e219ee39b279 100644 --- a/sdk/spring/spring-integration-azure-core/pom.xml +++ b/sdk/spring/spring-integration-azure-core/pom.xml @@ -81,7 +81,7 @@ org.springframework spring-test - 5.3.31 + 5.3.32 test diff --git a/sdk/spring/spring-integration-azure-eventhubs/pom.xml b/sdk/spring/spring-integration-azure-eventhubs/pom.xml index 6a4caa74e5d78..afaccfbccb309 100644 --- a/sdk/spring/spring-integration-azure-eventhubs/pom.xml +++ b/sdk/spring/spring-integration-azure-eventhubs/pom.xml @@ -90,7 +90,7 @@ org.springframework spring-test - 5.3.31 + 5.3.32 test diff --git a/sdk/spring/spring-integration-azure-servicebus/pom.xml b/sdk/spring/spring-integration-azure-servicebus/pom.xml index 6b8fe28bed824..9f736e59c468d 100644 --- a/sdk/spring/spring-integration-azure-servicebus/pom.xml +++ b/sdk/spring/spring-integration-azure-servicebus/pom.xml @@ -102,7 +102,7 @@ org.springframework spring-test - 5.3.31 + 5.3.32 test diff --git a/sdk/spring/spring-messaging-azure-eventhubs/pom.xml b/sdk/spring/spring-messaging-azure-eventhubs/pom.xml index 957272b238d61..b22afda00ec96 100644 --- a/sdk/spring/spring-messaging-azure-eventhubs/pom.xml +++ b/sdk/spring/spring-messaging-azure-eventhubs/pom.xml @@ -62,7 +62,7 @@ org.springframework spring-tx - 5.3.31 + 5.3.32 true @@ -100,7 +100,7 @@ org.springframework spring-test - 5.3.31 + 5.3.32 test @@ -146,8 +146,8 @@ - org.springframework:spring-messaging:[5.3.31] - org.springframework:spring-tx:[5.3.31] + org.springframework:spring-messaging:[5.3.32] + org.springframework:spring-tx:[5.3.32] org.springframework.retry:spring-retry:[1.3.4] org.springframework.data:spring-data-commons:[2.7.18] io.micrometer:micrometer-core:[1.9.17] diff --git a/sdk/spring/spring-messaging-azure-servicebus/pom.xml b/sdk/spring/spring-messaging-azure-servicebus/pom.xml index 7260db9a1ae29..54dc18a9d07ab 100644 --- a/sdk/spring/spring-messaging-azure-servicebus/pom.xml +++ b/sdk/spring/spring-messaging-azure-servicebus/pom.xml @@ -60,7 +60,7 @@ org.springframework spring-tx - 5.3.31 + 5.3.32 true @@ -141,8 +141,8 @@ - org.springframework:spring-messaging:[5.3.31] - org.springframework:spring-tx:[5.3.31] + org.springframework:spring-messaging:[5.3.32] + org.springframework:spring-tx:[5.3.32] org.springframework.retry:spring-retry:[1.3.4] org.springframework.data:spring-data-commons:[2.7.18] io.micrometer:micrometer-core:[1.9.17] diff --git a/sdk/spring/spring-messaging-azure/pom.xml b/sdk/spring/spring-messaging-azure/pom.xml index b5425a8ba5d38..c1900f6970716 100644 --- a/sdk/spring/spring-messaging-azure/pom.xml +++ b/sdk/spring/spring-messaging-azure/pom.xml @@ -42,12 +42,12 @@ org.springframework spring-messaging - 5.3.31 + 5.3.32 org.springframework spring-tx - 5.3.31 + 5.3.32 true @@ -103,8 +103,8 @@ - org.springframework:spring-messaging:[5.3.31] - org.springframework:spring-tx:[5.3.31] + org.springframework:spring-messaging:[5.3.32] + org.springframework:spring-tx:[5.3.32] org.springframework.retry:spring-retry:[1.3.4] org.springframework.data:spring-data-commons:[2.7.18] io.micrometer:micrometer-core:[1.9.17] From 3e0e7603578b84e5a4590771b364c566ad10960f Mon Sep 17 00:00:00 2001 From: "Hong Li(MSFT)" <74638143+v-hongli1@users.noreply.github.com> Date: Wed, 13 Mar 2024 12:46:51 +0800 Subject: [PATCH 32/90] Increment package versions for resourcemanager cosmosdb releases (#39173) Increment package versions for resourcemanager cosmosdb releases (#39173) --- eng/versioning/version_client.txt | 2 +- .../azure-resourcemanager-cosmos/CHANGELOG.md | 10 +++++++++- .../azure-resourcemanager-cosmos/pom.xml | 2 +- sdk/resourcemanager/azure-resourcemanager/pom.xml | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 6307e7010fd0f..777616d3ea2c8 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -264,7 +264,7 @@ com.azure.resourcemanager:azure-resourcemanager-compute;2.36.0;2.37.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-containerinstance;2.36.0;2.37.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-containerregistry;2.36.0;2.37.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-containerservice;2.36.0;2.37.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-cosmos;2.36.0;2.37.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-cosmos;2.36.0;2.37.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-dns;2.36.0;2.37.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-eventhubs;2.36.0;2.37.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-keyvault;2.36.0;2.37.0-beta.1 diff --git a/sdk/resourcemanager/azure-resourcemanager-cosmos/CHANGELOG.md b/sdk/resourcemanager/azure-resourcemanager-cosmos/CHANGELOG.md index 3ce402056201b..fceae32422d76 100644 --- a/sdk/resourcemanager/azure-resourcemanager-cosmos/CHANGELOG.md +++ b/sdk/resourcemanager/azure-resourcemanager-cosmos/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 2.37.0-beta.1 (Unreleased) +## 2.37.0-beta.2 (Unreleased) ### Features Added @@ -10,6 +10,14 @@ ### Other Changes +## 2.37.0-beta.1 (2024-03-07) + +### Other Changes + +#### Dependency Updates + +- Preview release for `api-version` `2024-02-15-preview`. + ## 2.36.0 (2024-02-29) ### Other Changes diff --git a/sdk/resourcemanager/azure-resourcemanager-cosmos/pom.xml b/sdk/resourcemanager/azure-resourcemanager-cosmos/pom.xml index a92e5aa62331d..d60afb51f2197 100644 --- a/sdk/resourcemanager/azure-resourcemanager-cosmos/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-cosmos/pom.xml @@ -10,7 +10,7 @@ com.azure.resourcemanager azure-resourcemanager-cosmos - 2.37.0-beta.1 + 2.37.0-beta.2 jar Microsoft Azure SDK for CosmosDB Management diff --git a/sdk/resourcemanager/azure-resourcemanager/pom.xml b/sdk/resourcemanager/azure-resourcemanager/pom.xml index 291f75d2d644f..6fb7124ca2fb9 100644 --- a/sdk/resourcemanager/azure-resourcemanager/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager/pom.xml @@ -126,7 +126,7 @@ com.azure.resourcemanager azure-resourcemanager-cosmos - 2.37.0-beta.1 + 2.37.0-beta.2 com.azure.resourcemanager From 8e8d797c4aa2f76c8d37af4d84a411071e8acb8e Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 13 Mar 2024 12:41:11 -0400 Subject: [PATCH 33/90] Increment package versions for monitor releases (#39163) Co-authored-by: Jair Myree --- eng/versioning/version_client.txt | 2 +- sdk/monitor/azure-monitor-ingestion-perf/pom.xml | 2 +- sdk/monitor/azure-monitor-ingestion/CHANGELOG.md | 10 ++++++++++ sdk/monitor/azure-monitor-ingestion/pom.xml | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 777616d3ea2c8..acb3ba61e1b7b 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -163,7 +163,7 @@ com.azure:azure-messaging-webpubsub-client;1.0.0;1.1.0-beta.1 com.azure:azure-mixedreality-authentication;1.2.21;1.3.0-beta.1 com.azure:azure-mixedreality-remoterendering;1.1.26;1.2.0-beta.1 com.azure:azure-monitor-opentelemetry-exporter;1.0.0-beta.21;1.0.0-beta.22 -com.azure:azure-monitor-ingestion;1.1.4;1.1.5 +com.azure:azure-monitor-ingestion;1.1.5;1.2.0-beta.1 com.azure:azure-monitor-ingestion-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-monitor-query;1.2.9;1.3.0-beta.3 com.azure:azure-monitor-query-perf;1.0.0-beta.1;1.0.0-beta.1 diff --git a/sdk/monitor/azure-monitor-ingestion-perf/pom.xml b/sdk/monitor/azure-monitor-ingestion-perf/pom.xml index d5ec3b414e47a..78320a30de04a 100644 --- a/sdk/monitor/azure-monitor-ingestion-perf/pom.xml +++ b/sdk/monitor/azure-monitor-ingestion-perf/pom.xml @@ -31,7 +31,7 @@ com.azure azure-monitor-ingestion - 1.1.5 + 1.2.0-beta.1 com.azure diff --git a/sdk/monitor/azure-monitor-ingestion/CHANGELOG.md b/sdk/monitor/azure-monitor-ingestion/CHANGELOG.md index 1f42795d3a156..53d412567e5e5 100644 --- a/sdk/monitor/azure-monitor-ingestion/CHANGELOG.md +++ b/sdk/monitor/azure-monitor-ingestion/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.2.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.1.5 (2024-03-11) ### Other Changes diff --git a/sdk/monitor/azure-monitor-ingestion/pom.xml b/sdk/monitor/azure-monitor-ingestion/pom.xml index 171983fcbba84..eb1a6f3a02c3a 100644 --- a/sdk/monitor/azure-monitor-ingestion/pom.xml +++ b/sdk/monitor/azure-monitor-ingestion/pom.xml @@ -7,7 +7,7 @@ com.azure azure-monitor-ingestion - 1.1.5 + 1.2.0-beta.1 jar Microsoft Azure SDK for Azure Monitor Data Ingestion From f8b369f561e4b8b3316852567ae9f2bb689e5f33 Mon Sep 17 00:00:00 2001 From: Jair Myree Date: Wed, 13 Mar 2024 11:28:00 -0700 Subject: [PATCH 34/90] Preparing Tables March 2024 Beta Release (#39196) * Preparing Tables March 2024 Beta Release * Preparing Tables March 2024 Beta Release --- sdk/tables/azure-data-tables/CHANGELOG.md | 12 ++++++++---- sdk/tables/azure-data-tables/README.md | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/sdk/tables/azure-data-tables/CHANGELOG.md b/sdk/tables/azure-data-tables/CHANGELOG.md index c2a1df4e7c9ab..c831d5f83a426 100644 --- a/sdk/tables/azure-data-tables/CHANGELOG.md +++ b/sdk/tables/azure-data-tables/CHANGELOG.md @@ -1,15 +1,19 @@ # Release History -## 12.4.0-beta.1 (Unreleased) - -### Features Added +## 12.4.0-beta.1 (2024-03-13) ### Breaking Changes -### Bugs Fixed +- Removed `jackson-dataformat-xml` as a dependency. ### Other Changes +- Migrating from Jackson to stream-style serialization. + +#### Dependency Updates + +- Introducing `azure-xml` version `1.0.0-beta.3` as a beta dependency. + ## 12.3.20 (2024-03-07) ### Bugs Fixed diff --git a/sdk/tables/azure-data-tables/README.md b/sdk/tables/azure-data-tables/README.md index 431efc4d305f2..dc3016010966f 100644 --- a/sdk/tables/azure-data-tables/README.md +++ b/sdk/tables/azure-data-tables/README.md @@ -46,7 +46,7 @@ add the direct dependency to your project as follows. com.azure azure-data-tables - 12.3.20 + 12.4.0-beta.1 ``` [//]: # ({x-version-update-end}) From 9cfe00a224abf0280fea98c9de8331eca80ae629 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 13 Mar 2024 15:37:14 -0400 Subject: [PATCH 35/90] APIView - send package version param for automatic API review request (#39197) Co-authored-by: Praveen Kuttappan --- eng/common/scripts/Create-APIReview.ps1 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/eng/common/scripts/Create-APIReview.ps1 b/eng/common/scripts/Create-APIReview.ps1 index c3c8f4a46dc67..3d1f549458b77 100644 --- a/eng/common/scripts/Create-APIReview.ps1 +++ b/eng/common/scripts/Create-APIReview.ps1 @@ -15,7 +15,7 @@ Param ( ) # Submit API review request and return status whether current revision is approved or pending or failed to create review -function Submit-APIReview($packagename, $filePath, $uri, $apiKey, $apiLabel, $releaseStatus) +function Submit-APIReview($packagename, $filePath, $uri, $apiKey, $apiLabel, $releaseStatus, $packageVersion) { $multipartContent = [System.Net.Http.MultipartFormDataContent]::new() $FileStream = [System.IO.FileStream]::new($filePath, [System.IO.FileMode]::Open) @@ -35,6 +35,13 @@ function Submit-APIReview($packagename, $filePath, $uri, $apiKey, $apiLabel, $re $multipartContent.Add($stringContent) Write-Host "Request param, label: $apiLabel" + $versionParam = [System.Net.Http.Headers.ContentDispositionHeaderValue]::new("form-data") + $versionParam.Name = "packageVersion" + $versionContent = [System.Net.Http.StringContent]::new($packageVersion) + $versionContent.Headers.ContentDisposition = $versionParam + $multipartContent.Add($versionContent) + Write-Host "Request param, packageVersion: $packageVersion" + if ($releaseStatus -and ($releaseStatus -ne "Unreleased")) { $compareAllParam = [System.Net.Http.Headers.ContentDispositionHeaderValue]::new("form-data") @@ -106,6 +113,7 @@ if ($packages) # Get package info from json file created before updating version to daily dev $pkgInfo = Get-Content $pkgPropPath | ConvertFrom-Json $version = [AzureEngSemanticVersion]::ParseVersionString($pkgInfo.Version) + $versionString = $pkgInfo.Version if ($version -eq $null) { Write-Host "Version info is not available for package $PackageName, because version '$(pkgInfo.Version)' is invalid. Please check if the version follows Azure SDK package versioning guidelines." @@ -121,7 +129,7 @@ if ($packages) if ( ($SourceBranch -eq $DefaultBranch) -or (-not $version.IsPrerelease)) { Write-Host "Submitting API Review for package $($pkg)" - $respCode = Submit-APIReview -packagename $pkg -filePath $pkgPath -uri $APIViewUri -apiKey $APIKey -apiLabel $APILabel -releaseStatus $pkgInfo.ReleaseStatus + $respCode = Submit-APIReview -packagename $pkg -filePath $pkgPath -uri $APIViewUri -apiKey $APIKey -apiLabel $APILabel -releaseStatus $pkgInfo.ReleaseStatus -packageVersion $versionString Write-Host "HTTP Response code: $($respCode)" # HTTP status 200 means API is in approved status if ($respCode -eq '200') From b80607576db4839a7e44d9133ff0e861797156ca Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 14 Mar 2024 02:20:19 -0400 Subject: [PATCH 36/90] [Automation] Generate Fluent Lite from security#package-composite-v3 (#39205) --- .../CHANGELOG.md | 471 +- .../azure-resourcemanager-security/README.md | 8 +- .../azure-resourcemanager-security/SAMPLE.md | 6365 ++++++++++------- .../azure-resourcemanager-security/pom.xml | 3 +- .../security/SecurityManager.java | 1299 ++-- .../AdaptiveApplicationControlsClient.java | 48 +- .../AdaptiveNetworkHardeningsClient.java | 103 +- .../AdvancedThreatProtectionsClient.java | 20 +- .../security/fluent/AlertsClient.java | 204 +- .../fluent/AlertsSuppressionRulesClient.java | 32 +- .../fluent/AllowedConnectionsClient.java | 48 +- .../ApiCollectionOffboardingsClient.java | 50 - .../ApiCollectionOnboardingsClient.java | 52 - .../security/fluent/ApiCollectionsClient.java | 265 +- .../fluent/ApplicationOperationsClient.java | 20 +- .../security/fluent/ApplicationsClient.java | 16 +- .../security/fluent/AssessmentsClient.java | 44 +- .../fluent/AssessmentsMetadatasClient.java | 48 +- .../AutoProvisioningSettingsClient.java | 20 +- .../security/fluent/AutomationsClient.java | 97 +- .../fluent/AzureDevOpsOrgsClient.java | 237 + .../fluent/AzureDevOpsProjectsClient.java | 225 + .../fluent/AzureDevOpsReposClient.java | 239 + .../fluent/ComplianceResultsClient.java | 16 +- .../security/fluent/CompliancesClient.java | 20 +- .../security/fluent/ConnectorsClient.java | 28 +- .../CustomAssessmentAutomationsClient.java | 96 +- .../CustomEntityStoreAssignmentsClient.java | 104 +- .../fluent/DefenderForStoragesClient.java | 76 + .../fluent/DevOpsConfigurationsClient.java | 253 + .../fluent/DevOpsOperationResultsClient.java | 46 + .../fluent/DeviceSecurityGroupsClient.java | 47 +- .../DiscoveredSecuritySolutionsClient.java | 48 +- .../ExternalSecuritySolutionsClient.java | 52 +- .../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 | 76 +- .../fluent/GovernanceRulesClient.java | 144 +- .../security/fluent/HealthReportsClient.java | 36 +- .../InformationProtectionPoliciesClient.java | 41 +- .../fluent/IngestionSettingsClient.java | 169 - .../IotSecuritySolutionAnalyticsClient.java | 28 +- ...utionsAnalyticsAggregatedAlertsClient.java | 36 +- ...lutionsAnalyticsRecommendationsClient.java | 36 +- .../fluent/IotSecuritySolutionsClient.java | 78 +- .../JitNetworkAccessPoliciesClient.java | 130 +- .../security/fluent/LocationsClient.java | 16 +- .../security/fluent/MdeOnboardingsClient.java | 16 +- .../security/fluent/OperationsClient.java | 16 +- .../security/fluent/PricingsClient.java | 132 +- ...RegulatoryComplianceAssessmentsClient.java | 36 +- .../RegulatoryComplianceControlsClient.java | 24 +- .../RegulatoryComplianceStandardsClient.java | 16 +- .../fluent/ResourceProvidersClient.java | 65 + .../SecureScoreControlDefinitionsClient.java | 12 +- .../fluent/SecureScoreControlsClient.java | 28 +- .../security/fluent/SecureScoresClient.java | 18 +- .../security/fluent/SecurityCenter.java | 570 +- ...yConnectorApplicationOperationsClient.java | 44 +- .../SecurityConnectorApplicationsClient.java | 16 +- .../fluent/SecurityConnectorsClient.java | 74 +- .../fluent/SecurityContactsClient.java | 37 +- .../fluent/SecurityOperatorsClient.java | 24 +- .../fluent/SecuritySolutionsClient.java | 24 +- ...SecuritySolutionsReferenceDatasClient.java | 16 +- ...nt.java => SensitivitySettingsClient.java} | 29 +- .../ServerVulnerabilityAssessmentsClient.java | 84 +- ...ulnerabilityAssessmentsSettingsClient.java | 124 + .../security/fluent/SettingsClient.java | 27 +- .../fluent/SoftwareInventoriesClient.java | 55 +- ...rabilityAssessmentBaselineRulesClient.java | 28 +- ...nerabilityAssessmentScanResultsClient.java | 12 +- ...SqlVulnerabilityAssessmentScansClient.java | 12 +- .../security/fluent/SubAssessmentsClient.java | 44 +- .../security/fluent/TasksClient.java | 100 +- .../security/fluent/TopologiesClient.java | 44 +- .../fluent/WorkspaceSettingsClient.java | 32 +- .../AdaptiveApplicationControlGroupData.java | 34 +- .../AdaptiveApplicationControlGroupInner.java | 44 +- ...AdaptiveApplicationControlGroupsInner.java | 10 +- .../models/AdaptiveNetworkHardeningInner.java | 28 +- .../AdaptiveNetworkHardeningProperties.java | 26 +- .../AdvancedThreatProtectionProperties.java | 14 +- .../AdvancedThreatProtectionSettingInner.java | 16 +- .../security/fluent/models/AlertInner.java | 70 +- .../fluent/models/AlertProperties.java | 68 +- .../models/AlertSyncSettingProperties.java | 14 +- .../models/AlertsSuppressionRuleInner.java | 42 +- .../AlertsSuppressionRuleProperties.java | 61 +- .../AllowedConnectionsResourceInner.java | 18 +- .../AllowedConnectionsResourceProperties.java | 14 +- .../fluent/models/ApiCollectionInner.java | 145 + .../models/ApiCollectionProperties.java | 179 +- .../models/ApiCollectionResponseInner.java | 90 - .../fluent/models/ApplicationInner.java | 28 +- .../fluent/models/ApplicationProperties.java | 38 +- .../fluent/models/AscLocationInner.java | 14 +- .../models/AutoProvisioningSettingInner.java | 16 +- .../AutoProvisioningSettingProperties.java | 20 +- .../fluent/models/AutomationInner.java | 48 +- .../fluent/models/AutomationProperties.java | 34 +- .../AutomationValidationStatusInner.java | 18 +- .../fluent/models/AzureDevOpsOrgInner.java | 75 + .../AzureDevOpsOrgListResponseInner.java | 84 + .../models/AzureDevOpsProjectInner.java | 75 + .../models/AzureDevOpsRepositoryInner.java | 75 + .../fluent/models/ComplianceInner.java | 22 +- .../fluent/models/ComplianceProperties.java | 16 +- .../fluent/models/ComplianceResultInner.java | 14 +- .../models/ComplianceResultProperties.java | 12 +- .../fluent/models/ConnectionStringsInner.java | 62 - .../fluent/models/ConnectorSettingInner.java | 20 +- .../models/ConnectorSettingProperties.java | 18 +- .../CustomAssessmentAutomationInner.java | 48 +- .../CustomAssessmentAutomationProperties.java | 44 +- ...AssessmentAutomationRequestProperties.java | 34 +- .../CustomEntityStoreAssignmentInner.java | 22 +- ...CustomEntityStoreAssignmentProperties.java | 18 +- ...ntityStoreAssignmentRequestProperties.java | 22 +- .../models/DataExportSettingProperties.java | 14 +- .../DefenderForStorageSettingInner.java | 220 + .../DefenderForStorageSettingProperties.java | 237 + .../models/DevOpsConfigurationInner.java | 75 + .../models/DeviceSecurityGroupInner.java | 28 +- .../models/DeviceSecurityGroupProperties.java | 26 +- .../DiscoveredSecuritySolutionInner.java | 36 +- .../DiscoveredSecuritySolutionProperties.java | 50 +- .../models/ExternalSecuritySolutionInner.java | 11 +- ...tSensitivitySettingsListResponseInner.java | 58 + .../GetSensitivitySettingsResponseInner.java | 59 + .../fluent/models/GitHubOwnerInner.java | 75 + .../models/GitHubOwnerListResponseInner.java | 84 + .../fluent/models/GitHubRepositoryInner.java | 75 + .../fluent/models/GitLabGroupInner.java | 75 + .../models/GitLabGroupListResponseInner.java | 84 + .../fluent/models/GitLabProjectInner.java | 75 + .../models/GovernanceAssignmentInner.java | 48 +- .../GovernanceAssignmentProperties.java | 54 +- .../fluent/models/GovernanceRuleInner.java | 80 +- .../models/GovernanceRuleProperties.java | 108 +- .../fluent/models/HealthReportInner.java | 70 +- .../fluent/models/HealthReportProperties.java | 80 +- .../InformationProtectionPolicyInner.java | 24 +- ...InformationProtectionPolicyProperties.java | 48 +- .../fluent/models/IngestionSettingInner.java | 51 - .../models/IngestionSettingTokenInner.java | 40 - .../IoTSecurityAggregatedAlertInner.java | 42 +- .../IoTSecurityAggregatedAlertProperties.java | 36 +- ...SecurityAggregatedRecommendationInner.java | 38 +- ...ityAggregatedRecommendationProperties.java | 32 +- ...oTSecuritySolutionAnalyticsModelInner.java | 40 +- ...curitySolutionAnalyticsModelListInner.java | 22 +- ...uritySolutionAnalyticsModelProperties.java | 36 +- .../models/IoTSecuritySolutionModelInner.java | 82 +- .../models/IoTSecuritySolutionProperties.java | 82 +- .../models/JitNetworkAccessPolicyInner.java | 34 +- .../JitNetworkAccessPolicyProperties.java | 30 +- .../models/JitNetworkAccessRequestInner.java | 48 +- .../models/MalwareScanningProperties.java | 141 + .../fluent/models/MdeOnboardingDataInner.java | 26 +- .../models/MdeOnboardingDataListInner.java | 14 +- .../models/MdeOnboardingDataProperties.java | 18 +- .../fluent/models/OnUploadProperties.java | 80 + .../fluent/models/OperationInner.java | 18 +- .../OperationResultAutoGeneratedInner.java | 12 +- .../models/OperationStatusResultInner.java | 249 + .../security/fluent/models/PricingInner.java | 140 +- .../fluent/models/PricingListInner.java | 19 +- .../fluent/models/PricingProperties.java | 197 +- .../RegulatoryComplianceAssessmentInner.java | 30 +- ...ulatoryComplianceAssessmentProperties.java | 28 +- .../RegulatoryComplianceControlInner.java | 24 +- ...RegulatoryComplianceControlProperties.java | 22 +- .../RegulatoryComplianceStandardInner.java | 24 +- ...egulatoryComplianceStandardProperties.java | 22 +- .../fluent/models/RuleResultsInner.java | 14 +- .../fluent/models/RulesResultsInner.java | 14 +- .../security/fluent/models/ScanInner.java | 14 +- .../fluent/models/ScanResultInner.java | 14 +- .../fluent/models/ScanResultsInner.java | 14 +- .../security/fluent/models/ScansInner.java | 14 +- .../security/fluent/models/ScoreDetails.java | 16 +- ...SecureScoreControlDefinitionItemInner.java | 22 +- ...eScoreControlDefinitionItemProperties.java | 20 +- .../SecureScoreControlDetailsInner.java | 32 +- .../SecureScoreControlScoreDetailsInner.java | 32 +- .../fluent/models/SecureScoreItemInner.java | 22 +- .../models/SecureScoreItemProperties.java | 22 +- .../SecurityAssessmentMetadataProperties.java | 74 +- ...yAssessmentMetadataPropertiesResponse.java | 82 +- ...curityAssessmentMetadataResponseInner.java | 78 +- .../models/SecurityAssessmentProperties.java | 36 +- .../SecurityAssessmentPropertiesResponse.java | 36 +- .../SecurityAssessmentResponseInner.java | 36 +- .../fluent/models/SecurityConnectorInner.java | 40 +- .../models/SecurityConnectorProperties.java | 28 +- .../fluent/models/SecurityContactInner.java | 74 +- .../models/SecurityContactProperties.java | 86 +- .../fluent/models/SecurityOperatorInner.java | 14 +- .../models/SecurityOperatorListInner.java | 19 +- .../fluent/models/SecuritySolutionInner.java | 30 +- .../models/SecuritySolutionProperties.java | 50 +- ...curitySolutionsReferenceDataListInner.java | 14 +- ...uritySolutionsReferenceDataProperties.java | 81 +- .../models/SecuritySubAssessmentInner.java | 38 +- .../SecuritySubAssessmentProperties.java | 36 +- .../fluent/models/SecurityTaskInner.java | 24 +- .../fluent/models/SecurityTaskProperties.java | 22 +- .../SensitiveDataDiscoveryProperties.java | 74 + .../ServerVulnerabilityAssessmentInner.java | 14 +- ...rverVulnerabilityAssessmentProperties.java | 12 +- ...lityAssessmentsAzureSettingProperties.java | 66 + ...rverVulnerabilityAssessmentsListInner.java | 14 +- ...rVulnerabilityAssessmentsSettingInner.java | 56 + .../security/fluent/models/SettingInner.java | 13 +- .../security/fluent/models/SoftwareInner.java | 53 +- .../fluent/models/SoftwareProperties.java | 46 +- .../fluent/models/TopologyResourceInner.java | 18 +- .../models/TopologyResourceProperties.java | 14 +- .../UpdateIoTSecuritySolutionProperties.java | 26 +- .../fluent/models/WorkspaceSettingInner.java | 28 +- .../models/WorkspaceSettingProperties.java | 38 +- .../security/fluent/models/package-info.java | 4 +- .../security/fluent/package-info.java | 4 +- .../AdaptiveApplicationControlGroupImpl.java | 65 +- .../AdaptiveApplicationControlGroupsImpl.java | 12 +- ...AdaptiveApplicationControlsClientImpl.java | 415 +- .../AdaptiveApplicationControlsImpl.java | 105 +- .../AdaptiveNetworkHardeningImpl.java | 4 +- .../AdaptiveNetworkHardeningsClientImpl.java | 743 +- .../AdaptiveNetworkHardeningsImpl.java | 114 +- .../AdvancedThreatProtectionSettingImpl.java | 35 +- .../AdvancedThreatProtectionsClientImpl.java | 161 +- .../AdvancedThreatProtectionsImpl.java | 40 +- .../implementation/AlertsClientImpl.java | 2012 ++---- .../security/implementation/AlertsImpl.java | 115 +- .../AlertsSuppressionRuleImpl.java | 4 +- .../AlertsSuppressionRulesClientImpl.java | 469 +- .../AlertsSuppressionRulesImpl.java | 38 +- .../AllowedConnectionsClientImpl.java | 511 +- .../AllowedConnectionsImpl.java | 37 +- .../AllowedConnectionsResourceImpl.java | 3 +- .../implementation/ApiCollectionImpl.java | 81 + .../ApiCollectionOffboardingsClientImpl.java | 248 - .../ApiCollectionOffboardingsImpl.java | 43 - .../ApiCollectionOnboardingsClientImpl.java | 252 - .../ApiCollectionOnboardingsImpl.java | 60 - .../ApiCollectionResponseImpl.java | 55 - .../ApiCollectionsClientImpl.java | 1409 +++- .../implementation/ApiCollectionsImpl.java | 97 +- .../implementation/ApplicationImpl.java | 50 +- .../ApplicationOperationsClientImpl.java | 239 +- .../ApplicationOperationsImpl.java | 41 +- .../ApplicationsClientImpl.java | 195 +- .../implementation/ApplicationsImpl.java | 8 +- .../implementation/AssessmentsClientImpl.java | 360 +- .../implementation/AssessmentsImpl.java | 119 +- .../AssessmentsMetadatasClientImpl.java | 677 +- .../AssessmentsMetadatasImpl.java | 82 +- .../AutoProvisioningSettingImpl.java | 36 +- .../AutoProvisioningSettingsClientImpl.java | 322 +- .../AutoProvisioningSettingsImpl.java | 35 +- .../implementation/AutomationImpl.java | 119 +- .../AutomationValidationStatusImpl.java | 3 +- .../implementation/AutomationsClientImpl.java | 941 ++- .../implementation/AutomationsImpl.java | 118 +- .../implementation/AzureDevOpsOrgImpl.java | 121 + .../AzureDevOpsOrgListResponseImpl.java | 47 + .../AzureDevOpsOrgsClientImpl.java | 1105 +++ .../implementation/AzureDevOpsOrgsImpl.java | 135 + .../AzureDevOpsProjectImpl.java | 127 + .../AzureDevOpsProjectsClientImpl.java | 1049 +++ .../AzureDevOpsProjectsImpl.java | 127 + .../AzureDevOpsReposClientImpl.java | 1117 +++ .../implementation/AzureDevOpsReposImpl.java | 138 + .../AzureDevOpsRepositoryImpl.java | 133 + .../implementation/ComplianceResultImpl.java | 4 +- .../ComplianceResultsClientImpl.java | 219 +- .../implementation/ComplianceResultsImpl.java | 17 +- .../implementation/CompliancesClientImpl.java | 219 +- .../implementation/CompliancesImpl.java | 13 +- .../implementation/ConnectionStringsImpl.java | 40 - .../implementation/ConnectorSettingImpl.java | 46 +- .../implementation/ConnectorsClientImpl.java | 404 +- .../implementation/ConnectorsImpl.java | 45 +- .../CustomAssessmentAutomationImpl.java | 42 +- ...CustomAssessmentAutomationsClientImpl.java | 869 +-- .../CustomAssessmentAutomationsImpl.java | 141 +- .../CustomEntityStoreAssignmentImpl.java | 46 +- ...ustomEntityStoreAssignmentsClientImpl.java | 868 +-- .../CustomEntityStoreAssignmentsImpl.java | 141 +- .../DefenderForStorageSettingImpl.java | 149 + .../DefenderForStoragesClientImpl.java | 323 + .../DefenderForStoragesImpl.java | 96 + .../DevOpsConfigurationImpl.java | 50 + .../DevOpsConfigurationsClientImpl.java | 1152 +++ .../DevOpsConfigurationsImpl.java | 123 + .../DevOpsOperationResultsClientImpl.java | 210 + .../DevOpsOperationResultsImpl.java | 58 + .../DeviceSecurityGroupImpl.java | 71 +- .../DeviceSecurityGroupsClientImpl.java | 398 +- .../DeviceSecurityGroupsImpl.java | 153 +- .../DiscoveredSecuritySolutionImpl.java | 3 +- ...DiscoveredSecuritySolutionsClientImpl.java | 515 +- .../DiscoveredSecuritySolutionsImpl.java | 42 +- .../ExternalSecuritySolutionImpl.java | 4 +- .../ExternalSecuritySolutionsClientImpl.java | 511 +- .../ExternalSecuritySolutionsImpl.java | 38 +- ...etSensitivitySettingsListResponseImpl.java | 44 + .../GetSensitivitySettingsResponseImpl.java | 45 + .../implementation/GitHubOwnerImpl.java | 49 + .../GitHubOwnerListResponseImpl.java | 47 + .../GitHubOwnersClientImpl.java | 566 ++ .../implementation/GitHubOwnersImpl.java | 93 + .../implementation/GitHubReposClientImpl.java | 458 ++ .../implementation/GitHubReposImpl.java | 74 + .../implementation/GitHubRepositoryImpl.java | 50 + .../implementation/GitLabGroupImpl.java | 49 + .../GitLabGroupListResponseImpl.java | 47 + .../GitLabGroupsClientImpl.java | 568 ++ .../implementation/GitLabGroupsImpl.java | 93 + .../implementation/GitLabProjectImpl.java | 50 + .../GitLabProjectsClientImpl.java | 466 ++ .../implementation/GitLabProjectsImpl.java | 74 + .../GitLabSubgroupsClientImpl.java | 209 + .../implementation/GitLabSubgroupsImpl.java | 58 + .../GovernanceAssignmentImpl.java | 85 +- .../GovernanceAssignmentsClientImpl.java | 497 +- .../GovernanceAssignmentsImpl.java | 217 +- .../implementation/GovernanceRuleImpl.java | 60 +- .../GovernanceRulesClientImpl.java | 776 +- .../implementation/GovernanceRulesImpl.java | 130 +- .../implementation/HealthReportImpl.java | 19 + .../HealthReportOperationsClientImpl.java | 180 - .../HealthReportOperationsImpl.java | 58 - .../HealthReportsClientImpl.java | 267 +- .../implementation/HealthReportsImpl.java | 29 +- ...formationProtectionPoliciesClientImpl.java | 395 +- .../InformationProtectionPoliciesImpl.java | 102 +- .../InformationProtectionPolicyImpl.java | 78 +- .../implementation/IngestionSettingImpl.java | 117 - .../IngestionSettingTokenImpl.java | 32 - .../IngestionSettingsClientImpl.java | 1030 --- .../implementation/IngestionSettingsImpl.java | 183 - .../IoTSecurityAggregatedAlertImpl.java | 3 +- ...TSecurityAggregatedRecommendationImpl.java | 3 +- ...IoTSecuritySolutionAnalyticsModelImpl.java | 3 +- ...ecuritySolutionAnalyticsModelListImpl.java | 12 +- .../IoTSecuritySolutionModelImpl.java | 66 +- ...otSecuritySolutionAnalyticsClientImpl.java | 226 +- .../IotSecuritySolutionAnalyticsImpl.java | 29 +- ...nsAnalyticsAggregatedAlertsClientImpl.java | 450 +- ...olutionsAnalyticsAggregatedAlertsImpl.java | 43 +- ...onsAnalyticsRecommendationsClientImpl.java | 377 +- ...SolutionsAnalyticsRecommendationsImpl.java | 41 +- .../IotSecuritySolutionsClientImpl.java | 835 +-- .../IotSecuritySolutionsImpl.java | 121 +- .../JitNetworkAccessPoliciesClientImpl.java | 1297 ++-- .../JitNetworkAccessPoliciesImpl.java | 211 +- .../JitNetworkAccessPolicyImpl.java | 75 +- .../JitNetworkAccessRequestImpl.java | 4 +- .../implementation/LocationsClientImpl.java | 249 +- .../implementation/LocationsImpl.java | 13 +- .../implementation/MdeOnboardingDataImpl.java | 4 +- .../MdeOnboardingDataListImpl.java | 12 +- .../MdeOnboardingsClientImpl.java | 146 +- .../implementation/MdeOnboardingsImpl.java | 14 +- .../OperationResultAutoGeneratedImpl.java | 3 +- .../OperationStatusResultImpl.java | 71 + .../implementation/OperationsClientImpl.java | 170 +- .../implementation/OperationsImpl.java | 8 +- .../security/implementation/PricingImpl.java | 31 +- .../implementation/PricingListImpl.java | 5 +- .../implementation/PricingsClientImpl.java | 614 +- .../security/implementation/PricingsImpl.java | 56 +- .../RegulatoryComplianceAssessmentImpl.java | 3 +- ...latoryComplianceAssessmentsClientImpl.java | 427 +- .../RegulatoryComplianceAssessmentsImpl.java | 68 +- .../RegulatoryComplianceControlImpl.java | 3 +- ...egulatoryComplianceControlsClientImpl.java | 351 +- .../RegulatoryComplianceControlsImpl.java | 44 +- .../RegulatoryComplianceStandardImpl.java | 3 +- ...gulatoryComplianceStandardsClientImpl.java | 284 +- .../RegulatoryComplianceStandardsImpl.java | 22 +- .../{Utils.java => ResourceManagerUtils.java} | 45 +- .../ResourceProvidersClientImpl.java | 270 + .../implementation/ResourceProvidersImpl.java | 79 + .../implementation/RuleResultsImpl.java | 50 +- .../implementation/RulesResultsImpl.java | 8 +- .../implementation/ScanResultsImpl.java | 8 +- .../security/implementation/ScansImpl.java | 5 +- .../SecureScoreControlDefinitionItemImpl.java | 3 +- ...cureScoreControlDefinitionsClientImpl.java | 339 +- .../SecureScoreControlDefinitionsImpl.java | 15 +- .../SecureScoreControlDetailsImpl.java | 4 +- .../SecureScoreControlScoreDetailsImpl.java | 3 +- .../SecureScoreControlsClientImpl.java | 415 +- .../SecureScoreControlsImpl.java | 20 +- .../implementation/SecureScoreItemImpl.java | 4 +- .../SecureScoresClientImpl.java | 254 +- .../implementation/SecureScoresImpl.java | 13 +- ...ecurityAssessmentMetadataResponseImpl.java | 43 +- .../SecurityAssessmentResponseImpl.java | 67 +- .../implementation/SecurityCenterBuilder.java | 46 +- .../implementation/SecurityCenterImpl.java | 1333 ++-- ...nectorApplicationOperationsClientImpl.java | 354 +- ...ityConnectorApplicationOperationsImpl.java | 53 +- ...curityConnectorApplicationsClientImpl.java | 238 +- .../SecurityConnectorApplicationsImpl.java | 11 +- .../implementation/SecurityConnectorImpl.java | 58 +- .../SecurityConnectorsClientImpl.java | 807 +-- .../SecurityConnectorsImpl.java | 113 +- .../implementation/SecurityContactImpl.java | 71 +- .../SecurityContactsClientImpl.java | 459 +- .../implementation/SecurityContactsImpl.java | 76 +- .../implementation/SecurityOperatorImpl.java | 4 +- .../SecurityOperatorListImpl.java | 12 +- .../SecurityOperatorsClientImpl.java | 341 +- .../implementation/SecurityOperatorsImpl.java | 39 +- .../implementation/SecuritySolutionImpl.java | 4 +- .../SecuritySolutionsClientImpl.java | 280 +- .../implementation/SecuritySolutionsImpl.java | 21 +- ...ecuritySolutionsReferenceDataListImpl.java | 3 +- ...ritySolutionsReferenceDatasClientImpl.java | 181 +- .../SecuritySolutionsReferenceDatasImpl.java | 21 +- .../SecuritySubAssessmentImpl.java | 4 +- .../SensitivitySettingsClientImpl.java | 146 + .../SensitivitySettingsImpl.java | 55 + .../ServerVulnerabilityAssessmentImpl.java | 3 +- ...verVulnerabilityAssessmentsClientImpl.java | 574 +- .../ServerVulnerabilityAssessmentsImpl.java | 80 +- ...erverVulnerabilityAssessmentsListImpl.java | 12 +- ...erVulnerabilityAssessmentsSettingImpl.java | 45 + ...rabilityAssessmentsSettingsClientImpl.java | 641 ++ ...rVulnerabilityAssessmentsSettingsImpl.java | 105 + .../implementation/SettingsClientImpl.java | 322 +- .../security/implementation/SettingsImpl.java | 25 +- .../SoftwareInventoriesClientImpl.java | 556 +- .../SoftwareInventoriesImpl.java | 63 +- ...lityAssessmentBaselineRulesClientImpl.java | 294 +- ...nerabilityAssessmentBaselineRulesImpl.java | 34 +- ...bilityAssessmentScanResultsClientImpl.java | 156 +- ...ulnerabilityAssessmentScanResultsImpl.java | 29 +- ...ulnerabilityAssessmentScansClientImpl.java | 121 +- .../SqlVulnerabilityAssessmentScansImpl.java | 13 +- .../SubAssessmentsClientImpl.java | 433 +- .../implementation/SubAssessmentsImpl.java | 25 +- .../implementation/TasksClientImpl.java | 1102 +-- .../security/implementation/TasksImpl.java | 92 +- .../implementation/TopologiesClientImpl.java | 483 +- .../implementation/TopologiesImpl.java | 25 +- .../implementation/TopologyResourceImpl.java | 4 +- .../implementation/WorkspaceSettingImpl.java | 54 +- .../WorkspaceSettingsClientImpl.java | 507 +- .../implementation/WorkspaceSettingsImpl.java | 53 +- .../security/implementation/package-info.java | 4 +- .../security/models/AadConnectivityState.java | 22 +- .../AadConnectivityStateAutoGenerated.java | 14 +- .../models/AadExternalSecuritySolution.java | 14 +- .../models/AadSolutionProperties.java | 26 +- .../security/models/ActionType.java | 22 +- .../models/ActionableRemediation.java | 157 + .../models/ActionableRemediationState.java | 61 + .../ActiveConnectionsNotInAllowedRange.java | 26 +- .../AdaptiveApplicationControlGroup.java | 155 +- .../AdaptiveApplicationControlGroups.java | 8 +- .../AdaptiveApplicationControlIssue.java | 46 +- ...daptiveApplicationControlIssueSummary.java | 18 +- .../models/AdaptiveApplicationControls.java | 38 +- .../models/AdaptiveNetworkHardening.java | 18 +- ...daptiveNetworkHardeningEnforceRequest.java | 39 +- .../models/AdaptiveNetworkHardenings.java | 76 +- .../models/AdaptiveNetworkHardeningsList.java | 18 +- .../security/models/AdditionalData.java | 13 +- .../models/AdditionalWorkspaceDataType.java | 18 +- .../models/AdditionalWorkspaceType.java | 14 +- .../AdditionalWorkspacesProperties.java | 22 +- .../AdvancedThreatProtectionSetting.java | 51 +- .../models/AdvancedThreatProtections.java | 14 +- .../security/models/Alert.java | 66 +- .../security/models/AlertEntity.java | 19 +- .../security/models/AlertList.java | 16 +- .../AlertPropertiesSupportingEvidence.java | 19 +- .../security/models/AlertSeverity.java | 22 +- ...lertSimulatorBundlesRequestProperties.java | 14 +- .../models/AlertSimulatorRequestBody.java | 14 +- .../AlertSimulatorRequestProperties.java | 19 +- .../security/models/AlertStatus.java | 26 +- .../security/models/AlertSyncSettings.java | 16 +- .../security/models/Alerts.java | 184 +- .../models/AlertsSuppressionRule.java | 28 +- .../models/AlertsSuppressionRules.java | 28 +- .../models/AlertsSuppressionRulesList.java | 22 +- .../security/models/AllowedConnections.java | 48 +- .../models/AllowedConnectionsList.java | 14 +- .../models/AllowedConnectionsResource.java | 18 +- .../models/AllowlistCustomAlertRule.java | 27 +- .../AmqpC2DMessagesNotInAllowedRange.java | 26 +- ...pC2DRejectedMessagesNotInAllowedRange.java | 26 +- .../AmqpD2CMessagesNotInAllowedRange.java | 26 +- .../models/AnnotateDefaultBranchState.java | 56 + .../security/models/ApiCollection.java | 116 + ...sponseList.java => ApiCollectionList.java} | 24 +- .../models/ApiCollectionOffboardings.java | 46 - .../models/ApiCollectionOnboardings.java | 47 - .../security/models/ApiCollections.java | 212 +- .../security/models/Application.java | 128 +- .../models/ApplicationOperations.java | 22 +- .../models/ApplicationSourceResourceType.java | 14 +- .../security/models/Applications.java | 16 +- .../security/models/ApplicationsList.java | 14 +- .../security/models/AscLocation.java | 14 +- .../security/models/AscLocationList.java | 14 +- .../security/models/AssessedResourceType.java | 26 +- .../security/models/AssessmentLinks.java | 12 +- .../security/models/AssessmentStatus.java | 27 +- .../security/models/AssessmentStatusCode.java | 22 +- .../models/AssessmentStatusResponse.java | 26 +- .../security/models/AssessmentType.java | 22 +- .../security/models/Assessments.java | 42 +- .../security/models/AssessmentsMetadatas.java | 46 +- .../models/AtaExternalSecuritySolution.java | 14 +- .../models/AtaSolutionProperties.java | 26 +- .../AuthenticationDetailsProperties.java | 17 +- .../AuthenticationProvisioningState.java | 26 +- .../security/models/AuthenticationType.java | 18 +- .../security/models/Authorization.java | 60 + .../security/models/AutoDiscovery.java | 58 + .../security/models/AutoProvision.java | 18 +- .../models/AutoProvisioningSetting.java | 44 +- .../models/AutoProvisioningSettingList.java | 16 +- .../models/AutoProvisioningSettings.java | 18 +- .../security/models/Automation.java | 220 +- .../security/models/AutomationAction.java | 13 +- .../models/AutomationActionEventHub.java | 42 +- .../models/AutomationActionLogicApp.java | 18 +- .../models/AutomationActionWorkspace.java | 18 +- .../security/models/AutomationList.java | 21 +- .../security/models/AutomationRuleSet.java | 14 +- .../security/models/AutomationScope.java | 18 +- .../security/models/AutomationSource.java | 14 +- .../models/AutomationTriggeringRule.java | 22 +- .../models/AutomationUpdateModel.java | 183 + .../models/AutomationValidationStatus.java | 10 +- .../security/models/Automations.java | 58 +- ...meRoleAuthenticationDetailsProperties.java | 38 +- ...sCredsAuthenticationDetailsProperties.java | 29 +- .../security/models/AwsEnvironmentData.java | 46 +- .../models/AwsOrganizationalData.java | 13 +- .../models/AwsOrganizationalDataMaster.java | 18 +- .../models/AwsOrganizationalDataMember.java | 14 +- .../security/models/AzureDevOpsOrg.java | 189 + .../models/AzureDevOpsOrgListResponse.java | 34 + .../models/AzureDevOpsOrgProperties.java | 182 + .../security/models/AzureDevOpsOrgs.java | 124 + .../security/models/AzureDevOpsProject.java | 191 + .../AzureDevOpsProjectListResponse.java | 85 + .../models/AzureDevOpsProjectProperties.java | 223 + .../security/models/AzureDevOpsProjects.java | 103 + .../security/models/AzureDevOpsRepos.java | 109 + .../models/AzureDevOpsRepository.java | 192 + .../AzureDevOpsRepositoryListResponse.java | 85 + .../AzureDevOpsRepositoryProperties.java | 280 + .../AzureDevOpsScopeEnvironmentData.java | 10 +- .../security/models/AzureResourceDetails.java | 12 +- .../models/AzureResourceIdentifier.java | 12 +- .../security/models/AzureResourceLink.java | 12 +- .../security/models/AzureServersSetting.java | 81 + .../models/AzureTrackedResourceLocation.java | 14 +- .../security/models/Baseline.java | 18 +- .../models/BaselineAdjustedResult.java | 26 +- .../security/models/BenchmarkReference.java | 18 +- .../security/models/BuiltInInfoType.java | 107 + .../security/models/BundleType.java | 46 +- .../security/models/Categories.java | 30 +- .../models/CategoryConfiguration.java | 98 + .../models/CefExternalSecuritySolution.java | 14 +- .../models/CefSolutionProperties.java | 34 +- .../security/models/CloudName.java | 34 +- .../security/models/CloudOffering.java | 15 +- .../resourcemanager/security/models/Code.java | 18 +- .../security/models/Compliance.java | 18 +- .../security/models/ComplianceList.java | 16 +- .../security/models/ComplianceResult.java | 14 +- .../security/models/ComplianceResultList.java | 21 +- .../security/models/ComplianceResults.java | 16 +- .../security/models/ComplianceSegment.java | 14 +- .../security/models/Compliances.java | 20 +- .../security/models/ConfigurationStatus.java | 30 +- .../security/models/ConnectableResource.java | 16 +- .../security/models/ConnectedResource.java | 16 +- .../security/models/ConnectedWorkspace.java | 14 +- .../models/ConnectionFromIpNotAllowed.java | 18 +- .../security/models/ConnectionStrings.java | 25 - .../models/ConnectionToIpNotAllowed.java | 18 +- .../security/models/ConnectionType.java | 18 +- .../security/models/ConnectorSetting.java | 90 +- .../security/models/ConnectorSettingList.java | 16 +- .../security/models/Connectors.java | 30 +- ...tainerRegistryVulnerabilityProperties.java | 39 +- .../security/models/ControlType.java | 18 +- .../models/CspmMonitorAwsOffering.java | 18 +- ...nitorAwsOfferingNativeCloudConnection.java | 14 +- .../CspmMonitorAzureDevOpsOffering.java | 10 +- .../models/CspmMonitorGcpOffering.java | 18 +- ...nitorGcpOfferingNativeCloudConnection.java | 26 +- .../models/CspmMonitorGitLabOffering.java | 10 +- .../models/CspmMonitorGithubOffering.java | 10 +- .../security/models/CustomAlertRule.java | 21 +- .../models/CustomAssessmentAutomation.java | 114 +- .../CustomAssessmentAutomationRequest.java | 36 +- .../models/CustomAssessmentAutomations.java | 104 +- ...CustomAssessmentAutomationsListResult.java | 16 +- .../models/CustomEntityStoreAssignment.java | 59 +- .../CustomEntityStoreAssignmentRequest.java | 24 +- .../models/CustomEntityStoreAssignments.java | 104 +- ...ustomEntityStoreAssignmentsListResult.java | 16 +- .../resourcemanager/security/models/Cve.java | 14 +- .../resourcemanager/security/models/Cvss.java | 12 +- .../security/models/DataExportSettings.java | 16 +- .../security/models/DataSource.java | 14 +- .../models/DefenderCspmAwsOffering.java | 119 +- .../models/DefenderCspmAwsOfferingCiem.java | 86 + .../DefenderCspmAwsOfferingCiemDiscovery.java | 54 + .../DefenderCspmAwsOfferingCiemOidc.java | 82 + ...pmAwsOfferingDataSensitivityDiscovery.java | 18 +- .../DefenderCspmAwsOfferingDatabasesDspm.java | 18 +- ...ingMdcContainersAgentlessDiscoveryK8S.java | 80 + ...sOfferingMdcContainersImageAssessment.java | 80 + .../DefenderCspmAwsOfferingVmScanners.java | 22 +- ...spmAwsOfferingVmScannersConfiguration.java | 22 +- .../models/DefenderCspmGcpOffering.java | 167 +- .../DefenderCspmGcpOfferingCiemDiscovery.java | 110 + ...pmGcpOfferingDataSensitivityDiscovery.java | 108 + ...ingMdcContainersAgentlessDiscoveryK8S.java | 108 + ...pOfferingMdcContainersImageAssessment.java | 108 + .../DefenderCspmGcpOfferingVmScanners.java | 84 + ...spmGcpOfferingVmScannersConfiguration.java | 83 + .../DefenderFoDatabasesAwsOffering.java | 26 +- ...tabasesAwsOfferingArcAutoProvisioning.java | 26 +- ...eringArcAutoProvisioningConfiguration.java | 22 +- ...erFoDatabasesAwsOfferingDatabasesDspm.java | 18 +- .../DefenderFoDatabasesAwsOfferingRds.java | 18 +- .../DefenderForContainersAwsOffering.java | 134 +- ...tainersAwsOfferingCloudWatchToKinesis.java | 14 +- ...eringContainerVulnerabilityAssessment.java | 14 +- ...gContainerVulnerabilityAssessmentTask.java | 14 +- ...erForContainersAwsOfferingKinesisToS3.java | 14 +- ...inersAwsOfferingKubernetesScubaReader.java | 14 +- ...ontainersAwsOfferingKubernetesService.java | 14 +- ...ingMdcContainersAgentlessDiscoveryK8S.java | 80 + ...sOfferingMdcContainersImageAssessment.java | 80 + .../DefenderForContainersGcpOffering.java | 104 +- ...ringDataPipelineNativeCloudConnection.java | 26 +- ...ingMdcContainersAgentlessDiscoveryK8S.java | 108 + ...pOfferingMdcContainersImageAssessment.java | 108 + ...inersGcpOfferingNativeCloudConnection.java | 26 +- .../DefenderForDatabasesGcpOffering.java | 28 +- ...tabasesGcpOfferingArcAutoProvisioning.java | 22 +- ...eringArcAutoProvisioningConfiguration.java | 22 +- ...fenderForDatabasesArcAutoProvisioning.java | 26 +- .../DefenderForDevOpsAzureDevOpsOffering.java | 10 +- .../DefenderForDevOpsGitLabOffering.java | 10 +- .../DefenderForDevOpsGithubOffering.java | 10 +- .../models/DefenderForServersAwsOffering.java | 50 +- ...ServersAwsOfferingArcAutoProvisioning.java | 26 +- ...eringArcAutoProvisioningConfiguration.java | 18 +- ...rServersAwsOfferingDefenderForServers.java | 14 +- ...ServersAwsOfferingMdeAutoProvisioning.java | 18 +- .../DefenderForServersAwsOfferingSubPlan.java | 14 +- ...rServersAwsOfferingVaAutoProvisioning.java | 22 +- ...feringVaAutoProvisioningConfiguration.java | 14 +- ...fenderForServersAwsOfferingVmScanners.java | 22 +- ...ersAwsOfferingVmScannersConfiguration.java | 22 +- .../models/DefenderForServersGcpOffering.java | 50 +- ...ServersGcpOfferingArcAutoProvisioning.java | 22 +- ...eringArcAutoProvisioningConfiguration.java | 18 +- ...rServersGcpOfferingDefenderForServers.java | 26 +- ...ServersGcpOfferingMdeAutoProvisioning.java | 18 +- .../DefenderForServersGcpOfferingSubPlan.java | 14 +- ...rServersGcpOfferingVaAutoProvisioning.java | 22 +- ...feringVaAutoProvisioningConfiguration.java | 14 +- ...fenderForServersGcpOfferingVmScanners.java | 22 +- ...ersGcpOfferingVmScannersConfiguration.java | 18 +- .../models/DefenderForStorageSetting.java | 262 + .../security/models/DefenderForStorages.java | 69 + .../models/DenylistCustomAlertRule.java | 24 +- .../security/models/DevOpsConfiguration.java | 55 + .../DevOpsConfigurationListResponse.java | 85 + .../models/DevOpsConfigurationProperties.java | 194 + .../security/models/DevOpsConfigurations.java | 147 + .../models/DevOpsOperationResults.java | 41 + .../models/DevOpsProvisioningState.java | 86 + .../security/models/DeviceSecurityGroup.java | 135 +- .../models/DeviceSecurityGroupList.java | 16 +- .../security/models/DeviceSecurityGroups.java | 38 +- .../DirectMethodInvokesNotInAllowedRange.java | 26 +- .../security/models/Direction.java | 18 +- .../models/DiscoveredSecuritySolution.java | 22 +- .../DiscoveredSecuritySolutionList.java | 16 +- .../models/DiscoveredSecuritySolutions.java | 44 +- .../EffectiveNetworkSecurityGroups.java | 18 +- .../security/models/EndOfSupportStatus.java | 34 +- .../security/models/Enforce.java | 55 + .../security/models/EnforcementMode.java | 22 +- .../security/models/EnforcementSupport.java | 22 +- .../security/models/EnvironmentData.java | 13 +- .../security/models/EnvironmentDetails.java | 38 +- .../security/models/EnvironmentType.java | 30 +- .../resourcemanager/security/models/Etag.java | 14 +- .../security/models/EventSource.java | 68 +- .../models/ExecuteGovernanceRuleParams.java | 14 +- .../security/models/ExpandControlsEnum.java | 14 +- .../security/models/ExpandEnum.java | 18 +- .../security/models/ExportData.java | 14 +- .../security/models/Extension.java | 73 +- .../models/ExternalSecuritySolution.java | 14 +- .../models/ExternalSecuritySolutionKind.java | 22 +- .../models/ExternalSecuritySolutionList.java | 16 +- .../ExternalSecuritySolutionProperties.java | 29 +- .../models/ExternalSecuritySolutions.java | 48 +- .../FailedLocalLoginsNotInAllowedRange.java | 26 +- .../security/models/FileType.java | 34 +- .../models/FileUploadsNotInAllowedRange.java | 26 +- .../GcpCredentialsDetailsProperties.java | 120 +- .../models/GcpOrganizationalData.java | 13 +- .../models/GcpOrganizationalDataMember.java | 18 +- .../GcpOrganizationalDataOrganization.java | 24 +- .../security/models/GcpProjectDetails.java | 22 +- .../models/GcpProjectEnvironmentData.java | 44 +- .../GetSensitivitySettingsListResponse.java | 27 + .../GetSensitivitySettingsResponse.java | 47 + ...SensitivitySettingsResponseProperties.java | 146 + ...tingsResponsePropertiesMipInformation.java | 144 + ...llectionResponse.java => GitHubOwner.java} | 38 +- .../models/GitHubOwnerListResponse.java | 34 + .../models/GitHubOwnerProperties.java | 183 + .../security/models/GitHubOwners.java | 93 + .../security/models/GitHubRepos.java | 72 + .../security/models/GitHubRepository.java | 55 + .../models/GitHubRepositoryListResponse.java | 85 + .../models/GitHubRepositoryProperties.java | 251 + .../security/models/GitLabGroup.java | 55 + .../models/GitLabGroupListResponse.java | 34 + .../models/GitLabGroupProperties.java | 209 + .../security/models/GitLabGroups.java | 93 + .../security/models/GitLabProject.java | 55 + .../models/GitLabProjectListResponse.java | 85 + .../models/GitLabProjectProperties.java | 229 + .../security/models/GitLabProjects.java | 74 + .../security/models/GitLabSubgroups.java | 41 + .../models/GithubScopeEnvironmentData.java | 10 +- .../models/GitlabScopeEnvironmentData.java | 10 +- .../security/models/GovernanceAssignment.java | 187 +- .../GovernanceAssignmentAdditionalData.java | 22 +- .../models/GovernanceAssignments.java | 62 +- .../models/GovernanceAssignmentsList.java | 14 +- .../models/GovernanceEmailNotification.java | 20 +- .../security/models/GovernanceRule.java | 355 +- .../GovernanceRuleEmailNotification.java | 22 +- .../security/models/GovernanceRuleList.java | 14 +- .../models/GovernanceRuleMetadata.java | 18 +- .../models/GovernanceRuleOwnerSource.java | 18 +- .../models/GovernanceRuleOwnerSourceType.java | 18 +- .../GovernanceRuleSourceResourceType.java | 14 +- .../security/models/GovernanceRuleType.java | 18 +- .../security/models/GovernanceRules.java | 98 +- ...overnanceRulesOperationResultsHeaders.java | 12 +- ...vernanceRulesOperationResultsResponse.java | 16 +- .../models/HealthDataClassification.java | 28 +- .../security/models/HealthReport.java | 40 +- .../security/models/HealthReports.java | 34 +- .../security/models/HealthReportsList.java | 14 +- .../HttpC2DMessagesNotInAllowedRange.java | 26 +- ...pC2DRejectedMessagesNotInAllowedRange.java | 26 +- .../HttpD2CMessagesNotInAllowedRange.java | 26 +- .../HybridComputeProvisioningState.java | 22 +- .../HybridComputeSettingsProperties.java | 38 +- .../security/models/Identity.java | 18 +- .../security/models/ImplementationEffort.java | 22 +- .../security/models/InfoType.java | 107 + .../InformationProtectionAwsOffering.java | 18 +- ...ctionAwsOfferingInformationProtection.java | 14 +- .../models/InformationProtectionKeyword.java | 26 +- .../models/InformationProtectionPolicies.java | 30 +- .../models/InformationProtectionPolicy.java | 97 +- .../InformationProtectionPolicyList.java | 16 +- .../InformationProtectionPolicyName.java | 18 +- .../security/models/InformationType.java | 38 +- .../models/IngestionConnectionString.java | 54 - .../security/models/IngestionSetting.java | 142 - .../models/IngestionSettingToken.java | 25 - .../security/models/IngestionSettings.java | 180 - .../models/InheritFromParentState.java | 56 + .../security/models/Inherited.java | 56 + .../security/models/Intent.java | 70 +- .../models/IoTSecurityAggregatedAlert.java | 40 +- .../IoTSecurityAggregatedAlertList.java | 22 +- ...atedAlertPropertiesTopDevicesListItem.java | 16 +- .../IoTSecurityAggregatedRecommendation.java | 34 +- ...TSecurityAggregatedRecommendationList.java | 22 +- .../models/IoTSecurityAlertedDevice.java | 14 +- .../models/IoTSecurityDeviceAlert.java | 16 +- .../IoTSecurityDeviceRecommendation.java | 16 +- .../IoTSecuritySolutionAnalyticsModel.java | 24 +- ...IoTSecuritySolutionAnalyticsModelList.java | 10 +- ...ticsModelPropertiesDevicesMetricsItem.java | 22 +- .../models/IoTSecuritySolutionModel.java | 224 +- .../models/IoTSecuritySolutionsList.java | 21 +- .../security/models/IoTSeverityMetrics.java | 22 +- .../models/IotSecuritySolutionAnalytics.java | 28 +- .../security/models/IotSecuritySolutions.java | 50 +- ...itySolutionsAnalyticsAggregatedAlerts.java | 40 +- ...ritySolutionsAnalyticsRecommendations.java | 40 +- .../security/models/IsEnabled.java | 18 +- .../security/models/Issue.java | 46 +- .../models/JitNetworkAccessPolicies.java | 107 +- .../models/JitNetworkAccessPoliciesList.java | 16 +- .../models/JitNetworkAccessPolicy.java | 126 +- .../JitNetworkAccessPolicyInitiatePort.java | 28 +- ...JitNetworkAccessPolicyInitiateRequest.java | 28 +- ...orkAccessPolicyInitiateVirtualMachine.java | 30 +- .../JitNetworkAccessPolicyVirtualMachine.java | 34 +- .../models/JitNetworkAccessPortRule.java | 42 +- .../models/JitNetworkAccessRequest.java | 14 +- .../models/JitNetworkAccessRequestPort.java | 56 +- ...JitNetworkAccessRequestVirtualMachine.java | 30 +- .../resourcemanager/security/models/Kind.java | 14 +- .../security/models/KindAutoGenerated.java | 14 +- .../security/models/Label.java | 109 + .../security/models/ListCustomAlertRule.java | 19 +- .../security/models/LocalUserNotAllowed.java | 18 +- .../security/models/Location.java | 12 +- .../security/models/Locations.java | 16 +- .../models/LogAnalyticsIdentifier.java | 18 +- .../security/models/MdeOnboardingData.java | 16 +- .../models/MdeOnboardingDataList.java | 8 +- .../security/models/MdeOnboardings.java | 16 +- .../security/models/MinimalRiskLevel.java | 63 + .../security/models/MinimalSeverity.java | 22 +- .../security/models/MipIntegrationStatus.java | 63 + .../MqttC2DMessagesNotInAllowedRange.java | 26 +- ...tC2DRejectedMessagesNotInAllowedRange.java | 26 +- .../MqttD2CMessagesNotInAllowedRange.java | 26 +- .../security/models/NotificationsSource.java | 39 + .../models/NotificationsSourceAlert.java | 60 + .../models/NotificationsSourceAttackPath.java | 62 + .../security/models/OfferingType.java | 78 +- .../models/OnPremiseResourceDetails.java | 51 +- .../models/OnPremiseSqlResourceDetails.java | 46 +- .../security/models/OnboardingState.java | 69 + .../security/models/Operation.java | 12 +- .../security/models/OperationDisplay.java | 18 +- .../security/models/OperationList.java | 16 +- .../security/models/OperationResult.java | 22 +- .../models/OperationResultAutoGenerated.java | 8 +- .../security/models/OperationStatus.java | 24 +- .../models/OperationStatusAutoGenerated.java | 80 + .../models/OperationStatusResult.java | 78 + .../security/models/Operations.java | 16 +- .../security/models/Operator.java | 46 +- .../models/OrganizationMembershipType.java | 18 +- .../security/models/PathRecommendation.java | 46 +- .../security/models/PermissionProperty.java | 34 +- .../security/models/Pricing.java | 87 +- .../security/models/PricingList.java | 8 +- .../security/models/PricingTier.java | 19 +- .../security/models/Pricings.java | 129 +- .../security/models/ProcessNotAllowed.java | 18 +- .../security/models/PropertyType.java | 26 +- .../security/models/ProtectionMode.java | 22 +- .../security/models/Protocol.java | 22 +- .../security/models/ProvisioningState.java | 22 +- .../models/ProxyServerProperties.java | 14 +- .../security/models/PublisherInfo.java | 28 +- .../security/models/QueryCheck.java | 22 +- .../models/QueuePurgesNotInAllowedRange.java | 26 +- .../resourcemanager/security/models/Rank.java | 34 +- .../security/models/RecommendationAction.java | 22 +- .../models/RecommendationConfigStatus.java | 18 +- ...RecommendationConfigurationProperties.java | 32 +- .../security/models/RecommendationStatus.java | 26 +- .../security/models/RecommendationType.java | 90 +- .../RegulatoryComplianceAssessment.java | 28 +- .../RegulatoryComplianceAssessmentList.java | 22 +- .../RegulatoryComplianceAssessments.java | 34 +- .../models/RegulatoryComplianceControl.java | 22 +- .../RegulatoryComplianceControlList.java | 22 +- .../models/RegulatoryComplianceControls.java | 20 +- .../models/RegulatoryComplianceStandard.java | 22 +- .../RegulatoryComplianceStandardList.java | 22 +- .../models/RegulatoryComplianceStandards.java | 12 +- .../security/models/Remediation.java | 26 +- .../security/models/RemediationEta.java | 28 +- .../security/models/ReportedSeverity.java | 26 +- .../security/models/ResourceDetails.java | 13 +- .../models/ResourceDetailsAutoGenerated.java | 18 +- .../security/models/ResourceIdentifier.java | 13 +- .../models/ResourceIdentifierType.java | 18 +- .../security/models/ResourceIdentityType.java | 18 +- .../security/models/ResourceProviders.java | 57 + .../security/models/ResourceStatus.java | 26 +- .../models/ResourcesCoverageStatus.java | 61 + .../security/models/Roles.java | 53 - .../resourcemanager/security/models/Rule.java | 26 +- .../security/models/RuleCategory.java | 79 + .../security/models/RuleResults.java | 112 +- .../security/models/RuleResultsInput.java | 26 +- .../models/RuleResultsProperties.java | 14 +- .../security/models/RuleSeverity.java | 30 +- .../security/models/RuleState.java | 26 +- .../security/models/RuleStatus.java | 22 +- .../security/models/RuleType.java | 26 +- .../security/models/RulesResults.java | 8 +- .../security/models/RulesResultsInput.java | 26 +- .../resourcemanager/security/models/Scan.java | 14 +- .../security/models/ScanProperties.java | 70 +- .../security/models/ScanResult.java | 14 +- .../security/models/ScanResultProperties.java | 38 +- .../security/models/ScanResults.java | 8 +- .../security/models/ScanState.java | 26 +- .../security/models/ScanTriggerType.java | 18 +- .../security/models/ScanningMode.java | 14 +- .../security/models/Scans.java | 8 +- .../security/models/ScopeElement.java | 21 +- .../security/models/ScopeName.java | 53 - .../SecureScoreControlDefinitionItem.java | 22 +- .../SecureScoreControlDefinitionList.java | 14 +- .../SecureScoreControlDefinitionSource.java | 14 +- .../models/SecureScoreControlDefinitions.java | 12 +- .../models/SecureScoreControlDetails.java | 30 +- .../models/SecureScoreControlList.java | 14 +- .../SecureScoreControlScoreDetails.java | 24 +- .../security/models/SecureScoreControls.java | 28 +- .../security/models/SecureScoreItem.java | 22 +- .../security/models/SecureScores.java | 18 +- .../security/models/SecureScoresList.java | 14 +- .../security/models/SecurityAssessment.java | 36 +- .../models/SecurityAssessmentList.java | 14 +- ...SecurityAssessmentMetadataPartnerData.java | 36 +- ...etadataPropertiesResponsePublishDates.java | 29 +- .../SecurityAssessmentMetadataResponse.java | 190 +- ...ecurityAssessmentMetadataResponseList.java | 14 +- .../models/SecurityAssessmentPartnerData.java | 32 +- .../SecurityAssessmentPropertiesBase.java | 36 +- .../models/SecurityAssessmentResponse.java | 157 +- .../security/models/SecurityConnector.java | 187 +- ...ecurityConnectorApplicationOperations.java | 48 +- .../models/SecurityConnectorApplications.java | 16 +- .../security/models/SecurityConnectors.java | 50 +- .../models/SecurityConnectorsList.java | 21 +- .../security/models/SecurityContact.java | 118 +- .../security/models/SecurityContactList.java | 39 +- .../security/models/SecurityContactName.java | 48 + ...tyContactPropertiesAlertNotifications.java | 76 - ...yContactPropertiesNotificationsByRole.java | 28 +- .../security/models/SecurityContactRole.java | 63 + .../security/models/SecurityContacts.java | 36 +- .../security/models/SecurityFamily.java | 26 +- .../security/models/SecurityOperator.java | 14 +- .../security/models/SecurityOperatorList.java | 8 +- .../security/models/SecurityOperators.java | 24 +- .../security/models/SecuritySolution.java | 22 +- .../security/models/SecuritySolutionList.java | 16 +- .../models/SecuritySolutionStatus.java | 18 +- .../security/models/SecuritySolutions.java | 24 +- .../SecuritySolutionsReferenceData.java | 48 +- .../SecuritySolutionsReferenceDataList.java | 8 +- .../SecuritySolutionsReferenceDatas.java | 16 +- .../models/SecuritySubAssessment.java | 32 +- .../models/SecuritySubAssessmentList.java | 14 +- .../security/models/SecurityTask.java | 22 +- .../security/models/SecurityTaskList.java | 14 +- .../models/SecurityTaskParameters.java | 19 +- .../security/models/SensitivityLabel.java | 30 +- ...erations.java => SensitivitySettings.java} | 27 +- .../models/ServerVulnerabilityAssessment.java | 14 +- ...AssessmentPropertiesProvisioningState.java | 38 +- .../ServerVulnerabilityAssessments.java | 68 +- ...sessmentsAzureSettingSelectedProvider.java | 49 + .../ServerVulnerabilityAssessmentsList.java | 8 +- ...ServerVulnerabilityAssessmentsSetting.java | 49 + ...erVulnerabilityAssessmentsSettingKind.java | 50 + ...lnerabilityAssessmentsSettingKindName.java | 50 + ...erverVulnerabilityAssessmentsSettings.java | 112 + ...VulnerabilityAssessmentsSettingsList.java} | 30 +- .../models/ServerVulnerabilityProperties.java | 37 +- .../models/ServicePrincipalProperties.java | 26 +- .../security/models/Setting.java | 12 +- .../security/models/SettingKind.java | 22 +- .../security/models/SettingName.java | 29 +- .../models/SettingNameAutoGenerated.java | 69 + .../security/models/Settings.java | 24 +- .../security/models/SettingsList.java | 16 +- .../security/models/Severity.java | 22 +- .../security/models/SeverityEnum.java | 22 +- .../security/models/Software.java | 30 +- .../security/models/SoftwareInventories.java | 55 +- .../security/models/SoftwaresList.java | 16 +- .../security/models/Source.java | 22 +- .../security/models/SourceSystem.java | 30 +- .../security/models/SourceType.java | 53 + .../SqlServerVulnerabilityProperties.java | 14 +- ...lVulnerabilityAssessmentBaselineRules.java | 26 +- ...SqlVulnerabilityAssessmentScanResults.java | 16 +- .../SqlVulnerabilityAssessmentScans.java | 12 +- .../security/models/State.java | 26 +- .../security/models/Status.java | 18 +- .../security/models/StatusAutoGenerated.java | 55 +- .../security/models/StatusName.java | 22 +- .../security/models/StatusReason.java | 22 +- .../security/models/SubAssessmentStatus.java | 18 +- .../models/SubAssessmentStatusCode.java | 22 +- .../security/models/SubAssessments.java | 44 +- .../security/models/SubPlan.java | 18 +- .../security/models/SupportedCloudEnum.java | 18 +- .../models/SuppressionAlertsScope.java | 19 +- .../security/models/Tactics.java | 66 +- .../resourcemanager/security/models/Tags.java | 14 +- .../security/models/TagsResource.java | 14 +- .../models/TargetBranchConfiguration.java | 90 + .../security/models/TaskUpdateActionType.java | 30 +- .../security/models/Tasks.java | 96 +- .../security/models/Techniques.java | 462 +- .../security/models/Threats.java | 42 +- .../models/ThresholdCustomAlertRule.java | 24 +- .../models/TimeWindowCustomAlertRule.java | 31 +- .../security/models/Topologies.java | 44 +- .../security/models/TopologyList.java | 14 +- .../security/models/TopologyResource.java | 18 +- .../models/TopologySingleResource.java | 26 +- .../models/TopologySingleResourceChild.java | 12 +- .../models/TopologySingleResourceParent.java | 12 +- .../security/models/TrackedResource.java | 26 +- .../security/models/TransportProtocol.java | 18 +- .../models/TwinUpdatesNotInAllowedRange.java | 26 +- .../resourcemanager/security/models/Type.java | 18 +- ...authorizedOperationsNotInAllowedRange.java | 26 +- .../models/UnmaskedIpLoggingStatus.java | 18 +- .../models/UpdateIotSecuritySolutionData.java | 28 +- .../UpdateSensitivitySettingsRequest.java | 120 + .../UserDefinedResourcesProperties.java | 30 +- .../security/models/UserImpact.java | 22 +- .../security/models/UserRecommendation.java | 18 +- .../security/models/VaRule.java | 46 +- .../security/models/ValueType.java | 18 +- .../security/models/VendorReference.java | 14 +- .../security/models/VmRecommendation.java | 26 +- .../security/models/WorkspaceSetting.java | 86 +- .../security/models/WorkspaceSettingList.java | 21 +- .../security/models/WorkspaceSettings.java | 26 +- .../security/models/package-info.java | 4 +- .../security/package-info.java | 4 +- .../src/main/java/module-info.java | 10 +- .../proxy-config.json | 1 + .../reflect-config.json | 2856 ++++++++ ...ptiveApplicationControlsDeleteSamples.java | 19 +- ...AdaptiveApplicationControlsGetSamples.java | 19 +- ...daptiveApplicationControlsListSamples.java | 10 +- ...AdaptiveApplicationControlsPutSamples.java | 154 +- ...aptiveNetworkHardeningsEnforceSamples.java | 56 +- .../AdaptiveNetworkHardeningsGetSamples.java | 20 +- ...rdeningsListByExtendedResourceSamples.java | 16 +- ...AdvancedThreatProtectionCreateSamples.java | 20 +- .../AdvancedThreatProtectionGetSamples.java | 18 +- .../AlertsGetResourceGroupLevelSamples.java | 18 +- .../AlertsGetSubscriptionLevelSamples.java | 17 +- .../AlertsListByResourceGroupSamples.java | 9 +- ...ListResourceGroupLevelByRegionSamples.java | 9 +- .../security/generated/AlertsListSamples.java | 9 +- ...sListSubscriptionLevelByRegionSamples.java | 9 +- .../generated/AlertsSimulateSamples.java | 39 +- .../AlertsSuppressionRulesDeleteSamples.java | 14 +- .../AlertsSuppressionRulesGetSamples.java | 14 +- .../AlertsSuppressionRulesListSamples.java | 16 +- .../AlertsSuppressionRulesUpdateSamples.java | 53 +- ...ourceGroupLevelStateToActivateSamples.java | 18 +- ...sourceGroupLevelStateToDismissSamples.java | 18 +- ...rceGroupLevelStateToInProgressSamples.java | 18 +- ...sourceGroupLevelStateToResolveSamples.java | 18 +- ...bscriptionLevelStateToActivateSamples.java | 17 +- ...ubscriptionLevelStateToDismissSamples.java | 17 +- ...criptionLevelStateToInProgressSamples.java | 17 +- ...ubscriptionLevelStateToResolveSamples.java | 17 +- .../AllowedConnectionsGetSamples.java | 15 +- ...wedConnectionsListByHomeRegionSamples.java | 10 +- .../AllowedConnectionsListSamples.java | 14 +- .../generated/ApiCollectionGetSamples.java | 21 - .../generated/ApiCollectionListSamples.java | 21 - ...ApiCollectionOffboardingDeleteSamples.java | 23 - .../ApiCollectionOnboardingCreateSamples.java | 23 - ...GetByAzureApiManagementServiceSamples.java | 26 + ...istByAzureApiManagementServiceSamples.java | 26 + ...CollectionsListByResourceGroupSamples.java | 26 + .../generated/ApiCollectionsListSamples.java | 26 + ...sOffboardAzureApiManagementApiSamples.java | 26 + ...nsOnboardAzureApiManagementApiSamples.java | 26 + ...icationOperationCreateOrUpdateSamples.java | 29 +- .../ApplicationOperationDeleteSamples.java | 15 +- .../ApplicationOperationGetSamples.java | 19 +- .../generated/ApplicationsListSamples.java | 14 +- .../AssessmentsCreateOrUpdateSamples.java | 24 +- .../generated/AssessmentsDeleteSamples.java | 23 +- .../generated/AssessmentsGetSamples.java | 36 +- .../generated/AssessmentsListSamples.java | 15 +- ...tsMetadataCreateInSubscriptionSamples.java | 34 +- ...tsMetadataDeleteInSubscriptionSamples.java | 19 +- ...mentsMetadataGetInSubscriptionSamples.java | 19 +- .../AssessmentsMetadataGetSamples.java | 15 +- ...entsMetadataListBySubscriptionSamples.java | 14 +- .../AssessmentsMetadataListSamples.java | 10 +- ...AutoProvisioningSettingsCreateSamples.java | 14 +- .../AutoProvisioningSettingsGetSamples.java | 14 +- .../AutoProvisioningSettingsListSamples.java | 14 +- .../AutomationsCreateOrUpdateSamples.java | 167 +- .../generated/AutomationsDeleteSamples.java | 15 +- .../AutomationsGetByResourceGroupSamples.java | 16 +- ...AutomationsListByResourceGroupSamples.java | 10 +- .../generated/AutomationsListSamples.java | 14 +- .../generated/AutomationsUpdateSamples.java | 56 + .../generated/AutomationsValidateSamples.java | 74 +- .../AzureDevOpsOrgsCreateOrUpdateSamples.java | 33 + .../generated/AzureDevOpsOrgsGetSamples.java | 25 + .../AzureDevOpsOrgsListAvailableSamples.java | 25 + .../generated/AzureDevOpsOrgsListSamples.java | 24 + .../AzureDevOpsOrgsUpdateSamples.java | 36 + ...reDevOpsProjectsCreateOrUpdateSamples.java | 33 + .../AzureDevOpsProjectsGetSamples.java | 25 + .../AzureDevOpsProjectsListSamples.java | 25 + .../AzureDevOpsProjectsUpdateSamples.java | 35 + ...AzureDevOpsReposCreateOrUpdateSamples.java | 33 + .../generated/AzureDevOpsReposGetSamples.java | 25 + .../AzureDevOpsReposListSamples.java | 25 + .../AzureDevOpsReposUpdateSamples.java | 35 + .../ComplianceResultsGetSamples.java | 18 +- .../ComplianceResultsListSamples.java | 15 +- .../generated/CompliancesGetSamples.java | 16 +- .../generated/CompliancesListSamples.java | 15 +- .../ConnectorsCreateOrUpdateSamples.java | 99 +- .../generated/ConnectorsDeleteSamples.java | 14 +- .../generated/ConnectorsGetSamples.java | 14 +- .../generated/ConnectorsListSamples.java | 14 +- ...tomAssessmentAutomationsCreateSamples.java | 23 +- ...tomAssessmentAutomationsDeleteSamples.java | 16 +- ...tAutomationsGetByResourceGroupSamples.java | 16 +- ...AutomationsListByResourceGroupSamples.java | 15 +- ...ustomAssessmentAutomationsListSamples.java | 14 +- ...omEntityStoreAssignmentsCreateSamples.java | 14 +- ...omEntityStoreAssignmentsDeleteSamples.java | 16 +- ...eAssignmentsGetByResourceGroupSamples.java | 16 +- ...AssignmentsListByResourceGroupSamples.java | 15 +- ...stomEntityStoreAssignmentsListSamples.java | 14 +- .../DefenderForStorageCreateSamples.java | 33 + .../DefenderForStorageGetSamples.java | 29 + ...psConfigurationsCreateOrUpdateSamples.java | 73 + .../DevOpsConfigurationsDeleteSamples.java | 24 + .../DevOpsConfigurationsGetSamples.java | 25 + .../DevOpsConfigurationsListSamples.java | 24 + .../DevOpsConfigurationsUpdateSamples.java | 31 + .../DevOpsOperationResultsGetSamples.java | 40 + ...ceSecurityGroupsCreateOrUpdateSamples.java | 27 +- .../DeviceSecurityGroupsDeleteSamples.java | 19 +- .../DeviceSecurityGroupsGetSamples.java | 19 +- .../DeviceSecurityGroupsListSamples.java | 18 +- ...DiscoveredSecuritySolutionsGetSamples.java | 15 +- ...uritySolutionsListByHomeRegionSamples.java | 10 +- ...iscoveredSecuritySolutionsListSamples.java | 10 +- .../ExternalSecuritySolutionsGetSamples.java | 19 +- ...uritySolutionsListByHomeRegionSamples.java | 10 +- .../ExternalSecuritySolutionsListSamples.java | 14 +- .../generated/GitHubOwnersGetSamples.java | 25 + .../GitHubOwnersListAvailableSamples.java | 25 + .../generated/GitHubOwnersListSamples.java | 24 + .../generated/GitHubReposGetSamples.java | 25 + .../generated/GitHubReposListSamples.java | 25 + .../generated/GitLabGroupsGetSamples.java | 25 + .../GitLabGroupsListAvailableSamples.java | 25 + .../generated/GitLabGroupsListSamples.java | 24 + .../generated/GitLabProjectsGetSamples.java | 25 + .../generated/GitLabProjectsListSamples.java | 25 + .../generated/GitLabSubgroupsListSamples.java | 25 + ...nanceAssignmentsCreateOrUpdateSamples.java | 39 +- .../GovernanceAssignmentsDeleteSamples.java | 21 +- .../GovernanceAssignmentsGetSamples.java | 21 +- .../GovernanceAssignmentsListSamples.java | 18 +- .../GovernanceRulesCreateOrUpdateSamples.java | 138 +- .../GovernanceRulesDeleteSamples.java | 59 +- .../GovernanceRulesExecuteSamples.java | 62 +- .../generated/GovernanceRulesGetSamples.java | 59 +- .../generated/GovernanceRulesListSamples.java | 52 +- ...overnanceRulesOperationResultsSamples.java | 53 +- .../HealthReportOperationGetSamples.java | 25 - .../generated/HealthReportsGetSamples.java | 26 + .../generated/HealthReportsListSamples.java | 15 +- ...otectionPoliciesCreateOrUpdateSamples.java | 63 +- ...formationProtectionPoliciesGetSamples.java | 34 +- ...ormationProtectionPoliciesListSamples.java | 18 +- .../IngestionSettingsCreateSamples.java | 21 - .../IngestionSettingsDeleteSamples.java | 21 - .../IngestionSettingsGetSamples.java | 20 - ...nSettingsListConnectionStringsSamples.java | 21 - .../IngestionSettingsListSamples.java | 20 - .../IngestionSettingsListTokensSamples.java | 20 - ...otSecuritySolutionAnalyticsGetSamples.java | 9 +- ...tSecuritySolutionAnalyticsListSamples.java | 9 +- ...SecuritySolutionCreateOrUpdateSamples.java | 52 +- .../IotSecuritySolutionDeleteSamples.java | 15 +- ...ritySolutionGetByResourceGroupSamples.java | 15 +- ...itySolutionListByResourceGroupSamples.java | 34 +- .../IotSecuritySolutionListSamples.java | 29 +- .../IotSecuritySolutionUpdateSamples.java | 48 +- ...nalyticsAggregatedAlertDismissSamples.java | 22 +- ...onsAnalyticsAggregatedAlertGetSamples.java | 14 +- ...nsAnalyticsAggregatedAlertListSamples.java | 14 +- ...ionsAnalyticsRecommendationGetSamples.java | 14 +- ...onsAnalyticsRecommendationListSamples.java | 14 +- ...rkAccessPoliciesCreateOrUpdateSamples.java | 72 +- ...JitNetworkAccessPoliciesDeleteSamples.java | 15 +- .../JitNetworkAccessPoliciesGetSamples.java | 15 +- ...tNetworkAccessPoliciesInitiateSamples.java | 43 +- ...workAccessPoliciesListByRegionSamples.java | 10 +- ...esListByResourceGroupAndRegionSamples.java | 15 +- ...essPoliciesListByResourceGroupSamples.java | 14 +- .../JitNetworkAccessPoliciesListSamples.java | 14 +- .../generated/LocationsGetSamples.java | 10 +- .../generated/LocationsListSamples.java | 10 +- .../generated/MdeOnboardingsGetSamples.java | 10 +- .../generated/MdeOnboardingsListSamples.java | 10 +- .../generated/PricingsDeleteSamples.java | 26 + .../generated/PricingsGetSamples.java | 82 +- .../generated/PricingsListSamples.java | 45 +- .../generated/PricingsUpdateSamples.java | 77 +- ...latoryComplianceAssessmentsGetSamples.java | 16 +- ...atoryComplianceAssessmentsListSamples.java | 10 +- ...egulatoryComplianceControlsGetSamples.java | 10 +- ...gulatoryComplianceControlsListSamples.java | 10 +- ...gulatoryComplianceStandardsGetSamples.java | 10 +- ...ulatoryComplianceStandardsListSamples.java | 10 +- ...ProviderGetSensitivitySettingsSamples.java | 24 + ...viderUpdateSensitivitySettingsSamples.java | 35 + ...lDefinitionsListBySubscriptionSamples.java | 13 +- ...ureScoreControlDefinitionsListSamples.java | 9 +- ...ScoreControlsListBySecureScoreSamples.java | 21 +- .../SecureScoreControlsListSamples.java | 10 +- .../generated/SecureScoresGetSamples.java | 10 +- .../generated/SecureScoresListSamples.java | 10 +- ...icationOperationCreateOrUpdateSamples.java | 39 +- ...ctorApplicationOperationDeleteSamples.java | 19 +- ...nnectorApplicationOperationGetSamples.java | 23 +- ...urityConnectorApplicationsListSamples.java | 15 +- ...curityConnectorsCreateOrUpdateSamples.java | 35 +- .../SecurityConnectorsDeleteSamples.java | 15 +- ...tyConnectorsGetByResourceGroupSamples.java | 16 +- ...yConnectorsListByResourceGroupSamples.java | 14 +- .../SecurityConnectorsListSamples.java | 14 +- .../SecurityConnectorsUpdateSamples.java | 37 +- .../SecurityContactsCreateSamples.java | 37 +- .../SecurityContactsDeleteSamples.java | 14 +- .../generated/SecurityContactsGetSamples.java | 14 +- .../SecurityContactsListSamples.java | 10 +- ...ecurityOperatorsCreateOrUpdateSamples.java | 20 +- .../SecurityOperatorsDeleteSamples.java | 20 +- .../SecurityOperatorsGetSamples.java | 15 +- .../SecurityOperatorsListSamples.java | 10 +- .../SecuritySolutionsGetSamples.java | 19 +- .../SecuritySolutionsListSamples.java | 10 +- ...sReferenceDataListByHomeRegionSamples.java | 18 +- ...ritySolutionsReferenceDataListSamples.java | 9 +- .../SensitivitySettingsListSamples.java | 24 + ...bilityAssessmentCreateOrUpdateSamples.java | 15 +- ...rVulnerabilityAssessmentDeleteSamples.java | 14 +- ...rverVulnerabilityAssessmentGetSamples.java | 14 +- ...sessmentListByExtendedResourceSamples.java | 15 +- ...essmentsSettingsCreateOrUpdateSamples.java | 31 + ...ilityAssessmentsSettingsDeleteSamples.java | 27 + ...rabilityAssessmentsSettingsGetSamples.java | 28 + ...abilityAssessmentsSettingsListSamples.java | 24 + .../generated/SettingsGetSamples.java | 14 +- .../generated/SettingsListSamples.java | 10 +- .../generated/SettingsUpdateSamples.java | 18 +- .../SoftwareInventoriesGetSamples.java | 25 +- ...entoriesListByExtendedResourceSamples.java | 20 +- .../SoftwareInventoriesListSamples.java | 10 +- ...lityAssessmentBaselineRulesAddSamples.java | 47 +- ...entBaselineRulesCreateOrUpdateSamples.java | 41 +- ...yAssessmentBaselineRulesDeleteSamples.java | 21 +- ...lityAssessmentBaselineRulesGetSamples.java | 21 +- ...ityAssessmentBaselineRulesListSamples.java | 19 +- ...bilityAssessmentScanResultsGetSamples.java | 40 +- ...ilityAssessmentScanResultsListSamples.java | 38 +- ...ulnerabilityAssessmentScansGetSamples.java | 37 +- ...lnerabilityAssessmentScansListSamples.java | 19 +- .../generated/SubAssessmentsGetSamples.java | 21 +- .../SubAssessmentsListAllSamples.java | 15 +- .../generated/SubAssessmentsListSamples.java | 18 +- ...TasksGetResourceGroupLevelTaskSamples.java | 20 +- .../TasksGetSubscriptionLevelTaskSamples.java | 16 +- .../TasksListByHomeRegionSamples.java | 10 +- .../TasksListByResourceGroupSamples.java | 14 +- .../security/generated/TasksListSamples.java | 10 +- ...ateResourceGroupLevelTaskStateSamples.java | 24 +- ...dateSubscriptionLevelTaskStateSamples.java | 23 +- .../generated/TopologyGetSamples.java | 10 +- .../TopologyListByHomeRegionSamples.java | 14 +- .../generated/TopologyListSamples.java | 10 +- .../WorkspaceSettingsCreateSamples.java | 24 +- .../WorkspaceSettingsDeleteSamples.java | 14 +- .../WorkspaceSettingsGetSamples.java | 10 +- .../WorkspaceSettingsListSamples.java | 10 +- .../WorkspaceSettingsUpdateSamples.java | 24 +- ...adConnectivityStateAutoGeneratedTests.java | 14 +- .../AadExternalSecuritySolutionTests.java | 32 +- .../generated/AadSolutionPropertiesTests.java | 33 +- .../generated/ActionableRemediationTests.java | 55 + ...tiveConnectionsNotInAllowedRangeTests.java | 33 +- ...ptiveApplicationControlGroupDataTests.java | 179 +- ...tiveApplicationControlGroupInnerTests.java | 185 +- ...iveApplicationControlGroupsInnerTests.java | 155 +- ...veApplicationControlIssueSummaryTests.java | 19 +- ...eByResourceGroupWithResponseMockTests.java | 39 +- ...ationControlsGetWithResponseMockTests.java | 71 +- ...tionControlsListWithResponseMockTests.java | 48 +- ...ationControlsPutWithResponseMockTests.java | 112 +- ...veNetworkHardeningEnforceRequestTests.java | 49 +- .../AdaptiveNetworkHardeningInnerTests.java | 89 +- ...aptiveNetworkHardeningPropertiesTests.java | 92 +- ...tiveNetworkHardeningsEnforceMockTests.java | 60 +- ...orkHardeningsGetWithResponseMockTests.java | 52 +- ...eningsListByExtendedResourceMockTests.java | 56 +- .../AdaptiveNetworkHardeningsListTests.java | 139 +- .../generated/AdditionalDataTests.java | 4 +- .../AdditionalWorkspacesPropertiesTests.java | 21 +- ...vancedThreatProtectionPropertiesTests.java | 10 +- ...ncedThreatProtectionSettingInnerTests.java | 9 +- ...rotectionsCreateWithResponseMockTests.java | 37 +- ...atProtectionsGetWithResponseMockTests.java | 37 +- .../security/generated/AlertEntityTests.java | 12 +- ...lertPropertiesSupportingEvidenceTests.java | 11 +- ...imulatorBundlesRequestPropertiesTests.java | 16 +- .../AlertSimulatorRequestBodyTests.java | 17 +- .../AlertSimulatorRequestPropertiesTests.java | 13 +- .../AlertSyncSettingPropertiesTests.java | 4 +- .../generated/AlertSyncSettingsTests.java | 8 +- .../AlertsSuppressionRuleInnerTests.java | 61 +- .../AlertsSuppressionRulePropertiesTests.java | 52 +- ...ssionRulesDeleteWithResponseMockTests.java | 36 +- ...pressionRulesGetWithResponseMockTests.java | 46 +- .../AlertsSuppressionRulesListMockTests.java | 50 +- .../AlertsSuppressionRulesListTests.java | 96 +- ...ssionRulesUpdateWithResponseMockTests.java | 80 +- ...lStateToActivateWithResponseMockTests.java | 36 +- ...elStateToDismissWithResponseMockTests.java | 36 +- ...tateToInProgressWithResponseMockTests.java | 36 +- ...elStateToResolveWithResponseMockTests.java | 36 +- ...lStateToActivateWithResponseMockTests.java | 39 +- ...elStateToDismissWithResponseMockTests.java | 36 +- ...tateToInProgressWithResponseMockTests.java | 39 +- ...elStateToResolveWithResponseMockTests.java | 36 +- ...edConnectionsGetWithResponseMockTests.java | 42 +- ...dConnectionsListByHomeRegionMockTests.java | 38 +- .../AllowedConnectionsListMockTests.java | 38 +- .../AllowedConnectionsListTests.java | 8 +- .../AllowedConnectionsResourceInnerTests.java | 8 +- ...wedConnectionsResourcePropertiesTests.java | 8 +- .../AllowlistCustomAlertRuleTests.java | 18 +- ...AmqpC2DMessagesNotInAllowedRangeTests.java | 28 +- ...ejectedMessagesNotInAllowedRangeTests.java | 33 +- ...AmqpD2CMessagesNotInAllowedRangeTests.java | 32 +- .../generated/ApiCollectionInnerTests.java | 23 + .../generated/ApiCollectionListTests.java | 23 + ...nboardingsCreateWithResponseMockTests.java | 71 - .../ApiCollectionPropertiesTests.java | 33 +- .../ApiCollectionResponseInnerTests.java | 46 - .../ApiCollectionResponseListTests.java | 25 - ...anagementServiceWithResponseMockTests.java | 55 + ...piCollectionsGetWithResponseMockTests.java | 71 - ...tByAzureApiManagementServiceMockTests.java | 55 + ...llectionsListByResourceGroupMockTests.java | 55 + .../ApiCollectionsListMockTests.java | 41 +- ...piManagementApiWithResponseMockTests.java} | 45 +- ...OnboardAzureApiManagementApiMockTests.java | 54 + .../generated/ApplicationInnerTests.java | 25 +- ...nsCreateOrUpdateWithResponseMockTests.java | 56 +- ...OperationsDeleteWithResponseMockTests.java | 36 +- ...ionOperationsGetWithResponseMockTests.java | 41 +- .../generated/ApplicationPropertiesTests.java | 25 +- .../generated/ApplicationsListMockTests.java | 41 +- .../generated/ApplicationsListTests.java | 8 +- .../generated/AscLocationInnerTests.java | 11 +- .../generated/AscLocationListTests.java | 8 +- .../generated/AssessmentLinksTests.java | 4 +- ...eByResourceGroupWithResponseMockTests.java | 39 +- ...teInSubscriptionWithResponseMockTests.java | 37 +- .../AtaExternalSecuritySolutionTests.java | 35 +- .../generated/AtaSolutionPropertiesTests.java | 33 +- .../AuthenticationDetailsPropertiesTests.java | 8 +- .../AutoProvisioningSettingInnerTests.java | 14 +- .../AutoProvisioningSettingListTests.java | 19 +- ...utoProvisioningSettingPropertiesTests.java | 12 +- ...ngSettingsCreateWithResponseMockTests.java | 37 +- ...oningSettingsGetWithResponseMockTests.java | 40 +- ...AutoProvisioningSettingsListMockTests.java | 39 +- .../AutomationActionEventHubTests.java | 24 +- .../AutomationActionLogicAppTests.java | 19 +- .../generated/AutomationActionTests.java | 4 +- .../AutomationActionWorkspaceTests.java | 11 +- .../generated/AutomationInnerTests.java | 77 +- .../generated/AutomationListTests.java | 136 +- .../generated/AutomationPropertiesTests.java | 98 +- .../generated/AutomationRuleSetTests.java | 37 +- .../generated/AutomationScopeTests.java | 16 +- .../generated/AutomationSourceTests.java | 52 +- .../AutomationTriggeringRuleTests.java | 32 +- .../generated/AutomationUpdateModelTests.java | 71 + .../AutomationValidationStatusInnerTests.java | 17 +- ...nsCreateOrUpdateWithResponseMockTests.java | 81 +- ...eByResourceGroupWithResponseMockTests.java | 41 +- ...tByResourceGroupWithResponseMockTests.java | 53 +- ...tomationsListByResourceGroupMockTests.java | 47 +- .../generated/AutomationsListMockTests.java | 45 +- ...omationsValidateWithResponseMockTests.java | 67 +- ...eAuthenticationDetailsPropertiesTests.java | 21 +- .../generated/AwsEnvironmentDataTests.java | 20 +- .../AwsOrganizationalDataMasterTests.java | 22 +- .../AwsOrganizationalDataMemberTests.java | 13 +- .../generated/AwsOrganizationalDataTests.java | 5 +- .../generated/AzureDevOpsOrgInnerTests.java | 74 + .../AzureDevOpsOrgListResponseInnerTests.java | 96 + .../AzureDevOpsOrgPropertiesTests.java | 67 + ...zureDevOpsOrgsCreateOrUpdateMockTests.java | 94 + ...ureDevOpsOrgsGetWithResponseMockTests.java | 76 + ...rgsListAvailableWithResponseMockTests.java | 68 + .../AzureDevOpsOrgsListMockTests.java | 78 + .../AzureDevOpsProjectInnerTests.java | 79 + .../AzureDevOpsProjectListResponseTests.java | 99 + .../AzureDevOpsProjectPropertiesTests.java | 73 + ...DevOpsProjectsCreateOrUpdateMockTests.java | 93 + ...evOpsProjectsGetWithResponseMockTests.java | 77 + .../AzureDevOpsProjectsListMockTests.java | 79 + ...ureDevOpsReposCreateOrUpdateMockTests.java | 100 + ...reDevOpsReposGetWithResponseMockTests.java | 78 + .../AzureDevOpsReposListMockTests.java | 80 + .../AzureDevOpsRepositoryInnerTests.java | 76 + ...zureDevOpsRepositoryListResponseTests.java | 108 + .../AzureDevOpsRepositoryPropertiesTests.java | 74 + .../AzureDevOpsScopeEnvironmentDataTests.java | 6 +- .../generated/AzureResourceDetailsTests.java | 4 +- .../AzureResourceIdentifierTests.java | 5 +- .../generated/AzureResourceLinkTests.java | 4 +- .../generated/AzureServersSettingTests.java | 30 + .../AzureTrackedResourceLocationTests.java | 10 +- .../BaselineAdjustedResultTests.java | 61 +- .../security/generated/BaselineTests.java | 28 +- .../generated/BenchmarkReferenceTests.java | 15 +- .../generated/BuiltInInfoTypeTests.java | 32 + .../generated/CategoryConfigurationTests.java | 30 + .../CefExternalSecuritySolutionTests.java | 46 +- .../generated/CefSolutionPropertiesTests.java | 43 +- .../generated/CloudOfferingTests.java | 6 +- .../generated/ComplianceInnerTests.java | 8 +- .../generated/ComplianceListTests.java | 19 +- .../generated/CompliancePropertiesTests.java | 8 +- .../generated/ComplianceResultInnerTests.java | 8 +- .../generated/ComplianceResultListTests.java | 13 +- .../ComplianceResultPropertiesTests.java | 4 +- ...lianceResultsGetWithResponseMockTests.java | 38 +- .../ComplianceResultsListMockTests.java | 38 +- .../generated/ComplianceSegmentTests.java | 5 +- .../CompliancesGetWithResponseMockTests.java | 38 +- .../generated/CompliancesListMockTests.java | 37 +- .../generated/ConnectableResourceTests.java | 8 +- .../generated/ConnectedResourceTests.java | 7 +- .../generated/ConnectedWorkspaceTests.java | 9 +- .../ConnectionFromIpNotAllowedTests.java | 22 +- .../ConnectionStringsInnerTests.java | 29 - .../ConnectionToIpNotAllowedTests.java | 18 +- .../generated/ConnectorSettingInnerTests.java | 42 - .../generated/ConnectorSettingListTests.java | 35 - ...rsCreateOrUpdateWithResponseMockTests.java | 81 - ...ConnectorsDeleteWithResponseMockTests.java | 36 +- .../ConnectorsGetWithResponseMockTests.java | 70 - .../generated/ConnectorsListMockTests.java | 70 - ...rRegistryVulnerabilityPropertiesTests.java | 8 +- ...AwsOfferingNativeCloudConnectionTests.java | 13 +- .../CspmMonitorAwsOfferingTests.java | 18 +- .../CspmMonitorAzureDevOpsOfferingTests.java | 5 +- ...GcpOfferingNativeCloudConnectionTests.java | 21 +- .../CspmMonitorGcpOfferingTests.java | 25 +- .../CspmMonitorGitLabOfferingTests.java | 5 +- .../CspmMonitorGithubOfferingTests.java | 5 +- .../generated/CustomAlertRuleTests.java | 14 +- ...smentAutomationRequestPropertiesTests.java | 44 +- ...ustomAssessmentAutomationRequestTests.java | 40 +- ...eByResourceGroupWithResponseMockTests.java | 39 +- ...CustomEntityStoreAssignmentInnerTests.java | 22 +- ...mEntityStoreAssignmentPropertiesTests.java | 19 +- ...StoreAssignmentRequestPropertiesTests.java | 14 +- ...stomEntityStoreAssignmentRequestTests.java | 12 +- ...ssignmentsCreateWithResponseMockTests.java | 46 +- ...eByResourceGroupWithResponseMockTests.java | 39 +- ...tByResourceGroupWithResponseMockTests.java | 44 +- ...signmentsListByResourceGroupMockTests.java | 41 +- ...omEntityStoreAssignmentsListMockTests.java | 41 +- ...EntityStoreAssignmentsListResultTests.java | 16 +- .../security/generated/CveTests.java | 2 +- .../security/generated/CvssTests.java | 2 +- .../DataExportSettingPropertiesTests.java | 4 +- .../generated/DataExportSettingsTests.java | 8 +- ...nderCspmAwsOfferingCiemDiscoveryTests.java | 25 + .../DefenderCspmAwsOfferingCiemOidcTests.java | 29 + .../DefenderCspmAwsOfferingCiemTests.java | 35 + ...OfferingDataSensitivityDiscoveryTests.java | 17 +- ...nderCspmAwsOfferingDatabasesDspmTests.java | 17 +- ...cContainersAgentlessDiscoveryK8STests.java | 30 + ...ringMdcContainersImageAssessmentTests.java | 29 + .../DefenderCspmAwsOfferingTests.java | 83 +- ...sOfferingVmScannersConfigurationTests.java | 26 +- ...efenderCspmAwsOfferingVmScannersTests.java | 38 +- ...nderCspmGcpOfferingCiemDiscoveryTests.java | 32 + ...OfferingDataSensitivityDiscoveryTests.java | 32 + ...cContainersAgentlessDiscoveryK8STests.java | 33 + ...ringMdcContainersImageAssessmentTests.java | 32 + .../DefenderCspmGcpOfferingTests.java | 78 +- ...pOfferingVmScannersConfigurationTests.java | 46 + ...efenderCspmGcpOfferingVmScannersTests.java | 49 + ...ArcAutoProvisioningConfigurationTests.java | 24 +- ...esAwsOfferingArcAutoProvisioningTests.java | 32 +- ...atabasesAwsOfferingDatabasesDspmTests.java | 13 +- ...efenderFoDatabasesAwsOfferingRdsTests.java | 17 +- .../DefenderFoDatabasesAwsOfferingTests.java | 55 +- ...rsAwsOfferingCloudWatchToKinesisTests.java | 13 +- ...ainerVulnerabilityAssessmentTaskTests.java | 21 +- ...ContainerVulnerabilityAssessmentTests.java | 19 +- ...ContainersAwsOfferingKinesisToS3Tests.java | 13 +- ...AwsOfferingKubernetesScubaReaderTests.java | 13 +- ...nersAwsOfferingKubernetesServiceTests.java | 13 +- ...cContainersAgentlessDiscoveryK8STests.java | 31 + ...ringMdcContainersImageAssessmentTests.java | 31 + ...DefenderForContainersAwsOfferingTests.java | 95 +- ...ataPipelineNativeCloudConnectionTests.java | 27 +- ...cContainersAgentlessDiscoveryK8STests.java | 34 + ...ringMdcContainersImageAssessmentTests.java | 34 + ...GcpOfferingNativeCloudConnectionTests.java | 23 +- ...DefenderForContainersGcpOfferingTests.java | 78 +- ...ArcAutoProvisioningConfigurationTests.java | 26 +- ...esGcpOfferingArcAutoProvisioningTests.java | 31 +- ...rForDatabasesArcAutoProvisioningTests.java | 29 +- .../DefenderForDatabasesGcpOfferingTests.java | 50 +- ...nderForDevOpsAzureDevOpsOfferingTests.java | 7 +- .../DefenderForDevOpsGitLabOfferingTests.java | 5 +- .../DefenderForDevOpsGithubOfferingTests.java | 5 +- ...ArcAutoProvisioningConfigurationTests.java | 24 +- ...rsAwsOfferingArcAutoProvisioningTests.java | 32 +- ...ersAwsOfferingDefenderForServersTests.java | 14 +- ...rsAwsOfferingMdeAutoProvisioningTests.java | 9 +- ...nderForServersAwsOfferingSubPlanTests.java | 4 +- .../DefenderForServersAwsOfferingTests.java | 99 +- ...gVaAutoProvisioningConfigurationTests.java | 17 +- ...ersAwsOfferingVaAutoProvisioningTests.java | 17 +- ...sOfferingVmScannersConfigurationTests.java | 34 +- ...rForServersAwsOfferingVmScannersTests.java | 30 +- ...ArcAutoProvisioningConfigurationTests.java | 24 +- ...rsGcpOfferingArcAutoProvisioningTests.java | 27 +- ...ersGcpOfferingDefenderForServersTests.java | 21 +- ...rsGcpOfferingMdeAutoProvisioningTests.java | 13 +- ...nderForServersGcpOfferingSubPlanTests.java | 10 +- .../DefenderForServersGcpOfferingTests.java | 99 +- ...gVaAutoProvisioningConfigurationTests.java | 18 +- ...ersGcpOfferingVaAutoProvisioningTests.java | 13 +- ...pOfferingVmScannersConfigurationTests.java | 22 +- ...rForServersGcpOfferingVmScannersTests.java | 28 +- .../DenylistCustomAlertRuleTests.java | 22 +- .../DevOpsConfigurationsDeleteMockTests.java | 51 + ...rationResultsGetWithResponseMockTests.java | 76 + .../DeviceSecurityGroupInnerTests.java | 96 +- .../DeviceSecurityGroupListTests.java | 121 +- .../DeviceSecurityGroupPropertiesTests.java | 94 +- ...psCreateOrUpdateWithResponseMockTests.java | 85 +- ...eByResourceGroupWithResponseMockTests.java | 39 +- ...ecurityGroupsGetWithResponseMockTests.java | 54 +- .../DeviceSecurityGroupsListMockTests.java | 54 +- ...ctMethodInvokesNotInAllowedRangeTests.java | 32 +- .../DiscoveredSecuritySolutionInnerTests.java | 32 +- .../DiscoveredSecuritySolutionListTests.java | 52 +- ...overedSecuritySolutionPropertiesTests.java | 30 +- ...ritySolutionsGetWithResponseMockTests.java | 54 +- ...itySolutionsListByHomeRegionMockTests.java | 51 +- ...coveredSecuritySolutionsListMockTests.java | 43 +- .../EffectiveNetworkSecurityGroupsTests.java | 23 +- .../generated/EnvironmentDataTests.java | 4 +- .../generated/EnvironmentDetailsTests.java | 38 +- .../security/generated/EtagTests.java | 8 +- .../ExecuteGovernanceRuleParamsTests.java | 4 +- .../ExternalSecuritySolutionInnerTests.java | 8 +- .../ExternalSecuritySolutionListTests.java | 13 +- ...ternalSecuritySolutionPropertiesTests.java | 30 +- ...ritySolutionsGetWithResponseMockTests.java | 41 +- ...itySolutionsListByHomeRegionMockTests.java | 38 +- ...xternalSecuritySolutionsListMockTests.java | 38 +- ...iledLocalLoginsNotInAllowedRangeTests.java | 28 +- .../FileUploadsNotInAllowedRangeTests.java | 32 +- .../GcpOrganizationalDataMemberTests.java | 22 +- ...cpOrganizationalDataOrganizationTests.java | 28 +- .../generated/GcpOrganizationalDataTests.java | 5 +- .../generated/GcpProjectDetailsTests.java | 19 +- .../GcpProjectEnvironmentDataTests.java | 26 +- ...itivitySettingsListResponseInnerTests.java | 72 + ...SensitivitySettingsResponseInnerTests.java | 86 + ...ResponsePropertiesMipInformationTests.java | 74 + ...tivitySettingsResponsePropertiesTests.java | 92 + .../generated/GitHubOwnerInnerTests.java | 33 + .../GitHubOwnerListResponseInnerTests.java | 49 + .../generated/GitHubOwnerPropertiesTests.java | 32 + .../GitHubOwnersGetWithResponseMockTests.java | 59 + ...ersListAvailableWithResponseMockTests.java | 61 + .../generated/GitHubOwnersListMockTests.java | 62 + .../GitHubReposGetWithResponseMockTests.java | 61 + .../generated/GitHubReposListMockTests.java | 62 + .../generated/GitHubRepositoryInnerTests.java | 35 + .../GitHubRepositoryListResponseTests.java | 56 + .../GitHubRepositoryPropertiesTests.java | 34 + .../generated/GitLabGroupInnerTests.java | 33 + .../GitLabGroupListResponseInnerTests.java | 41 + .../generated/GitLabGroupPropertiesTests.java | 32 + .../GitLabGroupsGetWithResponseMockTests.java | 59 + ...upsListAvailableWithResponseMockTests.java | 61 + .../generated/GitLabGroupsListMockTests.java | 62 + .../generated/GitLabProjectInnerTests.java | 33 + .../GitLabProjectListResponseTests.java | 50 + .../GitLabProjectPropertiesTests.java | 32 + ...itLabProjectsGetWithResponseMockTests.java | 60 + .../GitLabProjectsListMockTests.java | 62 + ...LabSubgroupsListWithResponseMockTests.java | 63 + .../GithubScopeEnvironmentDataTests.java | 4 +- .../GitlabScopeEnvironmentDataTests.java | 4 +- ...vernanceAssignmentAdditionalDataTests.java | 24 +- .../GovernanceAssignmentInnerTests.java | 67 +- .../GovernanceAssignmentPropertiesTests.java | 75 +- ...tsCreateOrUpdateWithResponseMockTests.java | 84 +- ...ssignmentsDeleteWithResponseMockTests.java | 36 +- ...ceAssignmentsGetWithResponseMockTests.java | 56 +- .../GovernanceAssignmentsListMockTests.java | 69 +- .../GovernanceAssignmentsListTests.java | 8 +- .../GovernanceEmailNotificationTests.java | 13 +- .../GovernanceRuleEmailNotificationTests.java | 17 +- .../generated/GovernanceRuleInnerTests.java | 74 +- .../generated/GovernanceRuleListTests.java | 8 +- .../GovernanceRuleMetadataTests.java | 8 +- .../GovernanceRuleOwnerSourceTests.java | 18 +- .../GovernanceRulePropertiesTests.java | 77 +- ...esCreateOrUpdateWithResponseMockTests.java | 91 +- .../GovernanceRulesDeleteMockTests.java | 36 +- ...vernanceRulesGetWithResponseMockTests.java | 56 +- .../GovernanceRulesListMockTests.java | 69 +- ...OperationResultsWithResponseMockTests.java | 39 +- .../HealthDataClassificationTests.java | 25 +- .../generated/HealthReportsListTests.java | 25 - ...HttpC2DMessagesNotInAllowedRangeTests.java | 33 +- ...ejectedMessagesNotInAllowedRangeTests.java | 29 +- ...HttpD2CMessagesNotInAllowedRangeTests.java | 28 +- .../security/generated/IdentityTests.java | 7 +- .../security/generated/InfoTypeTests.java | 33 + ...AwsOfferingInformationProtectionTests.java | 13 +- ...InformationProtectionAwsOfferingTests.java | 18 +- .../InformationProtectionKeywordTests.java | 24 +- ...esCreateOrUpdateWithResponseMockTests.java | 84 - ...ctionPoliciesGetWithResponseMockTests.java | 68 - ...mationProtectionPoliciesListMockTests.java | 65 - .../InformationProtectionPolicyListTests.java | 46 - .../IngestionConnectionStringTests.java | 24 - .../generated/IngestionSettingInnerTests.java | 24 - .../generated/IngestionSettingListTests.java | 25 - ...onnectionStringsWithResponseMockTests.java | 67 - .../IoTSecurityAggregatedAlertInnerTests.java | 17 +- .../IoTSecurityAggregatedAlertListTests.java | 24 +- ...ecurityAggregatedAlertPropertiesTests.java | 8 +- ...lertPropertiesTopDevicesListItemTests.java | 12 +- ...ityAggregatedRecommendationInnerTests.java | 32 +- ...rityAggregatedRecommendationListTests.java | 46 +- ...gregatedRecommendationPropertiesTests.java | 16 +- .../IoTSecurityAlertedDeviceTests.java | 5 +- .../IoTSecurityDeviceAlertTests.java | 8 +- .../IoTSecurityDeviceRecommendationTests.java | 8 +- ...uritySolutionAnalyticsModelInnerTests.java | 31 +- ...ySolutionAnalyticsModelListInnerTests.java | 31 +- ...odelPropertiesDevicesMetricsItemTests.java | 40 +- ...SolutionAnalyticsModelPropertiesTests.java | 34 +- .../IoTSecuritySolutionModelInnerTests.java | 138 +- .../IoTSecuritySolutionPropertiesTests.java | 165 +- .../IoTSecuritySolutionsListTests.java | 184 +- .../generated/IoTSeverityMetricsTests.java | 26 +- ...tionAnalyticsGetWithResponseMockTests.java | 41 +- ...ionAnalyticsListWithResponseMockTests.java | 41 +- ...tedAlertsDismissWithResponseMockTests.java | 39 +- ...regatedAlertsGetWithResponseMockTests.java | 43 +- ...nalyticsAggregatedAlertsListMockTests.java | 41 +- ...commendationsGetWithResponseMockTests.java | 44 +- ...AnalyticsRecommendationsListMockTests.java | 44 +- ...nsCreateOrUpdateWithResponseMockTests.java | 126 +- ...eByResourceGroupWithResponseMockTests.java | 39 +- ...tByResourceGroupWithResponseMockTests.java | 69 +- ...SolutionsListByResourceGroupMockTests.java | 64 +- .../IotSecuritySolutionsListMockTests.java | 64 +- ...esCreateOrUpdateWithResponseMockTests.java | 80 +- ...ssPoliciesDeleteWithResponseMockTests.java | 39 +- ...ccessPoliciesGetWithResponseMockTests.java | 54 +- ...PoliciesInitiateWithResponseMockTests.java | 108 +- ...rkAccessPoliciesListByRegionMockTests.java | 53 +- ...ListByResourceGroupAndRegionMockTests.java | 55 +- ...sPoliciesListByResourceGroupMockTests.java | 56 +- ...JitNetworkAccessPoliciesListMockTests.java | 54 +- .../JitNetworkAccessPoliciesListTests.java | 166 +- ...tNetworkAccessPolicyInitiatePortTests.java | 27 +- ...tworkAccessPolicyInitiateRequestTests.java | 73 +- ...cessPolicyInitiateVirtualMachineTests.java | 43 +- .../JitNetworkAccessPolicyInnerTests.java | 230 +- ...JitNetworkAccessPolicyPropertiesTests.java | 209 +- ...etworkAccessPolicyVirtualMachineTests.java | 79 +- .../JitNetworkAccessPortRuleTests.java | 39 +- .../JitNetworkAccessRequestInnerTests.java | 70 +- .../JitNetworkAccessRequestPortTests.java | 50 +- ...tworkAccessRequestVirtualMachineTests.java | 90 +- .../generated/KindAutoGeneratedTests.java | 9 +- .../security/generated/LabelTests.java | 32 + .../generated/ListCustomAlertRuleTests.java | 14 +- .../generated/LocalUserNotAllowedTests.java | 22 +- .../security/generated/LocationTests.java | 2 +- .../LocationsGetWithResponseMockTests.java | 37 +- .../generated/LocationsListMockTests.java | 34 +- .../LogAnalyticsIdentifierTests.java | 8 +- .../MdeOnboardingDataInnerTests.java | 6 +- .../MdeOnboardingDataListInnerTests.java | 16 +- ...deOnboardingsGetWithResponseMockTests.java | 40 +- ...eOnboardingsListWithResponseMockTests.java | 41 +- ...MqttC2DMessagesNotInAllowedRangeTests.java | 32 +- ...ejectedMessagesNotInAllowedRangeTests.java | 29 +- ...MqttD2CMessagesNotInAllowedRangeTests.java | 33 +- .../NotificationsSourceAlertTests.java | 26 + .../NotificationsSourceAttackPathTests.java | 28 + .../generated/NotificationsSourceTests.java | 22 + .../OnPremiseResourceDetailsTests.java | 32 +- .../OnPremiseSqlResourceDetailsTests.java | 43 +- .../generated/OnUploadPropertiesTests.java | 27 + .../generated/OperationDisplayTests.java | 8 +- .../generated/OperationInnerTests.java | 8 +- .../generated/OperationListTests.java | 18 +- ...perationResultAutoGeneratedInnerTests.java | 4 +- .../OperationStatusResultInnerTests.java | 109 + .../generated/PathRecommendationTests.java | 91 +- .../security/generated/PricingInnerTests.java | 61 - .../generated/PricingListInnerTests.java | 61 +- ...ByResourceGroupWithResponseMockTests.java} | 38 +- .../PricingsGetWithResponseMockTests.java | 68 - .../PricingsListWithResponseMockTests.java | 50 +- .../PricingsUpdateWithResponseMockTests.java | 80 - .../generated/ProcessNotAllowedTests.java | 16 +- .../generated/ProtectionModeTests.java | 19 +- .../generated/ProxyServerPropertiesTests.java | 14 +- .../generated/PublisherInfoTests.java | 32 +- .../security/generated/QueryCheckTests.java | 34 +- .../QueuePurgesNotInAllowedRangeTests.java | 28 +- ...mendationConfigurationPropertiesTests.java | 23 +- ...ulatoryComplianceAssessmentInnerTests.java | 14 +- ...gulatoryComplianceAssessmentListTests.java | 24 +- ...ryComplianceAssessmentPropertiesTests.java | 16 +- ...ceAssessmentsGetWithResponseMockTests.java | 40 +- ...oryComplianceAssessmentsListMockTests.java | 39 +- ...RegulatoryComplianceControlInnerTests.java | 14 +- .../RegulatoryComplianceControlListTests.java | 20 +- ...atoryComplianceControlPropertiesTests.java | 12 +- ...ianceControlsGetWithResponseMockTests.java | 42 +- ...latoryComplianceControlsListMockTests.java | 41 +- ...egulatoryComplianceStandardInnerTests.java | 14 +- ...RegulatoryComplianceStandardListTests.java | 22 +- ...toryComplianceStandardPropertiesTests.java | 16 +- ...anceStandardsGetWithResponseMockTests.java | 42 +- ...atoryComplianceStandardsListMockTests.java | 39 +- .../generated/RemediationEtaTests.java | 20 +- .../security/generated/RemediationTests.java | 33 +- .../ResourceDetailsAutoGeneratedTests.java | 13 +- .../generated/ResourceDetailsTests.java | 4 +- .../generated/ResourceIdentifierTests.java | 4 +- ...sitivitySettingsWithResponseMockTests.java | 77 + ...sitivitySettingsWithResponseMockTests.java | 85 + .../generated/RuleResultsInnerTests.java | 19 +- .../generated/RuleResultsInputTests.java | 22 +- .../generated/RuleResultsPropertiesTests.java | 17 +- .../security/generated/RuleTests.java | 30 +- .../generated/RulesResultsInnerTests.java | 29 +- .../generated/RulesResultsInputTests.java | 39 +- .../security/generated/ScanInnerTests.java | 94 +- .../generated/ScanPropertiesTests.java | 88 +- .../generated/ScanResultInnerTests.java | 153 +- .../generated/ScanResultPropertiesTests.java | 182 +- .../generated/ScanResultsInnerTests.java | 194 +- .../security/generated/ScansInnerTests.java | 121 +- .../security/generated/ScopeElementTests.java | 15 +- .../security/generated/ScoreDetailsTests.java | 7 +- ...eScoreControlDefinitionItemInnerTests.java | 8 +- ...eControlDefinitionItemPropertiesTests.java | 8 +- ...SecureScoreControlDefinitionListTests.java | 8 +- ...cureScoreControlDefinitionSourceTests.java | 12 +- ...efinitionsListBySubscriptionMockTests.java | 38 +- ...eScoreControlDefinitionsListMockTests.java | 38 +- .../SecureScoreControlDetailsInnerTests.java | 12 +- .../SecureScoreControlListTests.java | 8 +- ...ureScoreControlScoreDetailsInnerTests.java | 12 +- ...oreControlsListBySecureScoreMockTests.java | 40 +- .../SecureScoreControlsListMockTests.java | 38 +- .../generated/SecureScoreItemInnerTests.java | 8 +- .../SecureScoreItemPropertiesTests.java | 8 +- .../SecureScoresGetWithResponseMockTests.java | 38 +- .../generated/SecureScoresListMockTests.java | 34 +- .../generated/SecureScoresListTests.java | 8 +- .../SecurityAssessmentListTests.java | 25 - ...taPropertiesResponsePublishDatesTests.java | 18 +- ...tyAssessmentMetadataResponseListTests.java | 25 - ...nsCreateOrUpdateWithResponseMockTests.java | 58 +- ...OperationsDeleteWithResponseMockTests.java | 39 +- ...ionOperationsGetWithResponseMockTests.java | 44 +- ...ityConnectorApplicationsListMockTests.java | 51 +- .../SecurityConnectorInnerTests.java | 35 +- .../SecurityConnectorPropertiesTests.java | 25 +- ...rsCreateOrUpdateWithResponseMockTests.java | 60 +- ...eByResourceGroupWithResponseMockTests.java | 39 +- ...tByResourceGroupWithResponseMockTests.java | 54 +- ...onnectorsListByResourceGroupMockTests.java | 51 +- .../SecurityConnectorsListMockTests.java | 41 +- .../SecurityConnectorsListTests.java | 69 +- .../generated/SecurityContactInnerTests.java | 47 +- .../generated/SecurityContactListTests.java | 43 +- ...tactPropertiesAlertNotificationsTests.java | 34 - ...actPropertiesNotificationsByRoleTests.java | 21 +- .../SecurityContactPropertiesTests.java | 53 +- ...tyContactsCreateWithResponseMockTests.java | 69 +- ...tyContactsDeleteWithResponseMockTests.java | 37 +- ...urityContactsGetWithResponseMockTests.java | 56 +- .../SecurityContactsListMockTests.java | 47 +- .../generated/SecurityOperatorInnerTests.java | 12 +- .../SecurityOperatorListInnerTests.java | 19 +- ...rsCreateOrUpdateWithResponseMockTests.java | 40 +- ...eByResourceGroupWithResponseMockTests.java | 39 +- ...rityOperatorsGetWithResponseMockTests.java | 37 +- ...ityOperatorsListWithResponseMockTests.java | 44 +- .../generated/SecuritySolutionInnerTests.java | 25 +- .../generated/SecuritySolutionListTests.java | 54 +- .../SecuritySolutionPropertiesTests.java | 32 +- ...ritySolutionsGetWithResponseMockTests.java | 46 +- .../SecuritySolutionsListMockTests.java | 37 +- ...ySolutionsReferenceDataListInnerTests.java | 53 +- ...SolutionsReferenceDataPropertiesTests.java | 49 +- .../SecuritySolutionsReferenceDataTests.java | 49 +- ...ListByHomeRegionWithResponseMockTests.java | 50 +- ...ferenceDatasListWithResponseMockTests.java | 47 +- .../SecuritySubAssessmentListTests.java | 25 - .../generated/SecurityTaskInnerTests.java | 15 +- .../generated/SecurityTaskListTests.java | 8 +- .../SecurityTaskParametersTests.java | 12 +- .../SecurityTaskPropertiesTests.java | 15 +- .../generated/SensitivityLabelTests.java | 33 +- ...vitySettingsListWithResponseMockTests.java | 64 + ...rverVulnerabilityAssessmentInnerTests.java | 8 +- ...ulnerabilityAssessmentPropertiesTests.java | 5 +- ...ssessmentsAzureSettingPropertiesTests.java | 31 + ...tsCreateOrUpdateWithResponseMockTests.java | 43 +- ...lnerabilityAssessmentsDeleteMockTests.java | 39 +- ...tyAssessmentsGetWithResponseMockTests.java | 42 +- ...ExtendedResourceWithResponseMockTests.java | 43 +- ...ulnerabilityAssessmentsListInnerTests.java | 14 +- ...erabilityAssessmentsSettingInnerTests.java | 23 + ...gsCreateOrUpdateWithResponseMockTests.java | 58 + ...sSettingsDeleteWithResponseMockTests.java} | 42 +- ...entsSettingsGetWithResponseMockTests.java} | 45 +- ...lityAssessmentsSettingsListMockTests.java} | 41 +- ...erabilityAssessmentsSettingsListTests.java | 23 + .../ServerVulnerabilityPropertiesTests.java | 8 +- .../security/generated/SettingInnerTests.java | 8 +- .../SettingsGetWithResponseMockTests.java | 42 +- .../generated/SettingsListMockTests.java | 34 +- .../security/generated/SettingsListTests.java | 11 +- .../SettingsUpdateWithResponseMockTests.java | 44 +- .../generated/SoftwareInnerTests.java | 59 +- ...reInventoriesGetWithResponseMockTests.java | 59 +- ...toriesListByExtendedResourceMockTests.java | 60 +- .../SoftwareInventoriesListMockTests.java | 53 +- .../generated/SoftwarePropertiesTests.java | 55 +- .../generated/SoftwaresListTests.java | 72 +- ...SqlServerVulnerabilityPropertiesTests.java | 9 +- ...BaselineRulesAddWithResponseMockTests.java | 63 +- ...esCreateOrUpdateWithResponseMockTests.java | 53 +- ...elineRulesDeleteWithResponseMockTests.java | 39 +- ...BaselineRulesGetWithResponseMockTests.java | 42 +- ...aselineRulesListWithResponseMockTests.java | 43 +- ...ntScanResultsGetWithResponseMockTests.java | 86 +- ...tScanResultsListWithResponseMockTests.java | 61 +- ...sessmentScansGetWithResponseMockTests.java | 70 +- ...essmentScansListWithResponseMockTests.java | 62 +- .../SuppressionAlertsScopeTests.java | 20 +- .../security/generated/TagsResourceTests.java | 14 +- .../security/generated/TagsTests.java | 13 +- .../TargetBranchConfigurationTests.java | 32 + ...ceGroupLevelTaskWithResponseMockTests.java | 43 +- ...riptionLevelTaskWithResponseMockTests.java | 42 +- .../TasksListByHomeRegionMockTests.java | 38 +- .../TasksListByResourceGroupMockTests.java | 38 +- .../generated/TasksListMockTests.java | 36 +- ...upLevelTaskStateWithResponseMockTests.java | 36 +- ...onLevelTaskStateWithResponseMockTests.java | 36 +- .../ThresholdCustomAlertRuleTests.java | 23 +- .../TimeWindowCustomAlertRuleTests.java | 28 +- .../TopologiesGetWithResponseMockTests.java | 41 +- .../TopologiesListByHomeRegionMockTests.java | 38 +- .../generated/TopologiesListMockTests.java | 34 +- .../security/generated/TopologyListTests.java | 8 +- .../generated/TopologyResourceInnerTests.java | 8 +- .../TopologyResourcePropertiesTests.java | 8 +- .../TopologySingleResourceChildTests.java | 4 +- .../TopologySingleResourceParentTests.java | 4 +- .../TopologySingleResourceTests.java | 8 +- .../generated/TrackedResourceTests.java | 33 +- .../TwinUpdatesNotInAllowedRangeTests.java | 29 +- ...rizedOperationsNotInAllowedRangeTests.java | 29 +- ...ateIoTSecuritySolutionPropertiesTests.java | 60 +- .../UpdateIotSecuritySolutionDataTests.java | 72 +- ...UpdateSensitivitySettingsRequestTests.java | 39 + .../UserDefinedResourcesPropertiesTests.java | 20 +- .../generated/UserRecommendationTests.java | 13 +- .../security/generated/VaRuleTests.java | 90 +- .../generated/VendorReferenceTests.java | 4 +- .../generated/VmRecommendationTests.java | 29 +- .../generated/WorkspaceSettingInnerTests.java | 20 +- .../generated/WorkspaceSettingListTests.java | 26 +- .../WorkspaceSettingPropertiesTests.java | 17 +- ...ceSettingsCreateWithResponseMockTests.java | 46 +- ...ceSettingsDeleteWithResponseMockTests.java | 36 +- ...spaceSettingsGetWithResponseMockTests.java | 41 +- .../WorkspaceSettingsListMockTests.java | 37 +- 1940 files changed, 77199 insertions(+), 50507 deletions(-) delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApiCollectionOffboardingsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApiCollectionOnboardingsClient.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsOrgsClient.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsProjectsClient.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsReposClient.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DefenderForStoragesClient.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsConfigurationsClient.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsOperationResultsClient.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubOwnersClient.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubReposClient.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabGroupsClient.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabProjectsClient.java create 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/IngestionSettingsClient.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ResourceProvidersClient.java rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/{HealthReportOperationsClient.java => SensitivitySettingsClient.java} (52%) create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ServerVulnerabilityAssessmentsSettingsClient.java create 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/ApiCollectionResponseInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsOrgInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsOrgListResponseInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsProjectInner.java create 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/ConnectionStringsInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DefenderForStorageSettingInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DefenderForStorageSettingProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DevOpsConfigurationInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsListResponseInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsResponseInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubOwnerInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubOwnerListResponseInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubRepositoryInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabGroupInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabGroupListResponseInner.java create 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/IngestionSettingInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IngestionSettingTokenInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MalwareScanningProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OnUploadProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationStatusResultInner.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SensitiveDataDiscoveryProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentsAzureSettingProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentsSettingInner.java create 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/ApiCollectionOffboardingsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOffboardingsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOnboardingsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOnboardingsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionResponseImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgListResponseImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgsClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgsImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectsClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectsImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsReposClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsReposImpl.java create 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/ConnectionStringsImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStorageSettingImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStoragesClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStoragesImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationsClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationsImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsOperationResultsClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsOperationResultsImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsListResponseImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsResponseImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnerImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnerListResponseImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnersClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnersImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubReposClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubReposImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubRepositoryImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupListResponseImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupsClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupsImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectsClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectsImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabSubgroupsClientImpl.java create 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/HealthReportOperationsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportOperationsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingTokenImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingsImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationStatusResultImpl.java rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/{Utils.java => ResourceManagerUtils.java} (79%) create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ResourceProvidersClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ResourceProvidersImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingsClientImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingsImpl.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionableRemediation.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionableRemediationState.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AnnotateDefaultBranchState.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollection.java rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/{ApiCollectionResponseList.java => ApiCollectionList.java} (77%) delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionOffboardings.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionOnboardings.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Authorization.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoDiscovery.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationUpdateModel.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrg.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgListResponse.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgs.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProject.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjectListResponse.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjectProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjects.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepos.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepository.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepositoryListResponse.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepositoryProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureServersSetting.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BuiltInInfoType.java create 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/ConnectionStrings.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiem.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiemDiscovery.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiemOidc.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingMdcContainersImageAssessment.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingCiemDiscovery.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingDataSensitivityDiscovery.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingMdcContainersImageAssessment.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingVmScanners.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingVmScannersConfiguration.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingMdcContainersImageAssessment.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingMdcContainersImageAssessment.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorageSetting.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorages.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfiguration.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurationListResponse.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurationProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurations.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsOperationResults.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsProvisioningState.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Enforce.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsListResponse.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponse.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponseProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponsePropertiesMipInformation.java rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/{ApiCollectionResponse.java => GitHubOwner.java} (52%) create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubOwnerListResponse.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubOwnerProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubOwners.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubRepos.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubRepository.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubRepositoryListResponse.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubRepositoryProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabGroup.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabGroupListResponse.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabGroupProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabGroups.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabProject.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabProjectListResponse.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabProjectProperties.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabProjects.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabSubgroups.java create 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/IngestionConnectionString.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSetting.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSettingToken.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSettings.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InheritFromParentState.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Inherited.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Label.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MinimalRiskLevel.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MipIntegrationStatus.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/NotificationsSource.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/NotificationsSourceAlert.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/NotificationsSourceAttackPath.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnboardingState.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationStatusAutoGenerated.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationStatusResult.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceProviders.java create 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/Roles.java create 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/ScopeName.java create 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/SecurityContactPropertiesAlertNotifications.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityContactRole.java rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/{HealthReportOperations.java => SensitivitySettings.java} (51%) create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsAzureSettingSelectedProvider.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSetting.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSettingKind.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSettingKindName.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSettings.java rename sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/{IngestionSettingList.java => ServerVulnerabilityAssessmentsSettingsList.java} (58%) create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingNameAutoGenerated.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SourceType.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TargetBranchConfiguration.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UpdateSensitivitySettingsRequest.java create mode 100644 sdk/security/azure-resourcemanager-security/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-security/proxy-config.json create 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/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionGetSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionListSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionOffboardingDeleteSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionOnboardingCreateSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsGetByAzureApiManagementServiceSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsListByAzureApiManagementServiceSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsListByResourceGroupSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsListSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsOffboardAzureApiManagementApiSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsOnboardAzureApiManagementApiSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsUpdateSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsCreateOrUpdateSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsGetSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsListAvailableSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsListSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsUpdateSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsCreateOrUpdateSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsGetSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsListSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsUpdateSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposCreateOrUpdateSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposGetSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposListSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposUpdateSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DefenderForStorageCreateSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DefenderForStorageGetSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsCreateOrUpdateSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsDeleteSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsGetSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsListSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsUpdateSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsOperationResultsGetSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubOwnersGetSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubOwnersListAvailableSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubOwnersListSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubReposGetSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubReposListSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabGroupsGetSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabGroupsListAvailableSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabGroupsListSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabProjectsGetSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabProjectsListSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabSubgroupsListSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportOperationGetSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportsGetSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsCreateSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsDeleteSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsGetSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListConnectionStringsSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListSamples.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListTokensSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsDeleteSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ResourceProviderGetSensitivitySettingsSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ResourceProviderUpdateSensitivitySettingsSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SensitivitySettingsListSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsCreateOrUpdateSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsDeleteSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsGetSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsListSamples.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ActionableRemediationTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionInnerTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionOnboardingsCreateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionResponseInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionResponseListTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionsGetByAzureApiManagementServiceWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionsGetWithResponseMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionsListByAzureApiManagementServiceMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionsListByResourceGroupMockTests.java rename sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/{IngestionSettingsCreateWithResponseMockTests.java => ApiCollectionsOffboardAzureApiManagementApiWithResponseMockTests.java} (52%) create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionsOnboardAzureApiManagementApiMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationUpdateModelTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgInnerTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgListResponseInnerTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgPropertiesTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsCreateOrUpdateMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsGetWithResponseMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsListAvailableWithResponseMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsListMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectInnerTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectListResponseTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectPropertiesTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsCreateOrUpdateMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsGetWithResponseMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsListMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposCreateOrUpdateMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposGetWithResponseMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposListMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureDevOpsRepositoryInnerTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureDevOpsRepositoryListResponseTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureDevOpsRepositoryPropertiesTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureServersSettingTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/BuiltInInfoTypeTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CategoryConfigurationTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectionStringsInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorSettingInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorSettingListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsCreateOrUpdateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsListMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingCiemDiscoveryTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingCiemOidcTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingCiemTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8STests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingMdcContainersImageAssessmentTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmGcpOfferingCiemDiscoveryTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmGcpOfferingDataSensitivityDiscoveryTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8STests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmGcpOfferingMdcContainersImageAssessmentTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmGcpOfferingVmScannersConfigurationTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmGcpOfferingVmScannersTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8STests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingMdcContainersImageAssessmentTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8STests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersGcpOfferingMdcContainersImageAssessmentTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsDeleteMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DevOpsOperationResultsGetWithResponseMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GetSensitivitySettingsListResponseInnerTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GetSensitivitySettingsResponseInnerTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GetSensitivitySettingsResponsePropertiesMipInformationTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GetSensitivitySettingsResponsePropertiesTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitHubOwnerInnerTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitHubOwnerListResponseInnerTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitHubOwnerPropertiesTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitHubOwnersGetWithResponseMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitHubOwnersListAvailableWithResponseMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitHubOwnersListMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitHubReposGetWithResponseMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitHubReposListMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitHubRepositoryInnerTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitHubRepositoryListResponseTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitHubRepositoryPropertiesTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitLabGroupInnerTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitLabGroupListResponseInnerTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitLabGroupPropertiesTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitLabGroupsGetWithResponseMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitLabGroupsListAvailableWithResponseMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitLabGroupsListMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitLabProjectInnerTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitLabProjectListResponseTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitLabProjectPropertiesTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitLabProjectsGetWithResponseMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitLabProjectsListMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitLabSubgroupsListWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HealthReportsListTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InfoTypeTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesCreateOrUpdateWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesListMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPolicyListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionConnectionStringTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsListConnectionStringsWithResponseMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LabelTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/NotificationsSourceAlertTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/NotificationsSourceAttackPathTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/NotificationsSourceTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OnUploadPropertiesTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OperationStatusResultInnerTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingInnerTests.java rename sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/{IngestionSettingsDeleteWithResponseMockTests.java => PricingsDeleteByResourceGroupWithResponseMockTests.java} (59%) delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingsGetWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingsUpdateWithResponseMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ResourceProvidersGetSensitivitySettingsWithResponseMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ResourceProvidersUpdateSensitivitySettingsWithResponseMockTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityAssessmentListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityAssessmentMetadataResponseListTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactPropertiesAlertNotificationsTests.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySubAssessmentListTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SensitivitySettingsListWithResponseMockTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsAzureSettingPropertiesTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingInnerTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsCreateOrUpdateWithResponseMockTests.java rename sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/{ApiCollectionOffboardingsDeleteWithResponseMockTests.java => ServerVulnerabilityAssessmentsSettingsDeleteWithResponseMockTests.java} (57%) rename sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/{IngestionSettingsGetWithResponseMockTests.java => ServerVulnerabilityAssessmentsSettingsGetWithResponseMockTests.java} (52%) rename sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/{IngestionSettingsListMockTests.java => ServerVulnerabilityAssessmentsSettingsListMockTests.java} (55%) create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsListTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TargetBranchConfigurationTests.java create mode 100644 sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UpdateSensitivitySettingsRequestTests.java diff --git a/sdk/security/azure-resourcemanager-security/CHANGELOG.md b/sdk/security/azure-resourcemanager-security/CHANGELOG.md index bd1644944ed74..c05da164089bb 100644 --- a/sdk/security/azure-resourcemanager-security/CHANGELOG.md +++ b/sdk/security/azure-resourcemanager-security/CHANGELOG.md @@ -1,14 +1,477 @@ # Release History -## 1.0.0-beta.6 (Unreleased) +## 1.0.0-beta.6 (2024-03-14) -### Features Added +- Azure Resource Manager Security client library for Java. This package contains Microsoft Azure SDK for Security Management SDK. API spec for Microsoft.Security (Azure Security Center) resource provider. Package tag package-composite-v3. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +* `models.ApiCollectionOffboardings` was removed + +* `models.IngestionSettingList` was removed + +* `models.IngestionConnectionString` was removed + +* `models.Roles` was removed + +* `models.ScopeName` was removed + +* `models.IngestionSettings` was removed + +* `models.IngestionSetting` was removed + +* `models.IngestionSetting$Definition` was removed + +* `models.ApiCollectionResponse` was removed + +* `models.SecurityContactPropertiesAlertNotifications` was removed + +* `models.IngestionSettingToken` was removed + +* `models.ApiCollectionOnboardings` was removed + +* `models.HealthReportOperations` was removed + +* `models.ApiCollectionResponseList` was removed + +* `models.IngestionSetting$DefinitionStages` was removed + +* `models.ConnectionStrings` was removed + +#### `models.Extension` was modified + +* `models.OperationStatus operationStatus()` -> `models.OperationStatusAutoGenerated operationStatus()` + +#### `models.SecurityContacts` was modified + +* `delete(java.lang.String)` was removed +* `get(java.lang.String)` was removed +* `define(java.lang.String)` was removed +* `deleteWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `getWithResponse(java.lang.String,com.azure.core.util.Context)` was removed + +#### `SecurityManager` was modified + +* `apiCollectionOffboardings()` was removed +* `apiCollectionOnboardings()` was removed +* `ingestionSettings()` was removed +* `healthReportOperations()` was removed + +#### `models.ApiCollections` was modified + +* `list(java.lang.String,java.lang.String)` was removed +* `list(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `get(java.lang.String,java.lang.String,java.lang.String)` was removed +* `getWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed + +#### `models.SecurityContact$Definition` was modified + +* `withAlertNotifications(models.SecurityContactPropertiesAlertNotifications)` was removed + +#### `models.Pricings` was modified + +* `getWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `get(java.lang.String)` was removed +* `updateWithResponse(java.lang.String,fluent.models.PricingInner,com.azure.core.util.Context)` was removed +* `listWithResponse(com.azure.core.util.Context)` was removed +* `update(java.lang.String,fluent.models.PricingInner)` was removed +* `list()` was removed + +#### `models.Settings` was modified + +* `getWithResponse(models.SettingName,com.azure.core.util.Context)` was removed +* `updateWithResponse(models.SettingName,fluent.models.SettingInner,com.azure.core.util.Context)` was removed +* `get(models.SettingName)` was removed +* `update(models.SettingName,fluent.models.SettingInner)` was removed + +#### `models.HealthDataClassification` was modified + +* `models.ScopeName scope()` -> `java.lang.String scope()` +* `withScope(models.ScopeName)` was removed + +#### `models.OperationStatus` was modified + +* `withCode(models.Code)` was removed +* `models.Code code()` -> `java.lang.String code()` + +#### `models.SecurityContact` was modified + +* `alertNotifications()` was removed + +### Features Added + +* `models.OnboardingState` was added + +* `models.NotificationsSourceAlert` was added + +* `models.ServerVulnerabilityAssessmentsAzureSettingSelectedProvider` was added + +* `models.DevOpsProvisioningState` was added + +* `models.AzureDevOpsRepository$UpdateStages` was added + +* `models.AzureDevOpsProject$UpdateStages` was added + +* `models.DefenderForStorageSetting$Definition` was added + +* `models.AzureDevOpsRepository$Definition` was added + +* `models.DefenderForContainersAwsOfferingMdcContainersImageAssessment` was added + +* `models.DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S` was added + +* `models.ActionableRemediationState` was added + +* `models.GitHubRepositoryProperties` was added + +* `models.SensitivitySettings` was added + +* `models.SecurityContactRole` was added + +* `models.AzureDevOpsProject$Update` was added + +* `models.DefenderCspmGcpOfferingMdcContainersImageAssessment` was added + +* `models.AzureDevOpsProjects` was added + +* `models.DevOpsConfigurationProperties` was added + +* `models.AzureDevOpsOrgProperties` was added + +* `models.GitLabProject` was added + +* `models.NotificationsSourceAttackPath` was added + +* `models.GitLabProjects` was added + +* `models.GitHubOwnerProperties` was added + +* `models.Label` was added + +* `models.DefenderForStorageSetting$DefinitionStages` was added + +* `models.DefenderCspmGcpOfferingVmScanners` was added + +* `models.ServerVulnerabilityAssessmentsSettingKindName` was added + +* `models.AzureDevOpsRepository$DefinitionStages` was added + +* `models.AzureDevOpsOrgListResponse` was added + +* `models.AnnotateDefaultBranchState` was added + +* `models.ActionableRemediation` was added + +* `models.OperationStatusResult` was added + +* `models.GitLabSubgroups` was added + +* `models.GetSensitivitySettingsListResponse` was added + +* `models.AzureDevOpsRepository$Update` was added + +* `models.Enforce` was added + +* `models.AzureDevOpsRepos` was added + +* `models.GitLabGroup` was added + +* `models.Inherited` was added + +* `models.AzureDevOpsRepositoryListResponse` was added + +* `models.GitHubRepository` was added + +* `models.AzureServersSetting` was added + +* `models.ServerVulnerabilityAssessmentsSettings` was added + +* `models.SecurityContactName` was added + +* `models.ApiCollectionList` was added + +* `models.DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S` was added + +* `models.GitHubOwners` was added + +* `models.SourceType` was added + +* `models.DevOpsOperationResults` was added + +* `models.DevOpsConfigurationListResponse` was added + +* `models.ServerVulnerabilityAssessmentsSettingsList` was added + +* `models.GetSensitivitySettingsResponseProperties` was added + +* `models.GitLabProjectListResponse` was added + +* `models.GitLabGroupProperties` was added + +* `models.ResourcesCoverageStatus` was added + +* `models.ServerVulnerabilityAssessmentsSettingKind` was added + +* `models.DefenderForStorages` was added + +* `models.GitHubOwner` was added + +* `models.MipIntegrationStatus` was added + +* `models.AzureDevOpsProject` was added + +* `models.AzureDevOpsOrg$Definition` was added + +* `models.DefenderForContainersGcpOfferingMdcContainersImageAssessment` was added + +* `models.ResourceProviders` was added + +* `models.AzureDevOpsProject$Definition` was added + +* `models.GitLabGroupListResponse` was added + +* `models.AutomationUpdateModel` was added + +* `models.DefenderCspmAwsOfferingCiemOidc` was added + +* `models.UpdateSensitivitySettingsRequest` was added + +* `models.DefenderCspmGcpOfferingVmScannersConfiguration` was added + +* `models.DevOpsConfigurations` was added + +* `models.DefenderCspmAwsOfferingCiem` was added + +* `models.AzureDevOpsOrg$UpdateStages` was added + +* `models.AzureDevOpsOrg` was added + +* `models.DefenderCspmGcpOfferingDataSensitivityDiscovery` was added + +* `models.AzureDevOpsRepositoryProperties` was added + +* `models.Authorization` was added + +* `models.AzureDevOpsProjectListResponse` was added + +* `models.GitHubRepositoryListResponse` was added + +* `models.AzureDevOpsRepository` was added + +* `models.GitHubRepos` was added + +* `models.CategoryConfiguration` was added + +* `models.DefenderCspmAwsOfferingCiemDiscovery` was added + +* `models.SettingNameAutoGenerated` was added + +* `models.RuleCategory` was added + +* `models.BuiltInInfoType` was added + +* `models.GitLabProjectProperties` was added + +* `models.ServerVulnerabilityAssessmentsSetting` was added + +* `models.DefenderForStorageSetting` was added + +* `models.GitLabGroups` was added + +* `models.OperationStatusAutoGenerated` was added + +* `models.DefenderCspmGcpOfferingCiemDiscovery` was added + +* `models.ApiCollection` was added + +* `models.InfoType` was added + +* `models.AutoDiscovery` was added + +* `models.GitHubOwnerListResponse` was added + +* `models.InheritFromParentState` was added + +* `models.GetSensitivitySettingsResponse` was added + +* `models.MinimalRiskLevel` was added + +* `models.AzureDevOpsOrg$Update` was added + +* `models.GetSensitivitySettingsResponsePropertiesMipInformation` was added + +* `models.TargetBranchConfiguration` was added + +* `models.AzureDevOpsProjectProperties` was added + +* `models.DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S` was added + +* `models.DefenderCspmAwsOfferingMdcContainersImageAssessment` was added + +* `models.AzureDevOpsOrg$DefinitionStages` was added + +* `models.DevOpsConfiguration` was added + +* `models.AzureDevOpsProject$DefinitionStages` was added + +* `models.AzureDevOpsOrgs` was added + +* `models.DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S` was added + +* `models.NotificationsSource` was added + +#### `models.GcpProjectEnvironmentData` was modified + +* `scanInterval()` was added +* `withScanInterval(java.lang.Long)` was added + +#### `models.SecurityContactList` was modified + +* `withValue(java.util.List)` was added + +#### `models.Pricing` was modified + +* `resourcesCoverageStatus()` was added +* `inherited()` was added +* `enforce()` was added +* `inheritedFrom()` was added + +#### `models.HealthReport` was modified + +* `affectedDefendersSubPlans()` was added +* `reportAdditionalData()` was added + +#### `models.HealthReports` was modified + +* `get(java.lang.String,java.lang.String)` was added +* `getWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added + +#### `models.SecurityContacts` was modified + +* `define(models.SecurityContactName)` was added +* `getWithResponse(models.SecurityContactName,com.azure.core.util.Context)` was added +* `get(models.SecurityContactName)` was added +* `deleteWithResponse(models.SecurityContactName,com.azure.core.util.Context)` was added +* `delete(models.SecurityContactName)` was added + +#### `models.AutomationActionEventHub` was modified + +* `isTrustedServiceEnabled()` was added +* `withIsTrustedServiceEnabled(java.lang.Boolean)` was added + +#### `models.AwsEnvironmentData` was modified + +* `scanInterval()` was added +* `withScanInterval(java.lang.Long)` was added + +#### `SecurityManager` was modified + +* `serverVulnerabilityAssessmentsSettings()` was added +* `azureDevOpsOrgs()` was added +* `devOpsOperationResults()` was added +* `azureDevOpsProjects()` was added +* `devOpsConfigurations()` was added +* `gitLabProjects()` was added +* `gitHubRepos()` was added +* `azureDevOpsRepos()` was added +* `gitLabSubgroups()` was added +* `resourceProviders()` was added +* `sensitivitySettings()` was added +* `defenderForStorages()` was added +* `gitHubOwners()` was added +* `gitLabGroups()` was added + +#### `models.ApiCollections` was modified + +* `onboardAzureApiManagementApi(java.lang.String,java.lang.String,java.lang.String)` was added +* `listByResourceGroup(java.lang.String)` was added +* `list(com.azure.core.util.Context)` was added +* `getByAzureApiManagementService(java.lang.String,java.lang.String,java.lang.String)` was added +* `offboardAzureApiManagementApi(java.lang.String,java.lang.String,java.lang.String)` was added +* `offboardAzureApiManagementApiWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `onboardAzureApiManagementApi(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `listByAzureApiManagementService(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `listByAzureApiManagementService(java.lang.String,java.lang.String)` was added +* `list()` was added +* `getByAzureApiManagementServiceWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `listByResourceGroup(java.lang.String,com.azure.core.util.Context)` was added + +#### `models.StatusAutoGenerated` was modified + +* `lastScannedDate()` was added +* `reason()` was added + +#### `models.SecurityContact$Definition` was modified + +* `withNotificationsSources(java.util.List)` was added +* `withIsEnabled(java.lang.Boolean)` was added + +#### `models.DefenderForContainersAwsOffering` was modified + +* `mdcContainersImageAssessment()` was added +* `withMdcContainersAgentlessDiscoveryK8S(models.DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S)` was added +* `withMdcContainersImageAssessment(models.DefenderForContainersAwsOfferingMdcContainersImageAssessment)` was added +* `mdcContainersAgentlessDiscoveryK8S()` was added + +#### `models.Pricings` was modified + +* `listWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `deleteByResourceGroup(java.lang.String,java.lang.String)` was added +* `deleteByResourceGroupWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `list(java.lang.String)` was added +* `update(java.lang.String,java.lang.String,fluent.models.PricingInner)` was added +* `get(java.lang.String,java.lang.String)` was added +* `getWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `updateWithResponse(java.lang.String,java.lang.String,fluent.models.PricingInner,com.azure.core.util.Context)` was added + +#### `models.Settings` was modified + +* `get(models.SettingNameAutoGenerated)` was added +* `getWithResponse(models.SettingNameAutoGenerated,com.azure.core.util.Context)` was added +* `update(models.SettingNameAutoGenerated,fluent.models.SettingInner)` was added +* `updateWithResponse(models.SettingNameAutoGenerated,fluent.models.SettingInner,com.azure.core.util.Context)` was added + +#### `models.DefenderForContainersGcpOffering` was modified + +* `withMdcContainersImageAssessment(models.DefenderForContainersGcpOfferingMdcContainersImageAssessment)` was added +* `mdcContainersAgentlessDiscoveryK8S()` was added +* `withMdcContainersAgentlessDiscoveryK8S(models.DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S)` was added +* `mdcContainersImageAssessment()` was added + +#### `models.DefenderCspmAwsOffering` was modified + +* `mdcContainersAgentlessDiscoveryK8S()` was added +* `mdcContainersImageAssessment()` was added +* `withCiem(models.DefenderCspmAwsOfferingCiem)` was added +* `ciem()` was added +* `withMdcContainersImageAssessment(models.DefenderCspmAwsOfferingMdcContainersImageAssessment)` was added +* `withMdcContainersAgentlessDiscoveryK8S(models.DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S)` was added + +#### `models.HealthDataClassification` was modified + +* `withScope(java.lang.String)` was added + +#### `models.DefenderCspmGcpOffering` was modified + +* `ciemDiscovery()` was added +* `mdcContainersAgentlessDiscoveryK8S()` was added +* `withVmScanners(models.DefenderCspmGcpOfferingVmScanners)` was added +* `withCiemDiscovery(models.DefenderCspmGcpOfferingCiemDiscovery)` was added +* `withMdcContainersAgentlessDiscoveryK8S(models.DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S)` was added +* `withDataSensitivityDiscovery(models.DefenderCspmGcpOfferingDataSensitivityDiscovery)` was added +* `vmScanners()` was added +* `withMdcContainersImageAssessment(models.DefenderCspmGcpOfferingMdcContainersImageAssessment)` was added +* `mdcContainersImageAssessment()` was added +* `dataSensitivityDiscovery()` was added + +#### `models.OperationStatus` was modified + +* `withCode(java.lang.String)` was added + +#### `models.SecurityContact` was modified -### Other Changes +* `notificationsSources()` was added +* `isEnabled()` was added ## 1.0.0-beta.5 (2023-04-18) diff --git a/sdk/security/azure-resourcemanager-security/README.md b/sdk/security/azure-resourcemanager-security/README.md index 960b33cd33f3f..53cd81088b649 100644 --- a/sdk/security/azure-resourcemanager-security/README.md +++ b/sdk/security/azure-resourcemanager-security/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-security - 1.0.0-beta.5 + 1.0.0-beta.6 ``` [//]: # ({x-version-update-end}) @@ -45,7 +45,7 @@ Azure Management Libraries require a `TokenCredential` implementation for authen ### Authentication -By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. +By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. @@ -94,7 +94,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS [docs]: https://azure.github.io/azure-sdk-for-java/ -[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty @@ -103,3 +103,5 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fsecurity%2Fazure-resourcemanager-security%2FREADME.png) diff --git a/sdk/security/azure-resourcemanager-security/SAMPLE.md b/sdk/security/azure-resourcemanager-security/SAMPLE.md index 3972495626d94..ecf7fe4c229c5 100644 --- a/sdk/security/azure-resourcemanager-security/SAMPLE.md +++ b/sdk/security/azure-resourcemanager-security/SAMPLE.md @@ -50,18 +50,14 @@ - [List](#allowedconnections_list) - [ListByHomeRegion](#allowedconnections_listbyhomeregion) -## ApiCollection +## ApiCollections -- [Get](#apicollection_get) -- [List](#apicollection_list) - -## ApiCollectionOffboarding - -- [Delete](#apicollectionoffboarding_delete) - -## ApiCollectionOnboarding - -- [Create](#apicollectiononboarding_create) +- [GetByAzureApiManagementService](#apicollections_getbyazureapimanagementservice) +- [List](#apicollections_list) +- [ListByAzureApiManagementService](#apicollections_listbyazureapimanagementservice) +- [ListByResourceGroup](#apicollections_listbyresourcegroup) +- [OffboardAzureApiManagementApi](#apicollections_offboardazureapimanagementapi) +- [OnboardAzureApiManagementApi](#apicollections_onboardazureapimanagementapi) ## ApplicationOperation @@ -102,8 +98,31 @@ - [GetByResourceGroup](#automations_getbyresourcegroup) - [List](#automations_list) - [ListByResourceGroup](#automations_listbyresourcegroup) +- [Update](#automations_update) - [Validate](#automations_validate) +## AzureDevOpsOrgs + +- [CreateOrUpdate](#azuredevopsorgs_createorupdate) +- [Get](#azuredevopsorgs_get) +- [List](#azuredevopsorgs_list) +- [ListAvailable](#azuredevopsorgs_listavailable) +- [Update](#azuredevopsorgs_update) + +## AzureDevOpsProjects + +- [CreateOrUpdate](#azuredevopsprojects_createorupdate) +- [Get](#azuredevopsprojects_get) +- [List](#azuredevopsprojects_list) +- [Update](#azuredevopsprojects_update) + +## AzureDevOpsRepos + +- [CreateOrUpdate](#azuredevopsrepos_createorupdate) +- [Get](#azuredevopsrepos_get) +- [List](#azuredevopsrepos_list) +- [Update](#azuredevopsrepos_update) + ## ComplianceResults - [Get](#complianceresults_get) @@ -137,6 +156,23 @@ - [List](#customentitystoreassignments_list) - [ListByResourceGroup](#customentitystoreassignments_listbyresourcegroup) +## DefenderForStorage + +- [Create](#defenderforstorage_create) +- [Get](#defenderforstorage_get) + +## DevOpsConfigurations + +- [CreateOrUpdate](#devopsconfigurations_createorupdate) +- [Delete](#devopsconfigurations_delete) +- [Get](#devopsconfigurations_get) +- [List](#devopsconfigurations_list) +- [Update](#devopsconfigurations_update) + +## DevOpsOperationResults + +- [Get](#devopsoperationresults_get) + ## DeviceSecurityGroups - [CreateOrUpdate](#devicesecuritygroups_createorupdate) @@ -156,6 +192,32 @@ - [List](#externalsecuritysolutions_list) - [ListByHomeRegion](#externalsecuritysolutions_listbyhomeregion) +## GitHubOwners + +- [Get](#githubowners_get) +- [List](#githubowners_list) +- [ListAvailable](#githubowners_listavailable) + +## GitHubRepos + +- [Get](#githubrepos_get) +- [List](#githubrepos_list) + +## GitLabGroups + +- [Get](#gitlabgroups_get) +- [List](#gitlabgroups_list) +- [ListAvailable](#gitlabgroups_listavailable) + +## GitLabProjects + +- [Get](#gitlabprojects_get) +- [List](#gitlabprojects_list) + +## GitLabSubgroups + +- [List](#gitlabsubgroups_list) + ## GovernanceAssignments - [CreateOrUpdate](#governanceassignments_createorupdate) @@ -172,12 +234,9 @@ - [List](#governancerules_list) - [OperationResults](#governancerules_operationresults) -## HealthReportOperation - -- [Get](#healthreportoperation_get) - ## HealthReports +- [Get](#healthreports_get) - [List](#healthreports_list) ## InformationProtectionPolicies @@ -186,15 +245,6 @@ - [Get](#informationprotectionpolicies_get) - [List](#informationprotectionpolicies_list) -## IngestionSettings - -- [Create](#ingestionsettings_create) -- [Delete](#ingestionsettings_delete) -- [Get](#ingestionsettings_get) -- [List](#ingestionsettings_list) -- [ListConnectionStrings](#ingestionsettings_listconnectionstrings) -- [ListTokens](#ingestionsettings_listtokens) - ## IotSecuritySolution - [CreateOrUpdate](#iotsecuritysolution_createorupdate) @@ -243,6 +293,7 @@ ## Pricings +- [Delete](#pricings_delete) - [Get](#pricings_get) - [List](#pricings_list) - [Update](#pricings_update) @@ -262,6 +313,11 @@ - [Get](#regulatorycompliancestandards_get) - [List](#regulatorycompliancestandards_list) +## ResourceProvider + +- [GetSensitivitySettings](#resourceprovider_getsensitivitysettings) +- [UpdateSensitivitySettings](#resourceprovider_updatesensitivitysettings) + ## SecureScoreControlDefinitions - [List](#securescorecontroldefinitions_list) @@ -320,6 +376,10 @@ - [List](#securitysolutionsreferencedata_list) - [ListByHomeRegion](#securitysolutionsreferencedata_listbyhomeregion) +## SensitivitySettings + +- [List](#sensitivitysettings_list) + ## ServerVulnerabilityAssessment - [CreateOrUpdate](#servervulnerabilityassessment_createorupdate) @@ -327,6 +387,13 @@ - [Get](#servervulnerabilityassessment_get) - [ListByExtendedResource](#servervulnerabilityassessment_listbyextendedresource) +## ServerVulnerabilityAssessmentsSettings + +- [CreateOrUpdate](#servervulnerabilityassessmentssettings_createorupdate) +- [Delete](#servervulnerabilityassessmentssettings_delete) +- [Get](#servervulnerabilityassessmentssettings_get) +- [List](#servervulnerabilityassessmentssettings_list) + ## Settings - [Get](#settings_get) @@ -389,21 +456,24 @@ ### AdaptiveApplicationControls_Delete ```java -/** Samples for AdaptiveApplicationControls Delete. */ +/** + * Samples for AdaptiveApplicationControls Delete. + */ public final class AdaptiveApplicationControlsDeleteSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/DeleteAdaptiveApplicationControls_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/ + * DeleteAdaptiveApplicationControls_example.json */ /** * Sample code: Delete an application control machine group. - * + * * @param manager Entry point to SecurityManager. */ - public static void deleteAnApplicationControlMachineGroup( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .adaptiveApplicationControls() - .deleteByResourceGroupWithResponse("centralus", "GROUP1", com.azure.core.util.Context.NONE); + public static void + deleteAnApplicationControlMachineGroup(com.azure.resourcemanager.security.SecurityManager manager) { + manager.adaptiveApplicationControls().deleteByResourceGroupWithResponse("centralus", "GROUP1", + com.azure.core.util.Context.NONE); } } ``` @@ -411,21 +481,24 @@ public final class AdaptiveApplicationControlsDeleteSamples { ### AdaptiveApplicationControls_Get ```java -/** Samples for AdaptiveApplicationControls Get. */ +/** + * Samples for AdaptiveApplicationControls Get. + */ public final class AdaptiveApplicationControlsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/GetAdaptiveApplicationControlsGroup_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/ + * GetAdaptiveApplicationControlsGroup_example.json */ /** * Sample code: Gets a configured application control VM/server group. - * + * * @param manager Entry point to SecurityManager. */ - public static void getsAConfiguredApplicationControlVMServerGroup( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .adaptiveApplicationControls() - .getWithResponse("centralus", "ERELGROUP1", com.azure.core.util.Context.NONE); + public static void + getsAConfiguredApplicationControlVMServerGroup(com.azure.resourcemanager.security.SecurityManager manager) { + manager.adaptiveApplicationControls().getWithResponse("centralus", "ERELGROUP1", + com.azure.core.util.Context.NONE); } } ``` @@ -433,14 +506,18 @@ public final class AdaptiveApplicationControlsGetSamples { ### AdaptiveApplicationControls_List ```java -/** Samples for AdaptiveApplicationControls List. */ +/** + * Samples for AdaptiveApplicationControls List. + */ public final class AdaptiveApplicationControlsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/GetAdaptiveApplicationControlsSubscription_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/ + * GetAdaptiveApplicationControlsSubscription_example.json */ /** * Sample code: Gets a list of application control groups of machines for the subscription. - * + * * @param manager Entry point to SecurityManager. */ public static void getsAListOfApplicationControlGroupsOfMachinesForTheSubscription( @@ -467,114 +544,70 @@ import com.azure.resourcemanager.security.models.UserRecommendation; import com.azure.resourcemanager.security.models.VmRecommendation; import java.util.Arrays; -/** Samples for AdaptiveApplicationControls Put. */ +/** + * Samples for AdaptiveApplicationControls Put. + */ public final class AdaptiveApplicationControlsPutSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/PutAdaptiveApplicationControls_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/ + * PutAdaptiveApplicationControls_example.json */ /** * Sample code: Update an application control machine group by adding a new application. - * + * * @param manager Entry point to SecurityManager. */ public static void updateAnApplicationControlMachineGroupByAddingANewApplication( com.azure.resourcemanager.security.SecurityManager manager) { - AdaptiveApplicationControlGroup resource = - manager - .adaptiveApplicationControls() - .getWithResponse("centralus", "ERELGROUP1", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .withEnforcementMode(EnforcementMode.AUDIT) - .withProtectionMode( - new ProtectionMode() - .withExe(EnforcementMode.AUDIT) - .withMsi(EnforcementMode.NONE) - .withScript(EnforcementMode.NONE)) - .withVmRecommendations( - Arrays - .asList( - new VmRecommendation() - .withConfigurationStatus(ConfigurationStatus.CONFIGURED) - .withRecommendationAction(RecommendationAction.RECOMMENDED) - .withResourceId( - "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/erelh-stable/providers/microsoft.compute/virtualmachines/erelh-16090") - .withEnforcementSupport(EnforcementSupport.SUPPORTED), - new VmRecommendation() - .withConfigurationStatus(ConfigurationStatus.CONFIGURED) - .withRecommendationAction(RecommendationAction.RECOMMENDED) - .withResourceId( - "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/matanvs/providers/microsoft.compute/virtualmachines/matanvs19") - .withEnforcementSupport(EnforcementSupport.SUPPORTED))) - .withPathRecommendations( - Arrays - .asList( - new PathRecommendation() - .withPath("[Exe] O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US\\*\\*\\0.0.0.0") - .withAction(RecommendationAction.RECOMMENDED) - .withType(RecommendationType.fromString("PublisherSignature")) - .withPublisherInfo( - new PublisherInfo() - .withPublisherName("O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US") - .withProductName("*") - .withBinaryName("*") - .withVersion("0.0.0.0")) - .withCommon(true) - .withUserSids(Arrays.asList("S-1-1-0")) - .withUsernames( - Arrays - .asList( - new UserRecommendation() - .withUsername("Everyone") - .withRecommendationAction(RecommendationAction.RECOMMENDED))) - .withFileType(FileType.EXE) - .withConfigurationStatus(ConfigurationStatus.CONFIGURED), - new PathRecommendation() - .withPath("%OSDRIVE%\\WINDOWSAZURE\\SECAGENT\\WASECAGENTPROV.EXE") - .withAction(RecommendationAction.RECOMMENDED) - .withType(RecommendationType.fromString("ProductSignature")) - .withPublisherInfo( - new PublisherInfo() - .withPublisherName("CN=MICROSOFT AZURE DEPENDENCY CODE SIGN") - .withProductName("MICROSOFT® COREXT") - .withBinaryName("*") - .withVersion("0.0.0.0")) - .withCommon(true) - .withUserSids(Arrays.asList("S-1-1-0")) - .withUsernames( - Arrays - .asList( - new UserRecommendation() - .withUsername("NT AUTHORITY\\SYSTEM") - .withRecommendationAction(RecommendationAction.RECOMMENDED))) - .withFileType(FileType.EXE) - .withConfigurationStatus(ConfigurationStatus.CONFIGURED), - new PathRecommendation() - .withPath("%OSDRIVE%\\WINDOWSAZURE\\PACKAGES_201973_7415\\COLLECTGUESTLOGS.EXE") - .withAction(RecommendationAction.RECOMMENDED) - .withType(RecommendationType.fromString("PublisherSignature")) - .withPublisherInfo( - new PublisherInfo() - .withPublisherName("CN=MICROSOFT AZURE DEPENDENCY CODE SIGN") - .withProductName("*") - .withBinaryName("*") - .withVersion("0.0.0.0")) - .withCommon(true) - .withUserSids(Arrays.asList("S-1-1-0")) - .withUsernames( - Arrays - .asList( - new UserRecommendation() - .withUsername("NT AUTHORITY\\SYSTEM") - .withRecommendationAction(RecommendationAction.RECOMMENDED))) - .withFileType(FileType.EXE) - .withConfigurationStatus(ConfigurationStatus.CONFIGURED), - new PathRecommendation() - .withPath("C:\\directory\\file.exe") - .withAction(RecommendationAction.ADD) - .withType(RecommendationType.fromString("File")) - .withCommon(true))) + AdaptiveApplicationControlGroup resource = manager.adaptiveApplicationControls() + .getWithResponse("centralus", "ERELGROUP1", com.azure.core.util.Context.NONE).getValue(); + resource.update().withEnforcementMode(EnforcementMode.AUDIT) + .withProtectionMode(new ProtectionMode().withExe(EnforcementMode.AUDIT).withMsi(EnforcementMode.NONE) + .withScript(EnforcementMode.NONE)) + .withVmRecommendations(Arrays.asList(new VmRecommendation() + .withConfigurationStatus(ConfigurationStatus.CONFIGURED) + .withRecommendationAction(RecommendationAction.RECOMMENDED) + .withResourceId( + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/erelh-stable/providers/microsoft.compute/virtualmachines/erelh-16090") + .withEnforcementSupport(EnforcementSupport.SUPPORTED), + new VmRecommendation().withConfigurationStatus(ConfigurationStatus.CONFIGURED) + .withRecommendationAction(RecommendationAction.RECOMMENDED) + .withResourceId( + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/matanvs/providers/microsoft.compute/virtualmachines/matanvs19") + .withEnforcementSupport(EnforcementSupport.SUPPORTED))) + .withPathRecommendations(Arrays.asList( + new PathRecommendation() + .withPath("[Exe] O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US\\*\\*\\0.0.0.0") + .withAction(RecommendationAction.RECOMMENDED) + .withType(RecommendationType.fromString("PublisherSignature")) + .withPublisherInfo( + new PublisherInfo().withPublisherName("O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US") + .withProductName("*").withBinaryName("*").withVersion("0.0.0.0")) + .withCommon(true).withUserSids(Arrays.asList("S-1-1-0")) + .withUsernames(Arrays.asList(new UserRecommendation().withUsername("Everyone") + .withRecommendationAction(RecommendationAction.RECOMMENDED))) + .withFileType(FileType.EXE).withConfigurationStatus(ConfigurationStatus.CONFIGURED), + new PathRecommendation().withPath("%OSDRIVE%\\WINDOWSAZURE\\SECAGENT\\WASECAGENTPROV.EXE") + .withAction(RecommendationAction.RECOMMENDED) + .withType(RecommendationType.fromString("ProductSignature")) + .withPublisherInfo(new PublisherInfo().withPublisherName("CN=MICROSOFT AZURE DEPENDENCY CODE SIGN") + .withProductName("MICROSOFT® COREXT").withBinaryName("*").withVersion("0.0.0.0")) + .withCommon(true).withUserSids(Arrays.asList("S-1-1-0")) + .withUsernames(Arrays.asList(new UserRecommendation().withUsername("NT AUTHORITY\\SYSTEM") + .withRecommendationAction(RecommendationAction.RECOMMENDED))) + .withFileType(FileType.EXE).withConfigurationStatus(ConfigurationStatus.CONFIGURED), + new PathRecommendation().withPath("%OSDRIVE%\\WINDOWSAZURE\\PACKAGES_201973_7415\\COLLECTGUESTLOGS.EXE") + .withAction(RecommendationAction.RECOMMENDED) + .withType(RecommendationType.fromString("PublisherSignature")) + .withPublisherInfo(new PublisherInfo().withPublisherName("CN=MICROSOFT AZURE DEPENDENCY CODE SIGN") + .withProductName("*").withBinaryName("*").withVersion("0.0.0.0")) + .withCommon(true).withUserSids(Arrays.asList("S-1-1-0")) + .withUsernames(Arrays.asList(new UserRecommendation().withUsername("NT AUTHORITY\\SYSTEM") + .withRecommendationAction(RecommendationAction.RECOMMENDED))) + .withFileType(FileType.EXE).withConfigurationStatus(ConfigurationStatus.CONFIGURED), + new PathRecommendation().withPath("C:\\directory\\file.exe").withAction(RecommendationAction.ADD) + .withType(RecommendationType.fromString("File")).withCommon(true))) .apply(); } } @@ -589,48 +622,34 @@ import com.azure.resourcemanager.security.models.Rule; import com.azure.resourcemanager.security.models.TransportProtocol; import java.util.Arrays; -/** Samples for AdaptiveNetworkHardenings Enforce. */ +/** + * Samples for AdaptiveNetworkHardenings Enforce. + */ public final class AdaptiveNetworkHardeningsEnforceSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AdaptiveNetworkHardenings/EnforceAdaptiveNetworkHardeningRules_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AdaptiveNetworkHardenings/ + * EnforceAdaptiveNetworkHardeningRules_example.json */ /** * Sample code: Enforces the given rules on the NSG(s) listed in the request. - * + * * @param manager Entry point to SecurityManager. */ - public static void enforcesTheGivenRulesOnTheNSGSListedInTheRequest( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .adaptiveNetworkHardenings() - .enforce( - "rg1", - "Microsoft.Compute", - "virtualMachines", - "vm1", - "default", - new AdaptiveNetworkHardeningEnforceRequest() - .withRules( - Arrays - .asList( - new Rule() - .withName("rule1") - .withDirection(Direction.INBOUND) - .withDestinationPort(3389) - .withProtocols(Arrays.asList(TransportProtocol.TCP)) - .withIpAddresses(Arrays.asList("100.10.1.1", "200.20.2.2", "81.199.3.0/24")), - new Rule() - .withName("rule2") - .withDirection(Direction.INBOUND) - .withDestinationPort(22) - .withProtocols(Arrays.asList(TransportProtocol.TCP)) - .withIpAddresses(Arrays.asList()))) - .withNetworkSecurityGroups( - Arrays - .asList( - "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1", - "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg2")), - com.azure.core.util.Context.NONE); + public static void + enforcesTheGivenRulesOnTheNSGSListedInTheRequest(com.azure.resourcemanager.security.SecurityManager manager) { + manager.adaptiveNetworkHardenings().enforce("rg1", "Microsoft.Compute", "virtualMachines", "vm1", "default", + new AdaptiveNetworkHardeningEnforceRequest() + .withRules(Arrays.asList( + new Rule().withName("rule1").withDirection(Direction.INBOUND).withDestinationPort(3389) + .withProtocols(Arrays.asList(TransportProtocol.TCP)) + .withIpAddresses(Arrays.asList("100.10.1.1", "200.20.2.2", "81.199.3.0/24")), + new Rule().withName("rule2").withDirection(Direction.INBOUND).withDestinationPort(22) + .withProtocols(Arrays.asList(TransportProtocol.TCP)).withIpAddresses(Arrays.asList()))) + .withNetworkSecurityGroups(Arrays.asList( + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1", + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg2")), + com.azure.core.util.Context.NONE); } } ``` @@ -638,22 +657,24 @@ public final class AdaptiveNetworkHardeningsEnforceSamples { ### AdaptiveNetworkHardenings_Get ```java -/** Samples for AdaptiveNetworkHardenings Get. */ +/** + * Samples for AdaptiveNetworkHardenings Get. + */ public final class AdaptiveNetworkHardeningsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AdaptiveNetworkHardenings/GetAdaptiveNetworkHardening_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AdaptiveNetworkHardenings/ + * GetAdaptiveNetworkHardening_example.json */ /** * Sample code: Get a single Adaptive Network Hardening resource. - * + * * @param manager Entry point to SecurityManager. */ - public static void getASingleAdaptiveNetworkHardeningResource( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .adaptiveNetworkHardenings() - .getWithResponse( - "rg1", "Microsoft.Compute", "virtualMachines", "vm1", "default", com.azure.core.util.Context.NONE); + public static void + getASingleAdaptiveNetworkHardeningResource(com.azure.resourcemanager.security.SecurityManager manager) { + manager.adaptiveNetworkHardenings().getWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", + "default", com.azure.core.util.Context.NONE); } } ``` @@ -661,22 +682,24 @@ public final class AdaptiveNetworkHardeningsGetSamples { ### AdaptiveNetworkHardenings_ListByExtendedResource ```java -/** Samples for AdaptiveNetworkHardenings ListByExtendedResource. */ +/** + * Samples for AdaptiveNetworkHardenings ListByExtendedResource. + */ public final class AdaptiveNetworkHardeningsListByExtendedResourceSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AdaptiveNetworkHardenings/ListByExtendedResourceAdaptiveNetworkHardenings_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AdaptiveNetworkHardenings/ + * ListByExtendedResourceAdaptiveNetworkHardenings_example.json */ /** * Sample code: List Adaptive Network Hardenings resources of an extended resource. - * + * * @param manager Entry point to SecurityManager. */ public static void listAdaptiveNetworkHardeningsResourcesOfAnExtendedResource( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .adaptiveNetworkHardenings() - .listByExtendedResource( - "rg1", "Microsoft.Compute", "virtualMachines", "vm1", com.azure.core.util.Context.NONE); + manager.adaptiveNetworkHardenings().listByExtendedResource("rg1", "Microsoft.Compute", "virtualMachines", "vm1", + com.azure.core.util.Context.NONE); } } ``` @@ -684,25 +707,25 @@ public final class AdaptiveNetworkHardeningsListByExtendedResourceSamples { ### AdvancedThreatProtection_Create ```java -/** Samples for AdvancedThreatProtection Create. */ +/** + * Samples for AdvancedThreatProtection Create. + */ public final class AdvancedThreatProtectionCreateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/AdvancedThreatProtection/PutAdvancedThreatProtectionSettings_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/AdvancedThreatProtection/ + * PutAdvancedThreatProtectionSettings_example.json */ /** * Sample code: Creates or updates the Advanced Threat Protection settings on a specified resource. - * + * * @param manager Entry point to SecurityManager. */ public static void createsOrUpdatesTheAdvancedThreatProtectionSettingsOnASpecifiedResource( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .advancedThreatProtections() - .define() - .withExistingResourceId( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount") - .withIsEnabled(true) - .create(); + manager.advancedThreatProtections().define().withExistingResourceId( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount") + .withIsEnabled(true).create(); } } ``` @@ -710,23 +733,25 @@ public final class AdvancedThreatProtectionCreateSamples { ### AdvancedThreatProtection_Get ```java -/** Samples for AdvancedThreatProtection Get. */ +/** + * Samples for AdvancedThreatProtection Get. + */ public final class AdvancedThreatProtectionGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/AdvancedThreatProtection/GetAdvancedThreatProtectionSettings_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/AdvancedThreatProtection/ + * GetAdvancedThreatProtectionSettings_example.json */ /** * Sample code: Gets the Advanced Threat Protection settings for the specified resource. - * + * * @param manager Entry point to SecurityManager. */ public static void getsTheAdvancedThreatProtectionSettingsForTheSpecifiedResource( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .advancedThreatProtections() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", - com.azure.core.util.Context.NONE); + manager.advancedThreatProtections().getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", + com.azure.core.util.Context.NONE); } } ``` @@ -734,25 +759,23 @@ public final class AdvancedThreatProtectionGetSamples { ### Alerts_GetResourceGroupLevel ```java -/** Samples for Alerts GetResourceGroupLevel. */ +/** + * Samples for Alerts GetResourceGroupLevel. + */ public final class AlertsGetResourceGroupLevelSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertResourceGroupLocation_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/ + * GetAlertResourceGroupLocation_example.json */ /** * Sample code: Get security alert on a resource group from a security data location. - * + * * @param manager Entry point to SecurityManager. */ public static void getSecurityAlertOnAResourceGroupFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .alerts() - .getResourceGroupLevelWithResponse( - "myRg1", - "westeurope", - "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", - com.azure.core.util.Context.NONE); + manager.alerts().getResourceGroupLevelWithResponse("myRg1", "westeurope", + "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", com.azure.core.util.Context.NONE); } } ``` @@ -760,24 +783,23 @@ public final class AlertsGetResourceGroupLevelSamples { ### Alerts_GetSubscriptionLevel ```java -/** Samples for Alerts GetSubscriptionLevel. */ +/** + * Samples for Alerts GetSubscriptionLevel. + */ public final class AlertsGetSubscriptionLevelSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertSubscriptionLocation_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/ + * GetAlertSubscriptionLocation_example.json */ /** * Sample code: Get security alert on a subscription from a security data location. - * + * * @param manager Entry point to SecurityManager. */ public static void getSecurityAlertOnASubscriptionFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .alerts() - .getSubscriptionLevelWithResponse( - "westeurope", - "2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA", - com.azure.core.util.Context.NONE); + manager.alerts().getSubscriptionLevelWithResponse("westeurope", + "2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA", com.azure.core.util.Context.NONE); } } ``` @@ -785,14 +807,17 @@ public final class AlertsGetSubscriptionLevelSamples { ### Alerts_List ```java -/** Samples for Alerts List. */ +/** + * Samples for Alerts List. + */ public final class AlertsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertsSubscription_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/ + * GetAlertsSubscription_example.json */ /** * Sample code: Get security alerts on a subscription. - * + * * @param manager Entry point to SecurityManager. */ public static void getSecurityAlertsOnASubscription(com.azure.resourcemanager.security.SecurityManager manager) { @@ -804,14 +829,17 @@ public final class AlertsListSamples { ### Alerts_ListByResourceGroup ```java -/** Samples for Alerts ListByResourceGroup. */ +/** + * Samples for Alerts ListByResourceGroup. + */ public final class AlertsListByResourceGroupSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertsResourceGroup_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/ + * GetAlertsResourceGroup_example.json */ /** * Sample code: Get security alerts on a resource group. - * + * * @param manager Entry point to SecurityManager. */ public static void getSecurityAlertsOnAResourceGroup(com.azure.resourcemanager.security.SecurityManager manager) { @@ -823,14 +851,17 @@ public final class AlertsListByResourceGroupSamples { ### Alerts_ListResourceGroupLevelByRegion ```java -/** Samples for Alerts ListResourceGroupLevelByRegion. */ +/** + * Samples for Alerts ListResourceGroupLevelByRegion. + */ public final class AlertsListResourceGroupLevelByRegionSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertsResourceGroupLocation_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/ + * GetAlertsResourceGroupLocation_example.json */ /** * Sample code: Get security alerts on a resource group from a security data location. - * + * * @param manager Entry point to SecurityManager. */ public static void getSecurityAlertsOnAResourceGroupFromASecurityDataLocation( @@ -843,14 +874,17 @@ public final class AlertsListResourceGroupLevelByRegionSamples { ### Alerts_ListSubscriptionLevelByRegion ```java -/** Samples for Alerts ListSubscriptionLevelByRegion. */ +/** + * Samples for Alerts ListSubscriptionLevelByRegion. + */ public final class AlertsListSubscriptionLevelByRegionSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertsSubscriptionsLocation_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/ + * GetAlertsSubscriptionsLocation_example.json */ /** * Sample code: Get security alerts on a subscription from a security data location. - * + * * @param manager Entry point to SecurityManager. */ public static void getSecurityAlertsOnASubscriptionFromASecurityDataLocation( @@ -868,38 +902,27 @@ import com.azure.resourcemanager.security.models.AlertSimulatorRequestBody; import com.azure.resourcemanager.security.models.BundleType; import java.util.Arrays; -/** Samples for Alerts Simulate. */ +/** + * Samples for Alerts Simulate. + */ public final class AlertsSimulateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/SimulateAlerts_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/ + * SimulateAlerts_example.json */ /** * Sample code: Simulate security alerts on a subscription. - * + * * @param manager Entry point to SecurityManager. */ - public static void simulateSecurityAlertsOnASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .alerts() - .simulate( - "centralus", - new AlertSimulatorRequestBody() - .withProperties( - new AlertSimulatorBundlesRequestProperties() - .withBundles( - Arrays - .asList( - BundleType.APP_SERVICES, - BundleType.DNS, - BundleType.KEY_VAULTS, - BundleType.KUBERNETES_SERVICE, - BundleType.RESOURCE_MANAGER, - BundleType.SQL_SERVERS, - BundleType.STORAGE_ACCOUNTS, - BundleType.VIRTUAL_MACHINES, - BundleType.COSMOS_DBS))), - com.azure.core.util.Context.NONE); + public static void + simulateSecurityAlertsOnASubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.alerts().simulate("centralus", + new AlertSimulatorRequestBody().withProperties(new AlertSimulatorBundlesRequestProperties() + .withBundles(Arrays.asList(BundleType.APP_SERVICES, BundleType.DNS, BundleType.KEY_VAULTS, + BundleType.KUBERNETES_SERVICE, BundleType.RESOURCE_MANAGER, BundleType.SQL_SERVERS, + BundleType.STORAGE_ACCOUNTS, BundleType.VIRTUAL_MACHINES, BundleType.COSMOS_DBS))), + com.azure.core.util.Context.NONE); } } ``` @@ -907,25 +930,23 @@ public final class AlertsSimulateSamples { ### Alerts_UpdateResourceGroupLevelStateToActivate ```java -/** Samples for Alerts UpdateResourceGroupLevelStateToActivate. */ +/** + * Samples for Alerts UpdateResourceGroupLevelStateToActivate. + */ public final class AlertsUpdateResourceGroupLevelStateToActivateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertResourceGroupLocation_activate_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/ + * UpdateAlertResourceGroupLocation_activate_example.json */ /** * Sample code: Update security alert state on a resource group from a security data location. - * + * * @param manager Entry point to SecurityManager. */ public static void updateSecurityAlertStateOnAResourceGroupFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .alerts() - .updateResourceGroupLevelStateToActivateWithResponse( - "myRg2", - "westeurope", - "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", - com.azure.core.util.Context.NONE); + manager.alerts().updateResourceGroupLevelStateToActivateWithResponse("myRg2", "westeurope", + "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", com.azure.core.util.Context.NONE); } } ``` @@ -933,25 +954,23 @@ public final class AlertsUpdateResourceGroupLevelStateToActivateSamples { ### Alerts_UpdateResourceGroupLevelStateToDismiss ```java -/** Samples for Alerts UpdateResourceGroupLevelStateToDismiss. */ +/** + * Samples for Alerts UpdateResourceGroupLevelStateToDismiss. + */ public final class AlertsUpdateResourceGroupLevelStateToDismissSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertResourceGroupLocation_dismiss_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/ + * UpdateAlertResourceGroupLocation_dismiss_example.json */ /** * Sample code: Update security alert state on a resource group from a security data location. - * + * * @param manager Entry point to SecurityManager. */ public static void updateSecurityAlertStateOnAResourceGroupFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .alerts() - .updateResourceGroupLevelStateToDismissWithResponse( - "myRg2", - "westeurope", - "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", - com.azure.core.util.Context.NONE); + manager.alerts().updateResourceGroupLevelStateToDismissWithResponse("myRg2", "westeurope", + "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", com.azure.core.util.Context.NONE); } } ``` @@ -959,25 +978,23 @@ public final class AlertsUpdateResourceGroupLevelStateToDismissSamples { ### Alerts_UpdateResourceGroupLevelStateToInProgress ```java -/** Samples for Alerts UpdateResourceGroupLevelStateToInProgress. */ +/** + * Samples for Alerts UpdateResourceGroupLevelStateToInProgress. + */ public final class AlertsUpdateResourceGroupLevelStateToInProgressSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertResourceGroupLocation_inProgress_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/ + * UpdateAlertResourceGroupLocation_inProgress_example.json */ /** * Sample code: Update security alert state on a resource group from a security data location. - * + * * @param manager Entry point to SecurityManager. */ public static void updateSecurityAlertStateOnAResourceGroupFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .alerts() - .updateResourceGroupLevelStateToInProgressWithResponse( - "myRg2", - "westeurope", - "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", - com.azure.core.util.Context.NONE); + manager.alerts().updateResourceGroupLevelStateToInProgressWithResponse("myRg2", "westeurope", + "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", com.azure.core.util.Context.NONE); } } ``` @@ -985,25 +1002,23 @@ public final class AlertsUpdateResourceGroupLevelStateToInProgressSamples { ### Alerts_UpdateResourceGroupLevelStateToResolve ```java -/** Samples for Alerts UpdateResourceGroupLevelStateToResolve. */ +/** + * Samples for Alerts UpdateResourceGroupLevelStateToResolve. + */ public final class AlertsUpdateResourceGroupLevelStateToResolveSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertResourceGroupLocation_resolve_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/ + * UpdateAlertResourceGroupLocation_resolve_example.json */ /** * Sample code: Update security alert state on a resource group from a security data location. - * + * * @param manager Entry point to SecurityManager. */ public static void updateSecurityAlertStateOnAResourceGroupFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .alerts() - .updateResourceGroupLevelStateToResolveWithResponse( - "myRg2", - "westeurope", - "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", - com.azure.core.util.Context.NONE); + manager.alerts().updateResourceGroupLevelStateToResolveWithResponse("myRg2", "westeurope", + "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", com.azure.core.util.Context.NONE); } } ``` @@ -1011,24 +1026,23 @@ public final class AlertsUpdateResourceGroupLevelStateToResolveSamples { ### Alerts_UpdateSubscriptionLevelStateToActivate ```java -/** Samples for Alerts UpdateSubscriptionLevelStateToActivate. */ +/** + * Samples for Alerts UpdateSubscriptionLevelStateToActivate. + */ public final class AlertsUpdateSubscriptionLevelStateToActivateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertSubscriptionLocation_activate_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/ + * UpdateAlertSubscriptionLocation_activate_example.json */ /** * Sample code: Update security alert state on a subscription from a security data location. - * + * * @param manager Entry point to SecurityManager. */ public static void updateSecurityAlertStateOnASubscriptionFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .alerts() - .updateSubscriptionLevelStateToActivateWithResponse( - "westeurope", - "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", - com.azure.core.util.Context.NONE); + manager.alerts().updateSubscriptionLevelStateToActivateWithResponse("westeurope", + "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", com.azure.core.util.Context.NONE); } } ``` @@ -1036,24 +1050,23 @@ public final class AlertsUpdateSubscriptionLevelStateToActivateSamples { ### Alerts_UpdateSubscriptionLevelStateToDismiss ```java -/** Samples for Alerts UpdateSubscriptionLevelStateToDismiss. */ +/** + * Samples for Alerts UpdateSubscriptionLevelStateToDismiss. + */ public final class AlertsUpdateSubscriptionLevelStateToDismissSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertSubscriptionLocation_dismiss_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/ + * UpdateAlertSubscriptionLocation_dismiss_example.json */ /** * Sample code: Update security alert state on a subscription from a security data location. - * + * * @param manager Entry point to SecurityManager. */ public static void updateSecurityAlertStateOnASubscriptionFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .alerts() - .updateSubscriptionLevelStateToDismissWithResponse( - "westeurope", - "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", - com.azure.core.util.Context.NONE); + manager.alerts().updateSubscriptionLevelStateToDismissWithResponse("westeurope", + "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", com.azure.core.util.Context.NONE); } } ``` @@ -1061,24 +1074,23 @@ public final class AlertsUpdateSubscriptionLevelStateToDismissSamples { ### Alerts_UpdateSubscriptionLevelStateToInProgress ```java -/** Samples for Alerts UpdateSubscriptionLevelStateToInProgress. */ +/** + * Samples for Alerts UpdateSubscriptionLevelStateToInProgress. + */ public final class AlertsUpdateSubscriptionLevelStateToInProgressSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertSubscriptionLocation_inProgress_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/ + * UpdateAlertSubscriptionLocation_inProgress_example.json */ /** * Sample code: Update security alert state on a subscription from a security data location. - * + * * @param manager Entry point to SecurityManager. */ public static void updateSecurityAlertStateOnASubscriptionFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .alerts() - .updateSubscriptionLevelStateToInProgressWithResponse( - "westeurope", - "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", - com.azure.core.util.Context.NONE); + manager.alerts().updateSubscriptionLevelStateToInProgressWithResponse("westeurope", + "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", com.azure.core.util.Context.NONE); } } ``` @@ -1086,24 +1098,23 @@ public final class AlertsUpdateSubscriptionLevelStateToInProgressSamples { ### Alerts_UpdateSubscriptionLevelStateToResolve ```java -/** Samples for Alerts UpdateSubscriptionLevelStateToResolve. */ +/** + * Samples for Alerts UpdateSubscriptionLevelStateToResolve. + */ public final class AlertsUpdateSubscriptionLevelStateToResolveSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertSubscriptionLocation_resolve_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/ + * UpdateAlertSubscriptionLocation_resolve_example.json */ /** * Sample code: Update security alert state on a subscription from a security data location. - * + * * @param manager Entry point to SecurityManager. */ public static void updateSecurityAlertStateOnASubscriptionFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .alerts() - .updateSubscriptionLevelStateToResolveWithResponse( - "westeurope", - "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", - com.azure.core.util.Context.NONE); + manager.alerts().updateSubscriptionLevelStateToResolveWithResponse("westeurope", + "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", com.azure.core.util.Context.NONE); } } ``` @@ -1111,18 +1122,22 @@ public final class AlertsUpdateSubscriptionLevelStateToResolveSamples { ### AlertsSuppressionRules_Delete ```java -/** Samples for AlertsSuppressionRules Delete. */ +/** + * Samples for AlertsSuppressionRules Delete. + */ public final class AlertsSuppressionRulesDeleteSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/DeleteAlertsSuppressionRule_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/ + * AlertsSuppressionRules/DeleteAlertsSuppressionRule_example.json */ /** * Sample code: Delete suppression rule data for a subscription. - * + * * @param manager Entry point to SecurityManager. */ - public static void deleteSuppressionRuleDataForASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void + deleteSuppressionRuleDataForASubscription(com.azure.resourcemanager.security.SecurityManager manager) { manager.alertsSuppressionRules().deleteWithResponse("dismissIpAnomalyAlerts", com.azure.core.util.Context.NONE); } } @@ -1131,18 +1146,22 @@ public final class AlertsSuppressionRulesDeleteSamples { ### AlertsSuppressionRules_Get ```java -/** Samples for AlertsSuppressionRules Get. */ +/** + * Samples for AlertsSuppressionRules Get. + */ public final class AlertsSuppressionRulesGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/GetAlertsSuppressionRule_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/ + * AlertsSuppressionRules/GetAlertsSuppressionRule_example.json */ /** * Sample code: Get suppression alert rule for subscription. - * + * * @param manager Entry point to SecurityManager. */ - public static void getSuppressionAlertRuleForSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void + getSuppressionAlertRuleForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { manager.alertsSuppressionRules().getWithResponse("dismissIpAnomalyAlerts", com.azure.core.util.Context.NONE); } } @@ -1151,14 +1170,18 @@ public final class AlertsSuppressionRulesGetSamples { ### AlertsSuppressionRules_List ```java -/** Samples for AlertsSuppressionRules List. */ +/** + * Samples for AlertsSuppressionRules List. + */ public final class AlertsSuppressionRulesListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/GetAlertsSuppressionRules_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/ + * AlertsSuppressionRules/GetAlertsSuppressionRules_example.json */ /** * Sample code: Get suppression rules for subscription. - * + * * @param manager Entry point to SecurityManager. */ public static void getSuppressionRulesForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { @@ -1166,11 +1189,13 @@ public final class AlertsSuppressionRulesListSamples { } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/GetAlertsSuppressionRulesWithAlertType_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/ + * AlertsSuppressionRules/GetAlertsSuppressionRulesWithAlertType_example.json */ /** * Sample code: Get suppression alert rule for subscription, filtered by AlertType. - * + * * @param manager Entry point to SecurityManager. */ public static void getSuppressionAlertRuleForSubscriptionFilteredByAlertType( @@ -1195,50 +1220,37 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for AlertsSuppressionRules Update. */ +/** + * Samples for AlertsSuppressionRules Update. + */ public final class AlertsSuppressionRulesUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/PutAlertsSuppressionRule_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/ + * AlertsSuppressionRules/PutAlertsSuppressionRule_example.json */ /** * Sample code: Update or create suppression rule for subscription. - * + * * @param manager Entry point to SecurityManager. */ public static void updateOrCreateSuppressionRuleForSubscription( com.azure.resourcemanager.security.SecurityManager manager) throws IOException { - manager - .alertsSuppressionRules() - .updateWithResponse( - "dismissIpAnomalyAlerts", - new AlertsSuppressionRuleInner() - .withAlertType("IpAnomaly") - .withExpirationDateUtc(OffsetDateTime.parse("2019-12-01T19:50:47.083633Z")) - .withReason("FalsePositive") - .withState(RuleState.ENABLED) - .withComment("Test VM") - .withSuppressionAlertsScope( - new SuppressionAlertsScope() - .withAllOf( - Arrays - .asList( - new ScopeElement() - .withField("entities.ip.address") - .withAdditionalProperties( - mapOf( - "in", - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "[\"104.215.95.187\",\"52.164.206.56\"]", - Object.class, - SerializerEncoding.JSON))), - new ScopeElement() - .withField("entities.process.commandline") - .withAdditionalProperties(mapOf("contains", "POWERSHELL.EXE"))))), - com.azure.core.util.Context.NONE); - } - + manager.alertsSuppressionRules().updateWithResponse("dismissIpAnomalyAlerts", + new AlertsSuppressionRuleInner().withAlertType("IpAnomaly") + .withExpirationDateUtc(OffsetDateTime.parse("2019-12-01T19:50:47.083633Z")).withReason("FalsePositive") + .withState(RuleState.ENABLED).withComment("Test VM") + .withSuppressionAlertsScope(new SuppressionAlertsScope().withAllOf(Arrays.asList( + new ScopeElement().withField("entities.ip.address") + .withAdditionalProperties(mapOf("in", + SerializerFactory.createDefaultManagementSerializerAdapter().deserialize( + "[\"104.215.95.187\",\"52.164.206.56\"]", Object.class, SerializerEncoding.JSON))), + new ScopeElement().withField("entities.process.commandline") + .withAdditionalProperties(mapOf("contains", "POWERSHELL.EXE"))))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -1257,20 +1269,23 @@ public final class AlertsSuppressionRulesUpdateSamples { ```java import com.azure.resourcemanager.security.models.ConnectionType; -/** Samples for AllowedConnections Get. */ +/** + * Samples for AllowedConnections Get. + */ public final class AllowedConnectionsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AllowedConnections/GetAllowedConnections_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AllowedConnections/ + * GetAllowedConnections_example.json */ /** * Sample code: Get allowed connections. - * + * * @param manager Entry point to SecurityManager. */ public static void getAllowedConnections(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .allowedConnections() - .getWithResponse("myResourceGroup", "centralus", ConnectionType.INTERNAL, com.azure.core.util.Context.NONE); + manager.allowedConnections().getWithResponse("myResourceGroup", "centralus", ConnectionType.INTERNAL, + com.azure.core.util.Context.NONE); } } ``` @@ -1278,18 +1293,22 @@ public final class AllowedConnectionsGetSamples { ### AllowedConnections_List ```java -/** Samples for AllowedConnections List. */ +/** + * Samples for AllowedConnections List. + */ public final class AllowedConnectionsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AllowedConnections/GetAllowedConnectionsSubscription_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AllowedConnections/ + * GetAllowedConnectionsSubscription_example.json */ /** * Sample code: Get allowed connections on a subscription. - * + * * @param manager Entry point to SecurityManager. */ - public static void getAllowedConnectionsOnASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void + getAllowedConnectionsOnASubscription(com.azure.resourcemanager.security.SecurityManager manager) { manager.allowedConnections().list(com.azure.core.util.Context.NONE); } } @@ -1298,14 +1317,18 @@ public final class AllowedConnectionsListSamples { ### AllowedConnections_ListByHomeRegion ```java -/** Samples for AllowedConnections ListByHomeRegion. */ +/** + * Samples for AllowedConnections ListByHomeRegion. + */ public final class AllowedConnectionsListByHomeRegionSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AllowedConnections/GetAllowedConnectionsSubscriptionLocation_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AllowedConnections/ + * GetAllowedConnectionsSubscriptionLocation_example.json */ /** * Sample code: Get allowed connections on a subscription from security data location. - * + * * @param manager Entry point to SecurityManager. */ public static void getAllowedConnectionsOnASubscriptionFromSecurityDataLocation( @@ -1315,86 +1338,152 @@ public final class AllowedConnectionsListByHomeRegionSamples { } ``` -### ApiCollection_Get +### ApiCollections_GetByAzureApiManagementService ```java -/** Samples for ApiCollection Get. */ -public final class ApiCollectionGetSamples { +/** + * Samples for ApiCollections GetByAzureApiManagementService. + */ +public final class ApiCollectionsGetByAzureApiManagementServiceSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-11-20-preview/examples/ApiCollections/APICollection_Get_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2023-11-15/examples/ApiCollections/ + * APICollections_GetByAzureApiManagementService_example.json */ /** - * Sample code: Gets an Azure API Management API if it has been onboarded to Defender for APIs. - * + * Sample code: Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs. + * * @param manager Entry point to SecurityManager. */ - public static void getsAnAzureAPIManagementAPIIfItHasBeenOnboardedToDefenderForAPIs( + public static void getsAnAzureAPIManagementAPIIfItHasBeenOnboardedToMicrosoftDefenderForAPIs( com.azure.resourcemanager.security.SecurityManager manager) { - manager.apiCollections().getWithResponse("rg1", "apimService1", "echo-api", com.azure.core.util.Context.NONE); + manager.apiCollections().getByAzureApiManagementServiceWithResponse("rg1", "apimService1", "echo-api", + com.azure.core.util.Context.NONE); } } ``` -### ApiCollection_List +### ApiCollections_List ```java -/** Samples for ApiCollection List. */ -public final class ApiCollectionListSamples { +/** + * Samples for ApiCollections List. + */ +public final class ApiCollectionsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-11-20-preview/examples/ApiCollections/APICollection_List_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2023-11-15/examples/ApiCollections/ + * APICollections_ListBySubscription_example.json */ /** - * Sample code: Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. - * + * Sample code: Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender + * for APIs. + * * @param manager Entry point to SecurityManager. */ - public static void getsAListOfAzureAPIManagementAPIsThatHaveBeenOnboardedToDefenderForAPIs( + public static void getsAListOfAPICollectionsWithinASubscriptionThatHaveBeenOnboardedToMicrosoftDefenderForAPIs( com.azure.resourcemanager.security.SecurityManager manager) { - manager.apiCollections().list("rg1", "apimService1", com.azure.core.util.Context.NONE); + manager.apiCollections().list(com.azure.core.util.Context.NONE); } } ``` -### ApiCollectionOffboarding_Delete +### ApiCollections_ListByAzureApiManagementService ```java -/** Samples for ApiCollectionOffboarding Delete. */ -public final class ApiCollectionOffboardingDeleteSamples { +/** + * Samples for ApiCollections ListByAzureApiManagementService. + */ +public final class ApiCollectionsListByAzureApiManagementServiceSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-11-20-preview/examples/ApiCollections/APICollectionOffboarding_Delete_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2023-11-15/examples/ApiCollections/ + * APICollections_ListByAzureApiManagementService_example.json */ /** - * Sample code: Delete a security recommendation task on a resource. - * + * Sample code: Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs. + * + * @param manager Entry point to SecurityManager. + */ + public static void getsAListOfAzureAPIManagementAPIsThatHaveBeenOnboardedToMicrosoftDefenderForAPIs( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.apiCollections().listByAzureApiManagementService("rg1", "apimService1", + com.azure.core.util.Context.NONE); + } +} +``` + +### ApiCollections_ListByResourceGroup + +```java +/** + * Samples for ApiCollections ListByResourceGroup. + */ +public final class ApiCollectionsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2023-11-15/examples/ApiCollections/ + * APICollections_ListByResourceGroup_example.json + */ + /** + * Sample code: Gets a list of API collections within a resource group that have been onboarded to Microsoft + * Defender for APIs. + * + * @param manager Entry point to SecurityManager. + */ + public static void getsAListOfAPICollectionsWithinAResourceGroupThatHaveBeenOnboardedToMicrosoftDefenderForAPIs( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.apiCollections().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### ApiCollections_OffboardAzureApiManagementApi + +```java +/** + * Samples for ApiCollections OffboardAzureApiManagementApi. + */ +public final class ApiCollectionsOffboardAzureApiManagementApiSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2023-11-15/examples/ApiCollections/ + * APICollections_OffboardAzureApiManagementApi_example.json + */ + /** + * Sample code: Offboard an Azure API Management API from Microsoft Defender for APIs. + * * @param manager Entry point to SecurityManager. */ - public static void deleteASecurityRecommendationTaskOnAResource( + public static void offboardAnAzureAPIManagementAPIFromMicrosoftDefenderForAPIs( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .apiCollectionOffboardings() - .deleteWithResponse("rg1", "apimService1", "echo-api", com.azure.core.util.Context.NONE); + manager.apiCollections().offboardAzureApiManagementApiWithResponse("rg1", "apimService1", "echo-api", + com.azure.core.util.Context.NONE); } } ``` -### ApiCollectionOnboarding_Create +### ApiCollections_OnboardAzureApiManagementApi ```java -/** Samples for ApiCollectionOnboarding Create. */ -public final class ApiCollectionOnboardingCreateSamples { +/** + * Samples for ApiCollections OnboardAzureApiManagementApi. + */ +public final class ApiCollectionsOnboardAzureApiManagementApiSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-11-20-preview/examples/ApiCollections/APICollectionOnboarding_Create_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2023-11-15/examples/ApiCollections/ + * APICollections_OnboardAzureApiManagementApi_example.json */ /** - * Sample code: Onboard an Azure API Management API to Defender for APIs. - * + * Sample code: Onboard an Azure API Management API to Microsoft Defender for APIs. + * * @param manager Entry point to SecurityManager. */ - public static void onboardAnAzureAPIManagementAPIToDefenderForAPIs( + public static void onboardAnAzureAPIManagementAPIToMicrosoftDefenderForAPIs( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .apiCollectionOnboardings() - .createWithResponse("rg1", "apimService1", "echo-api", com.azure.core.util.Context.NONE); + manager.apiCollections().onboardAzureApiManagementApi("rg1", "apimService1", "echo-api", + com.azure.core.util.Context.NONE); } } ``` @@ -1408,33 +1497,28 @@ import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; import java.io.IOException; import java.util.Arrays; -/** Samples for ApplicationOperation CreateOrUpdate. */ +/** + * Samples for ApplicationOperation CreateOrUpdate. + */ public final class ApplicationOperationCreateOrUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/PutApplication_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/ + * PutApplication_example.json */ /** * Sample code: Create application. - * + * * @param manager Entry point to SecurityManager. */ public static void createApplication(com.azure.resourcemanager.security.SecurityManager manager) throws IOException { - manager - .applicationOperations() - .define("ad9a8e26-29d9-4829-bb30-e597a58cdbb8") - .withDisplayName("Admin's application") - .withDescription("An application on critical recommendations") + manager.applicationOperations().define("ad9a8e26-29d9-4829-bb30-e597a58cdbb8") + .withDisplayName("Admin's application").withDescription("An application on critical recommendations") .withSourceResourceType(ApplicationSourceResourceType.ASSESSMENTS) - .withConditionSets( - Arrays - .asList( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"conditions\":[{\"operator\":\"contains\",\"property\":\"$.Id\",\"value\":\"-bil-\"}]}", - Object.class, - SerializerEncoding.JSON))) + .withConditionSets(Arrays.asList(SerializerFactory.createDefaultManagementSerializerAdapter().deserialize( + "{\"conditions\":[{\"operator\":\"contains\",\"property\":\"$.Id\",\"value\":\"-bil-\"}]}", + Object.class, SerializerEncoding.JSON))) .create(); } } @@ -1443,20 +1527,23 @@ public final class ApplicationOperationCreateOrUpdateSamples { ### ApplicationOperation_Delete ```java -/** Samples for ApplicationOperation Delete. */ +/** + * Samples for ApplicationOperation Delete. + */ public final class ApplicationOperationDeleteSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/DeleteApplication_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/ + * DeleteApplication_example.json */ /** * Sample code: Delete security Application. - * + * * @param manager Entry point to SecurityManager. */ public static void deleteSecurityApplication(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .applicationOperations() - .deleteWithResponse("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); + manager.applicationOperations().deleteWithResponse("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + com.azure.core.util.Context.NONE); } } ``` @@ -1464,21 +1551,24 @@ public final class ApplicationOperationDeleteSamples { ### ApplicationOperation_Get ```java -/** Samples for ApplicationOperation Get. */ +/** + * Samples for ApplicationOperation Get. + */ public final class ApplicationOperationGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/GetApplication_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/ + * GetApplication_example.json */ /** * Sample code: Get security application by specific applicationId. - * + * * @param manager Entry point to SecurityManager. */ - public static void getSecurityApplicationBySpecificApplicationId( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .applicationOperations() - .getWithResponse("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); + public static void + getSecurityApplicationBySpecificApplicationId(com.azure.resourcemanager.security.SecurityManager manager) { + manager.applicationOperations().getWithResponse("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + com.azure.core.util.Context.NONE); } } ``` @@ -1486,18 +1576,22 @@ public final class ApplicationOperationGetSamples { ### Applications_List ```java -/** Samples for Applications List. */ +/** + * Samples for Applications List. + */ public final class ApplicationsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/ListBySubscriptionApplications_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/ + * ListBySubscriptionApplications_example.json */ /** * Sample code: List applications security by subscription level scope. - * + * * @param manager Entry point to SecurityManager. */ - public static void listApplicationsSecurityBySubscriptionLevelScope( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void + listApplicationsSecurityBySubscriptionLevelScope(com.azure.resourcemanager.security.SecurityManager manager) { manager.applications().list(com.azure.core.util.Context.NONE); } } @@ -1510,26 +1604,26 @@ import com.azure.resourcemanager.security.models.AssessmentStatus; import com.azure.resourcemanager.security.models.AssessmentStatusCode; import com.azure.resourcemanager.security.models.AzureResourceDetails; -/** Samples for Assessments CreateOrUpdate. */ +/** + * Samples for Assessments CreateOrUpdate. + */ public final class AssessmentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/PutAssessment_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/ + * PutAssessment_example.json */ /** * Sample code: Create security recommendation task on a resource. - * + * * @param manager Entry point to SecurityManager. */ - public static void createSecurityRecommendationTaskOnAResource( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .assessments() - .define("8bb8be0a-6010-4789-812f-e4d661c4ed0e") - .withExistingResourceId( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2") + public static void + createSecurityRecommendationTaskOnAResource(com.azure.resourcemanager.security.SecurityManager manager) { + manager.assessments().define("8bb8be0a-6010-4789-812f-e4d661c4ed0e").withExistingResourceId( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2") .withStatus(new AssessmentStatus().withCode(AssessmentStatusCode.HEALTHY)) - .withResourceDetails(new AzureResourceDetails()) - .create(); + .withResourceDetails(new AzureResourceDetails()).create(); } } ``` @@ -1537,24 +1631,25 @@ public final class AssessmentsCreateOrUpdateSamples { ### Assessments_Delete ```java -/** Samples for Assessments Delete. */ +/** + * Samples for Assessments Delete. + */ public final class AssessmentsDeleteSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/DeleteAssessment_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/ + * DeleteAssessment_example.json */ /** * Sample code: Delete a security recommendation task on a resource. - * + * * @param manager Entry point to SecurityManager. */ - public static void deleteASecurityRecommendationTaskOnAResource( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .assessments() - .deleteByResourceGroupWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", - "8bb8be0a-6010-4789-812f-e4d661c4ed0e", - com.azure.core.util.Context.NONE); + public static void + deleteASecurityRecommendationTaskOnAResource(com.azure.resourcemanager.security.SecurityManager manager) { + manager.assessments().deleteByResourceGroupWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", + "8bb8be0a-6010-4789-812f-e4d661c4ed0e", com.azure.core.util.Context.NONE); } } ``` @@ -1564,44 +1659,42 @@ public final class AssessmentsDeleteSamples { ```java import com.azure.resourcemanager.security.models.ExpandEnum; -/** Samples for Assessments Get. */ +/** + * Samples for Assessments Get. + */ public final class AssessmentsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/GetAssessmentWithExpand_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/ + * GetAssessmentWithExpand_example.json */ /** * Sample code: Get security recommendation task from security data location with expand parameter. - * + * * @param manager Entry point to SecurityManager. */ public static void getSecurityRecommendationTaskFromSecurityDataLocationWithExpandParameter( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .assessments() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", - "21300918-b2e3-0346-785f-c77ff57d243b", - ExpandEnum.LINKS, - com.azure.core.util.Context.NONE); + manager.assessments().getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", + "21300918-b2e3-0346-785f-c77ff57d243b", ExpandEnum.LINKS, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/GetAssessment_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/ + * GetAssessment_example.json */ /** * Sample code: Get security recommendation task from security data location. - * + * * @param manager Entry point to SecurityManager. */ public static void getSecurityRecommendationTaskFromSecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .assessments() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", - "21300918-b2e3-0346-785f-c77ff57d243b", - null, - com.azure.core.util.Context.NONE); + manager.assessments().getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", + "21300918-b2e3-0346-785f-c77ff57d243b", null, com.azure.core.util.Context.NONE); } } ``` @@ -1609,20 +1702,23 @@ public final class AssessmentsGetSamples { ### Assessments_List ```java -/** Samples for Assessments List. */ +/** + * Samples for Assessments List. + */ public final class AssessmentsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/ListAssessments_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/ + * ListAssessments_example.json */ /** * Sample code: List security assessments. - * + * * @param manager Entry point to SecurityManager. */ public static void listSecurityAssessments(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .assessments() - .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); + manager.assessments().list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + com.azure.core.util.Context.NONE); } } ``` @@ -1638,36 +1734,32 @@ import com.azure.resourcemanager.security.models.Threats; import com.azure.resourcemanager.security.models.UserImpact; import java.util.Arrays; -/** Samples for AssessmentsMetadata CreateInSubscription. */ +/** + * Samples for AssessmentsMetadata CreateInSubscription. + */ public final class AssessmentsMetadataCreateInSubscriptionSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/CreateAssessmentsMetadata_subscription_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/ + * CreateAssessmentsMetadata_subscription_example.json */ /** * Sample code: Create security assessment metadata for subscription. - * + * * @param manager Entry point to SecurityManager. */ - public static void createSecurityAssessmentMetadataForSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .assessmentsMetadatas() - .define("ca039e75-a276-4175-aebc-bcd41e4b14b7") + public static void + createSecurityAssessmentMetadataForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.assessmentsMetadatas().define("ca039e75-a276-4175-aebc-bcd41e4b14b7") .withDisplayName("Install endpoint protection solution on virtual machine scale sets") .withDescription( - "Install an endpoint protection solution on your virtual machines scale sets, to protect them from" - + " threats and vulnerabilities.") + "Install an endpoint protection solution on your virtual machines scale sets, to protect them from threats and vulnerabilities.") .withRemediationDescription( - "To install an endpoint protection solution: 1. Follow" - + " the instructions in How do I turn on antimalware in my virtual machine scale set") - .withCategories(Arrays.asList(Categories.COMPUTE)) - .withSeverity(Severity.MEDIUM) - .withUserImpact(UserImpact.LOW) - .withImplementationEffort(ImplementationEffort.LOW) + "To install an endpoint protection solution: 1. Follow the instructions in How do I turn on antimalware in my virtual machine scale set") + .withCategories(Arrays.asList(Categories.COMPUTE)).withSeverity(Severity.MEDIUM) + .withUserImpact(UserImpact.LOW).withImplementationEffort(ImplementationEffort.LOW) .withThreats(Arrays.asList(Threats.DATA_EXFILTRATION, Threats.DATA_SPILLAGE, Threats.MALICIOUS_INSIDER)) - .withAssessmentType(AssessmentType.CUSTOMER_MANAGED) - .create(); + .withAssessmentType(AssessmentType.CUSTOMER_MANAGED).create(); } } ``` @@ -1675,21 +1767,24 @@ public final class AssessmentsMetadataCreateInSubscriptionSamples { ### AssessmentsMetadata_DeleteInSubscription ```java -/** Samples for AssessmentsMetadata DeleteInSubscription. */ +/** + * Samples for AssessmentsMetadata DeleteInSubscription. + */ public final class AssessmentsMetadataDeleteInSubscriptionSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/DeleteAssessmentsMetadata_subscription_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/ + * DeleteAssessmentsMetadata_subscription_example.json */ /** * Sample code: Delete a security assessment metadata for subscription. - * + * * @param manager Entry point to SecurityManager. */ - public static void deleteASecurityAssessmentMetadataForSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .assessmentsMetadatas() - .deleteInSubscriptionWithResponse("ca039e75-a276-4175-aebc-bcd41e4b14b7", com.azure.core.util.Context.NONE); + public static void + deleteASecurityAssessmentMetadataForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.assessmentsMetadatas().deleteInSubscriptionWithResponse("ca039e75-a276-4175-aebc-bcd41e4b14b7", + com.azure.core.util.Context.NONE); } } ``` @@ -1697,20 +1792,23 @@ public final class AssessmentsMetadataDeleteInSubscriptionSamples { ### AssessmentsMetadata_Get ```java -/** Samples for AssessmentsMetadata Get. */ +/** + * Samples for AssessmentsMetadata Get. + */ public final class AssessmentsMetadataGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/GetAssessmentsMetadata_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/ + * GetAssessmentsMetadata_example.json */ /** * Sample code: Get security assessment metadata. - * + * * @param manager Entry point to SecurityManager. */ public static void getSecurityAssessmentMetadata(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .assessmentsMetadatas() - .getWithResponse("21300918-b2e3-0346-785f-c77ff57d243b", com.azure.core.util.Context.NONE); + manager.assessmentsMetadatas().getWithResponse("21300918-b2e3-0346-785f-c77ff57d243b", + com.azure.core.util.Context.NONE); } } ``` @@ -1718,21 +1816,24 @@ public final class AssessmentsMetadataGetSamples { ### AssessmentsMetadata_GetInSubscription ```java -/** Samples for AssessmentsMetadata GetInSubscription. */ +/** + * Samples for AssessmentsMetadata GetInSubscription. + */ public final class AssessmentsMetadataGetInSubscriptionSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/GetAssessmentsMetadata_subscription_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/ + * GetAssessmentsMetadata_subscription_example.json */ /** * Sample code: Get security assessment metadata for subscription. - * + * * @param manager Entry point to SecurityManager. */ - public static void getSecurityAssessmentMetadataForSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .assessmentsMetadatas() - .getInSubscriptionWithResponse("21300918-b2e3-0346-785f-c77ff57d243b", com.azure.core.util.Context.NONE); + public static void + getSecurityAssessmentMetadataForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.assessmentsMetadatas().getInSubscriptionWithResponse("21300918-b2e3-0346-785f-c77ff57d243b", + com.azure.core.util.Context.NONE); } } ``` @@ -1740,14 +1841,18 @@ public final class AssessmentsMetadataGetInSubscriptionSamples { ### AssessmentsMetadata_List ```java -/** Samples for AssessmentsMetadata List. */ +/** + * Samples for AssessmentsMetadata List. + */ public final class AssessmentsMetadataListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/ListAssessmentsMetadata_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/ + * ListAssessmentsMetadata_example.json */ /** * Sample code: List security assessment metadata. - * + * * @param manager Entry point to SecurityManager. */ public static void listSecurityAssessmentMetadata(com.azure.resourcemanager.security.SecurityManager manager) { @@ -1759,18 +1864,22 @@ public final class AssessmentsMetadataListSamples { ### AssessmentsMetadata_ListBySubscription ```java -/** Samples for AssessmentsMetadata ListBySubscription. */ +/** + * Samples for AssessmentsMetadata ListBySubscription. + */ public final class AssessmentsMetadataListBySubscriptionSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/ListAssessmentsMetadata_subscription_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/ + * ListAssessmentsMetadata_subscription_example.json */ /** * Sample code: List security assessment metadata for subscription. - * + * * @param manager Entry point to SecurityManager. */ - public static void listSecurityAssessmentMetadataForSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void + listSecurityAssessmentMetadataForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { manager.assessmentsMetadatas().listBySubscription(com.azure.core.util.Context.NONE); } } @@ -1781,18 +1890,22 @@ public final class AssessmentsMetadataListBySubscriptionSamples { ```java import com.azure.resourcemanager.security.models.AutoProvision; -/** Samples for AutoProvisioningSettings Create. */ +/** + * Samples for AutoProvisioningSettings Create. + */ public final class AutoProvisioningSettingsCreateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/AutoProvisioningSettings/CreateAutoProvisioningSettingsSubscription_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/ + * AutoProvisioningSettings/CreateAutoProvisioningSettingsSubscription_example.json */ /** * Sample code: Create auto provisioning settings for subscription. - * + * * @param manager Entry point to SecurityManager. */ - public static void createAutoProvisioningSettingsForSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void + createAutoProvisioningSettingsForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { manager.autoProvisioningSettings().define("default").withAutoProvision(AutoProvision.ON).create(); } } @@ -1801,18 +1914,22 @@ public final class AutoProvisioningSettingsCreateSamples { ### AutoProvisioningSettings_Get ```java -/** Samples for AutoProvisioningSettings Get. */ +/** + * Samples for AutoProvisioningSettings Get. + */ public final class AutoProvisioningSettingsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/AutoProvisioningSettings/GetAutoProvisioningSettingSubscription_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/ + * AutoProvisioningSettings/GetAutoProvisioningSettingSubscription_example.json */ /** * Sample code: Get an auto provisioning setting for subscription. - * + * * @param manager Entry point to SecurityManager. */ - public static void getAnAutoProvisioningSettingForSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void + getAnAutoProvisioningSettingForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { manager.autoProvisioningSettings().getWithResponse("default", com.azure.core.util.Context.NONE); } } @@ -1821,18 +1938,22 @@ public final class AutoProvisioningSettingsGetSamples { ### AutoProvisioningSettings_List ```java -/** Samples for AutoProvisioningSettings List. */ +/** + * Samples for AutoProvisioningSettings List. + */ public final class AutoProvisioningSettingsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/AutoProvisioningSettings/GetAutoProvisioningSettingsSubscription_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/ + * AutoProvisioningSettings/GetAutoProvisioningSettingsSubscription_example.json */ /** * Sample code: Get auto provisioning settings for subscription. - * + * * @param manager Entry point to SecurityManager. */ - public static void getAutoProvisioningSettingsForSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void + getAutoProvisioningSettingsForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { manager.autoProvisioningSettings().list(com.azure.core.util.Context.NONE); } } @@ -1853,162 +1974,97 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for Automations CreateOrUpdate. */ +/** + * Samples for Automations CreateOrUpdate. + */ public final class AutomationsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/PutAutomationAllAssessments_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/Automations/ + * PutAutomationAllAssessments_example.json */ /** * Sample code: Create or update a security automation for all assessments (including all severities). - * + * * @param manager Entry point to SecurityManager. */ public static void createOrUpdateASecurityAutomationForAllAssessmentsIncludingAllSeverities( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .automations() - .define("exampleAutomation") - .withRegion("Central US") - .withExistingResourceGroup("exampleResourceGroup") - .withTags(mapOf()) + manager.automations().define("exampleAutomation").withRegion("Central US") + .withExistingResourceGroup("exampleResourceGroup").withTags(mapOf()) .withDescription( - "An example of a security automation that triggers one LogicApp resource (myTest1) on any security" - + " assessment") + "An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment") .withIsEnabled(true) - .withScopes( - Arrays - .asList( - new AutomationScope() - .withDescription( - "A description that helps to identify this scope - for example: security assessments" - + " that relate to the resource group myResourceGroup within the subscription" - + " a5caac9c-5c04-49af-b3d0-e204f40345d5") - .withScopePath( - "/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"))) + .withScopes(Arrays.asList(new AutomationScope().withDescription( + "A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5") + .withScopePath("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"))) .withSources(Arrays.asList(new AutomationSource().withEventSource(EventSource.ASSESSMENTS))) - .withActions( - Arrays - .asList( - new AutomationActionLogicApp() - .withLogicAppResourceId( - "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") - .withUri("https://exampleTriggerUri1.com"))) + .withActions(Arrays.asList(new AutomationActionLogicApp().withLogicAppResourceId( + "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") + .withUri("https://exampleTriggerUri1.com"))) .create(); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/PutDisableAutomation_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/Automations/ + * PutDisableAutomation_example.json */ /** * Sample code: Disable or enable a security automation. - * + * * @param manager Entry point to SecurityManager. */ public static void disableOrEnableASecurityAutomation(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .automations() - .define("exampleAutomation") - .withRegion("Central US") - .withExistingResourceGroup("exampleResourceGroup") - .withTags(mapOf()) + manager.automations().define("exampleAutomation").withRegion("Central US") + .withExistingResourceGroup("exampleResourceGroup").withTags(mapOf()) .withDescription( - "An example of a security automation that triggers one LogicApp resource (myTest1) on any security" - + " assessment of type customAssessment") + "An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment of type customAssessment") .withIsEnabled(false) - .withScopes( - Arrays - .asList( - new AutomationScope() - .withDescription( - "A description that helps to identify this scope - for example: security assessments" - + " that relate to the resource group myResourceGroup within the subscription" - + " a5caac9c-5c04-49af-b3d0-e204f40345d5") - .withScopePath( - "/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"))) - .withSources( - Arrays - .asList( - new AutomationSource() - .withEventSource(EventSource.ASSESSMENTS) - .withRuleSets( - Arrays - .asList( - new AutomationRuleSet() - .withRules( - Arrays - .asList( - new AutomationTriggeringRule() - .withPropertyJPath("$.Entity.AssessmentType") - .withPropertyType(PropertyType.STRING) - .withExpectedValue("customAssessment") - .withOperator(Operator.EQUALS))))))) - .withActions( - Arrays - .asList( - new AutomationActionLogicApp() - .withLogicAppResourceId( - "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") - .withUri("https://exampleTriggerUri1.com"))) + .withScopes(Arrays.asList(new AutomationScope().withDescription( + "A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5") + .withScopePath("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"))) + .withSources(Arrays.asList(new AutomationSource().withEventSource(EventSource.ASSESSMENTS).withRuleSets( + Arrays.asList(new AutomationRuleSet().withRules(Arrays.asList(new AutomationTriggeringRule() + .withPropertyJPath("$.Entity.AssessmentType").withPropertyType(PropertyType.STRING) + .withExpectedValue("customAssessment").withOperator(Operator.EQUALS))))))) + .withActions(Arrays.asList(new AutomationActionLogicApp().withLogicAppResourceId( + "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") + .withUri("https://exampleTriggerUri1.com"))) .create(); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/PutAutomationHighSeverityAssessments_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/Automations/ + * PutAutomationHighSeverityAssessments_example.json */ /** * Sample code: Create or update a security automation for all high severity assessments. - * + * * @param manager Entry point to SecurityManager. */ public static void createOrUpdateASecurityAutomationForAllHighSeverityAssessments( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .automations() - .define("exampleAutomation") - .withRegion("Central US") - .withExistingResourceGroup("exampleResourceGroup") - .withTags(mapOf()) + manager.automations().define("exampleAutomation").withRegion("Central US") + .withExistingResourceGroup("exampleResourceGroup").withTags(mapOf()) .withDescription( - "An example of a security automation that triggers one LogicApp resource (myTest1) on any high severity" - + " security assessment") + "An example of a security automation that triggers one LogicApp resource (myTest1) on any high severity security assessment") .withIsEnabled(true) - .withScopes( - Arrays - .asList( - new AutomationScope() - .withDescription( - "A description that helps to identify this scope - for example: security assessments" - + " that relate to the resource group myResourceGroup within the subscription" - + " a5caac9c-5c04-49af-b3d0-e204f40345d5") - .withScopePath( - "/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"))) - .withSources( - Arrays - .asList( - new AutomationSource() - .withEventSource(EventSource.ASSESSMENTS) - .withRuleSets( - Arrays - .asList( - new AutomationRuleSet() - .withRules( - Arrays - .asList( - new AutomationTriggeringRule() - .withPropertyJPath("properties.metadata.severity") - .withPropertyType(PropertyType.STRING) - .withExpectedValue("High") - .withOperator(Operator.EQUALS))))))) - .withActions( - Arrays - .asList( - new AutomationActionLogicApp() - .withLogicAppResourceId( - "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") - .withUri("https://exampleTriggerUri1.com"))) + .withScopes(Arrays.asList(new AutomationScope().withDescription( + "A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5") + .withScopePath("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"))) + .withSources(Arrays.asList(new AutomationSource().withEventSource(EventSource.ASSESSMENTS).withRuleSets( + Arrays.asList(new AutomationRuleSet().withRules(Arrays.asList(new AutomationTriggeringRule() + .withPropertyJPath("properties.metadata.severity").withPropertyType(PropertyType.STRING) + .withExpectedValue("High").withOperator(Operator.EQUALS))))))) + .withActions(Arrays.asList(new AutomationActionLogicApp().withLogicAppResourceId( + "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") + .withUri("https://exampleTriggerUri1.com"))) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -2025,20 +2081,23 @@ public final class AutomationsCreateOrUpdateSamples { ### Automations_Delete ```java -/** Samples for Automations Delete. */ +/** + * Samples for Automations Delete. + */ public final class AutomationsDeleteSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/DeleteAutomation_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/Automations/ + * DeleteAutomation_example.json */ /** * Sample code: Delete a security automation. - * + * * @param manager Entry point to SecurityManager. */ public static void deleteASecurityAutomation(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .automations() - .deleteByResourceGroupWithResponse("myRg", "myAutomationName", com.azure.core.util.Context.NONE); + manager.automations().deleteByResourceGroupWithResponse("myRg", "myAutomationName", + com.azure.core.util.Context.NONE); } } ``` @@ -2046,21 +2105,23 @@ public final class AutomationsDeleteSamples { ### Automations_GetByResourceGroup ```java -/** Samples for Automations GetByResourceGroup. */ +/** + * Samples for Automations GetByResourceGroup. + */ public final class AutomationsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/GetAutomationResourceGroup_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/Automations/ + * GetAutomationResourceGroup_example.json */ /** * Sample code: Retrieve a security automation. - * + * * @param manager Entry point to SecurityManager. */ public static void retrieveASecurityAutomation(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .automations() - .getByResourceGroupWithResponse( - "exampleResourceGroup", "exampleAutomation", com.azure.core.util.Context.NONE); + manager.automations().getByResourceGroupWithResponse("exampleResourceGroup", "exampleAutomation", + com.azure.core.util.Context.NONE); } } ``` @@ -2068,18 +2129,22 @@ public final class AutomationsGetByResourceGroupSamples { ### Automations_List ```java -/** Samples for Automations List. */ +/** + * Samples for Automations List. + */ public final class AutomationsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/GetAutomationsSubscription_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/Automations/ + * GetAutomationsSubscription_example.json */ /** * Sample code: List all security automations of a specified subscription. - * + * * @param manager Entry point to SecurityManager. */ - public static void listAllSecurityAutomationsOfASpecifiedSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void + listAllSecurityAutomationsOfASpecifiedSubscription(com.azure.resourcemanager.security.SecurityManager manager) { manager.automations().list(com.azure.core.util.Context.NONE); } } @@ -2088,14 +2153,18 @@ public final class AutomationsListSamples { ### Automations_ListByResourceGroup ```java -/** Samples for Automations ListByResourceGroup. */ +/** + * Samples for Automations ListByResourceGroup. + */ public final class AutomationsListByResourceGroupSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/GetAutomationsResourceGroup_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/Automations/ + * GetAutomationsResourceGroup_example.json */ /** * Sample code: List all security automations of a specified resource group. - * + * * @param manager Entry point to SecurityManager. */ public static void listAllSecurityAutomationsOfASpecifiedResourceGroup( @@ -2105,6 +2174,61 @@ public final class AutomationsListByResourceGroupSamples { } ``` +### Automations_Update + +```java +import com.azure.resourcemanager.security.models.Automation; +import com.azure.resourcemanager.security.models.AutomationActionLogicApp; +import com.azure.resourcemanager.security.models.AutomationScope; +import com.azure.resourcemanager.security.models.AutomationSource; +import com.azure.resourcemanager.security.models.EventSource; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Automations Update. + */ +public final class AutomationsUpdateSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/Automations/ + * PatchAutomation_example.json + */ + /** + * Sample code: Update a security automation. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateASecurityAutomation(com.azure.resourcemanager.security.SecurityManager manager) { + Automation resource = manager.automations().getByResourceGroupWithResponse("exampleResourceGroup", + "exampleAutomation", com.azure.core.util.Context.NONE).getValue(); + resource.update().withTags(mapOf("Example", "exampleTag")).withDescription( + "An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment") + .withScopes(Arrays.asList(new AutomationScope().withDescription( + "A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5") + .withScopePath("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"))) + .withSources(Arrays.asList(new AutomationSource().withEventSource(EventSource.ASSESSMENTS))) + .withActions(Arrays.asList(new AutomationActionLogicApp().withLogicAppResourceId( + "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") + .withUri("https://exampleTriggerUri1.com"))) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + ### Automations_Validate ```java @@ -2121,67 +2245,41 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for Automations Validate. */ +/** + * Samples for Automations Validate. + */ public final class AutomationsValidateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/ValidateAutomation_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/Automations/ + * ValidateAutomation_example.json */ /** * Sample code: Validate the security automation model before create or update. - * + * * @param manager Entry point to SecurityManager. */ public static void validateTheSecurityAutomationModelBeforeCreateOrUpdate( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .automations() - .validateWithResponse( - "exampleResourceGroup", - "exampleAutomation", - new AutomationInner() - .withLocation("Central US") - .withTags(mapOf()) - .withDescription( - "An example of a security automation that triggers one LogicApp resource (myTest1) on any" - + " security assessment of type customAssessment") - .withIsEnabled(true) - .withScopes( - Arrays - .asList( - new AutomationScope() - .withDescription( - "A description that helps to identify this scope - for example: security" - + " assessments that relate to the resource group myResourceGroup within" - + " the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5") - .withScopePath( - "/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"))) - .withSources( - Arrays - .asList( - new AutomationSource() - .withEventSource(EventSource.ASSESSMENTS) - .withRuleSets( - Arrays - .asList( - new AutomationRuleSet() - .withRules( - Arrays - .asList( - new AutomationTriggeringRule() - .withPropertyJPath("$.Entity.AssessmentType") - .withPropertyType(PropertyType.STRING) - .withExpectedValue("customAssessment") - .withOperator(Operator.EQUALS))))))) - .withActions( - Arrays - .asList( - new AutomationActionLogicApp() - .withLogicAppResourceId( - "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") - .withUri("https://exampleTriggerUri1.com"))), - com.azure.core.util.Context.NONE); - } - + manager.automations().validateWithResponse("exampleResourceGroup", "exampleAutomation", new AutomationInner() + .withLocation("Central US").withTags(mapOf()) + .withDescription( + "An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment of type customAssessment") + .withIsEnabled(true) + .withScopes(Arrays.asList(new AutomationScope().withDescription( + "A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5") + .withScopePath("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"))) + .withSources(Arrays.asList(new AutomationSource().withEventSource(EventSource.ASSESSMENTS).withRuleSets( + Arrays.asList(new AutomationRuleSet().withRules(Arrays.asList(new AutomationTriggeringRule() + .withPropertyJPath("$.Entity.AssessmentType").withPropertyType(PropertyType.STRING) + .withExpectedValue("customAssessment").withOperator(Operator.EQUALS))))))) + .withActions(Arrays.asList(new AutomationActionLogicApp().withLogicAppResourceId( + "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") + .withUri("https://exampleTriggerUri1.com"))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -2195,399 +2293,780 @@ public final class AutomationsValidateSamples { } ``` -### ComplianceResults_Get +### AzureDevOpsOrgs_CreateOrUpdate ```java -/** Samples for ComplianceResults Get. */ -public final class ComplianceResultsGetSamples { +import com.azure.resourcemanager.security.models.ActionableRemediation; +import com.azure.resourcemanager.security.models.ActionableRemediationState; +import com.azure.resourcemanager.security.models.AzureDevOpsOrgProperties; +import com.azure.resourcemanager.security.models.OnboardingState; + +/** + * Samples for AzureDevOpsOrgs CreateOrUpdate. + */ +public final class AzureDevOpsOrgsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2017-08-01/examples/ComplianceResults/GetComplianceResults_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/CreateOrUpdateAzureDevOpsOrgs_example.json */ /** - * Sample code: Get compliance results on subscription. - * + * Sample code: CreateOrUpdate_AzureDevOpsOrgs. + * * @param manager Entry point to SecurityManager. */ - public static void getComplianceResultsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .complianceResults() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", - "DesignateMoreThanOneOwner", - com.azure.core.util.Context.NONE); + public static void createOrUpdateAzureDevOpsOrgs(com.azure.resourcemanager.security.SecurityManager manager) { + manager.azureDevOpsOrgs().define("myAzDevOpsOrg") + .withExistingSecurityConnector("myRg", "mySecurityConnectorName") + .withProperties(new AzureDevOpsOrgProperties().withOnboardingState(OnboardingState.NOT_APPLICABLE) + .withActionableRemediation(new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) + .create(); } } ``` -### ComplianceResults_List +### AzureDevOpsOrgs_Get ```java -/** Samples for ComplianceResults List. */ -public final class ComplianceResultsListSamples { +/** + * Samples for AzureDevOpsOrgs Get. + */ +public final class AzureDevOpsOrgsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2017-08-01/examples/ComplianceResults/ListComplianceResults_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/GetAzureDevOpsOrgs_example.json */ /** - * Sample code: Get compliance results on subscription. - * + * Sample code: Get_AzureDevOpsOrgs. + * * @param manager Entry point to SecurityManager. */ - public static void getComplianceResultsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .complianceResults() - .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); + public static void getAzureDevOpsOrgs(com.azure.resourcemanager.security.SecurityManager manager) { + manager.azureDevOpsOrgs().getWithResponse("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", + com.azure.core.util.Context.NONE); } } ``` -### Compliances_Get +### AzureDevOpsOrgs_List ```java -/** Samples for Compliances Get. */ -public final class CompliancesGetSamples { +/** + * Samples for AzureDevOpsOrgs List. + */ +public final class AzureDevOpsOrgsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/Compliances/GetCompliance_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/ListAzureDevOpsOrgs_example.json */ /** - * Sample code: Get security compliance data for a day. - * + * Sample code: List_AzureDevOpsOrgs. + * * @param manager Entry point to SecurityManager. */ - public static void getSecurityComplianceDataForADay(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .compliances() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "2018-01-01Z", com.azure.core.util.Context.NONE); + public static void listAzureDevOpsOrgs(com.azure.resourcemanager.security.SecurityManager manager) { + manager.azureDevOpsOrgs().list("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); } } ``` -### Compliances_List +### AzureDevOpsOrgs_ListAvailable ```java -/** Samples for Compliances List. */ -public final class CompliancesListSamples { +/** + * Samples for AzureDevOpsOrgs ListAvailable. + */ +public final class AzureDevOpsOrgsListAvailableSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/Compliances/GetCompliances_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/ListAvailableAzureDevOpsOrgs_example.json */ /** - * Sample code: Get security compliance data over time. - * + * Sample code: ListAvailable_AzureDevOpsOrgs. + * * @param manager Entry point to SecurityManager. */ - public static void getSecurityComplianceDataOverTime(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .compliances() - .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); + public static void listAvailableAzureDevOpsOrgs(com.azure.resourcemanager.security.SecurityManager manager) { + manager.azureDevOpsOrgs().listAvailableWithResponse("myRg", "mySecurityConnectorName", + com.azure.core.util.Context.NONE); } } ``` -### Connectors_CreateOrUpdate +### AzureDevOpsOrgs_Update ```java -import com.azure.resourcemanager.security.models.AutoProvision; -import com.azure.resourcemanager.security.models.AwAssumeRoleAuthenticationDetailsProperties; -import com.azure.resourcemanager.security.models.AwsCredsAuthenticationDetailsProperties; -import com.azure.resourcemanager.security.models.GcpCredentialsDetailsProperties; -import com.azure.resourcemanager.security.models.HybridComputeSettingsProperties; -import com.azure.resourcemanager.security.models.ProxyServerProperties; -import com.azure.resourcemanager.security.models.ServicePrincipalProperties; +import com.azure.resourcemanager.security.models.ActionableRemediation; +import com.azure.resourcemanager.security.models.ActionableRemediationState; +import com.azure.resourcemanager.security.models.AzureDevOpsOrg; +import com.azure.resourcemanager.security.models.AzureDevOpsOrgProperties; +import com.azure.resourcemanager.security.models.OnboardingState; -/** Samples for Connectors CreateOrUpdate. */ -public final class ConnectorsCreateOrUpdateSamples { +/** + * Samples for AzureDevOpsOrgs Update. + */ +public final class AzureDevOpsOrgsUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/CreateUpdateGcpCredentialsConnectorSubscription_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/UpdateAzureDevOpsOrgs_example.json */ /** - * Sample code: gcpCredentials - Create a cloud account connector for a subscription. - * + * Sample code: Update_AzureDevOpsOrgs. + * * @param manager Entry point to SecurityManager. */ - public static void gcpCredentialsCreateACloudAccountConnectorForASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .connectors() - .define("gcp_dev") - .withHybridComputeSettings(new HybridComputeSettingsProperties().withAutoProvision(AutoProvision.OFF)) - .withAuthenticationDetails( - new GcpCredentialsDetailsProperties() - .withOrganizationId("AscDemoOrg") - .withType("service_account") - .withProjectId("asc-project-1234") - .withPrivateKeyId("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder") - .withClientEmail("asc-135@asc-project-1234.iam.gserviceaccount.com") - .withClientId("105889053725632919854") - .withAuthUri("https://accounts.google.com/o/oauth2/auth") - .withTokenUri("fakeTokenPlaceholder") - .withAuthProviderX509CertUrl("https://www.googleapis.com/oauth2/v1/certs") - .withClientX509CertUrl( - "https://www.googleapis.com/robot/v1/metadata/x509/asc-135%40asc-project-1234.iam.gserviceaccount.com")) - .create(); + public static void updateAzureDevOpsOrgs(com.azure.resourcemanager.security.SecurityManager manager) { + AzureDevOpsOrg resource = manager.azureDevOpsOrgs() + .getWithResponse("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new AzureDevOpsOrgProperties().withOnboardingState(OnboardingState.NOT_APPLICABLE) + .withActionableRemediation(new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) + .apply(); } +} +``` - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/CreateUpdateAwsCredConnectorSubscription_example.json - */ - /** - * Sample code: AwsCred - Create a cloud account connector for a subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void awsCredCreateACloudAccountConnectorForASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .connectors() - .define("aws_dev1") - .withHybridComputeSettings( - new HybridComputeSettingsProperties() - .withAutoProvision(AutoProvision.ON) - .withResourceGroupName("AwsConnectorRG") - .withRegion("West US 2") - .withProxyServer(new ProxyServerProperties().withIp("167.220.197.140").withPort("34")) - .withServicePrincipal( - new ServicePrincipalProperties() - .withApplicationId("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1") - .withSecret("fakeTokenPlaceholder"))) - .withAuthenticationDetails( - new AwsCredsAuthenticationDetailsProperties() - .withAwsAccessKeyId("fakeTokenPlaceholder") - .withAwsSecretAccessKey("fakeTokenPlaceholder")) - .create(); - } +### AzureDevOpsProjects_CreateOrUpdate + +```java +import com.azure.resourcemanager.security.models.ActionableRemediation; +import com.azure.resourcemanager.security.models.ActionableRemediationState; +import com.azure.resourcemanager.security.models.AzureDevOpsProjectProperties; +import com.azure.resourcemanager.security.models.OnboardingState; +/** + * Samples for AzureDevOpsProjects CreateOrUpdate. + */ +public final class AzureDevOpsProjectsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/CreateUpdateAwsAssumeRoleConnectorSubscription_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/CreateOrUpdateAzureDevOpsProjects_example.json */ /** - * Sample code: AwsAssumeRole - Create a cloud account connector for a subscription. - * + * Sample code: CreateOrUpdate_AzureDevOpsProjects. + * * @param manager Entry point to SecurityManager. */ - public static void awsAssumeRoleCreateACloudAccountConnectorForASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .connectors() - .define("aws_dev2") - .withHybridComputeSettings( - new HybridComputeSettingsProperties() - .withAutoProvision(AutoProvision.ON) - .withResourceGroupName("AwsConnectorRG") - .withRegion("West US 2") - .withProxyServer(new ProxyServerProperties().withIp("167.220.197.140").withPort("34")) - .withServicePrincipal( - new ServicePrincipalProperties() - .withApplicationId("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1") - .withSecret("fakeTokenPlaceholder"))) - .withAuthenticationDetails( - new AwAssumeRoleAuthenticationDetailsProperties() - .withAwsAssumeRoleArn("arn:aws:iam::81231569658:role/AscConnector") - .withAwsExternalId("20ff7fc3-e762-44dd-bd96-b71116dcdc23")) + public static void createOrUpdateAzureDevOpsProjects(com.azure.resourcemanager.security.SecurityManager manager) { + manager.azureDevOpsProjects().define("myAzDevOpsProject") + .withExistingAzureDevOpsOrg("myRg", "mySecurityConnectorName", "myAzDevOpsOrg") + .withProperties(new AzureDevOpsProjectProperties().withOnboardingState(OnboardingState.NOT_APPLICABLE) + .withActionableRemediation(new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) .create(); } } ``` -### Connectors_Delete +### AzureDevOpsProjects_Get ```java -/** Samples for Connectors Delete. */ -public final class ConnectorsDeleteSamples { +/** + * Samples for AzureDevOpsProjects Get. + */ +public final class AzureDevOpsProjectsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/DeleteConnectorSubscription_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/GetAzureDevOpsProjects_example.json */ /** - * Sample code: Delete a cloud account connector from a subscription. - * + * Sample code: Get_AzureDevOpsProjects. + * * @param manager Entry point to SecurityManager. */ - public static void deleteACloudAccountConnectorFromASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.connectors().deleteWithResponse("aws_dev1", com.azure.core.util.Context.NONE); + public static void getAzureDevOpsProjects(com.azure.resourcemanager.security.SecurityManager manager) { + manager.azureDevOpsProjects().getWithResponse("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", + "myAzDevOpsProject", com.azure.core.util.Context.NONE); } } ``` -### Connectors_Get +### AzureDevOpsProjects_List ```java -/** Samples for Connectors Get. */ -public final class ConnectorsGetSamples { +/** + * Samples for AzureDevOpsProjects List. + */ +public final class AzureDevOpsProjectsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/GetConnectorSubscription_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/ListAzureDevOpsProjects_example.json */ /** - * Sample code: Details of a specific cloud account connector. - * + * Sample code: List_AzureDevOpsProjects. + * * @param manager Entry point to SecurityManager. */ - public static void detailsOfASpecificCloudAccountConnector( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.connectors().getWithResponse("aws_dev1", com.azure.core.util.Context.NONE); + public static void listAzureDevOpsProjects(com.azure.resourcemanager.security.SecurityManager manager) { + manager.azureDevOpsProjects().list("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", + com.azure.core.util.Context.NONE); } } ``` -### Connectors_List +### AzureDevOpsProjects_Update ```java -/** Samples for Connectors List. */ -public final class ConnectorsListSamples { +import com.azure.resourcemanager.security.models.ActionableRemediation; +import com.azure.resourcemanager.security.models.ActionableRemediationState; +import com.azure.resourcemanager.security.models.AzureDevOpsProject; +import com.azure.resourcemanager.security.models.AzureDevOpsProjectProperties; +import com.azure.resourcemanager.security.models.OnboardingState; + +/** + * Samples for AzureDevOpsProjects Update. + */ +public final class AzureDevOpsProjectsUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/GetListConnectorSubscription_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/UpdateAzureDevOpsProjects_example.json */ /** - * Sample code: Get all cloud accounts connectors of a subscription. - * + * Sample code: Update_AzureDevOpsProjects. + * * @param manager Entry point to SecurityManager. */ - public static void getAllCloudAccountsConnectorsOfASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.connectors().list(com.azure.core.util.Context.NONE); + public static void updateAzureDevOpsProjects(com.azure.resourcemanager.security.SecurityManager manager) { + AzureDevOpsProject resource = manager.azureDevOpsProjects().getWithResponse("myRg", "mySecurityConnectorName", + "myAzDevOpsOrg", "myAzDevOpsProject", com.azure.core.util.Context.NONE).getValue(); + resource.update() + .withProperties(new AzureDevOpsProjectProperties().withOnboardingState(OnboardingState.NOT_APPLICABLE) + .withActionableRemediation(new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) + .apply(); } } ``` -### CustomAssessmentAutomations_Create +### AzureDevOpsRepos_CreateOrUpdate ```java -import com.azure.resourcemanager.security.models.SeverityEnum; -import com.azure.resourcemanager.security.models.SupportedCloudEnum; +import com.azure.resourcemanager.security.models.ActionableRemediation; +import com.azure.resourcemanager.security.models.ActionableRemediationState; +import com.azure.resourcemanager.security.models.AzureDevOpsRepositoryProperties; +import com.azure.resourcemanager.security.models.OnboardingState; -/** Samples for CustomAssessmentAutomations Create. */ -public final class CustomAssessmentAutomationsCreateSamples { +/** + * Samples for AzureDevOpsRepos CreateOrUpdate. + */ +public final class AzureDevOpsReposCreateOrUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationCreate_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/CreateOrUpdateAzureDevOpsRepos_example.json */ /** - * Sample code: Create a Custom Assessment Automation. - * + * Sample code: CreateOrUpdate_AzureDevOpsRepos. + * * @param manager Entry point to SecurityManager. */ - public static void createACustomAssessmentAutomation(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .customAssessmentAutomations() - .define("MyCustomAssessmentAutomation") - .withExistingResourceGroup("TestResourceGroup") - .withCompressedQuery( - "DQAKAEkAYQBtAF8ARwByAG8AdQBwAA0ACgB8ACAAZQB4AHQAZQBuAGQAIABIAGUAYQBsAHQAaABTAHQAYQB0AHUAcwAgAD0AIABpAGYAZgAoAHQAbwBzAHQAcgBpAG4AZwAoAFIAZQBjAG8AcgBkAC4AVQBzAGUAcgBOAGEAbQBlACkAIABjAG8AbgB0AGEAaQBuAHMAIAAnAHUAcwBlAHIAJwAsACAAJwBVAE4ASABFAEEATABUAEgAWQAnACwAIAAnAEgARQBBAEwAVABIAFkAJwApAA0ACgA=") - .withSupportedCloud(SupportedCloudEnum.AWS) - .withSeverity(SeverityEnum.MEDIUM) - .withDisplayName("Password Policy") - .withDescription("Data should be encrypted") - .withRemediationDescription("Encrypt store by...") + public static void createOrUpdateAzureDevOpsRepos(com.azure.resourcemanager.security.SecurityManager manager) { + manager.azureDevOpsRepos().define("myAzDevOpsRepo") + .withExistingProject("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", "myAzDevOpsProject") + .withProperties(new AzureDevOpsRepositoryProperties().withOnboardingState(OnboardingState.NOT_APPLICABLE) + .withActionableRemediation(new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) .create(); } } ``` -### CustomAssessmentAutomations_Delete +### AzureDevOpsRepos_Get ```java -/** Samples for CustomAssessmentAutomations Delete. */ -public final class CustomAssessmentAutomationsDeleteSamples { +/** + * Samples for AzureDevOpsRepos Get. + */ +public final class AzureDevOpsReposGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationDelete_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/GetAzureDevOpsRepos_example.json */ /** - * Sample code: Delete a Custom Assessment Automation. - * + * Sample code: Get_AzureDevOpsRepos. + * * @param manager Entry point to SecurityManager. */ - public static void deleteACustomAssessmentAutomation(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .customAssessmentAutomations() - .deleteByResourceGroupWithResponse( - "TestResourceGroup", "MyCustomAssessmentAutomation", com.azure.core.util.Context.NONE); + public static void getAzureDevOpsRepos(com.azure.resourcemanager.security.SecurityManager manager) { + manager.azureDevOpsRepos().getWithResponse("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", + "myAzDevOpsProject", "myAzDevOpsRepo", com.azure.core.util.Context.NONE); } } ``` -### CustomAssessmentAutomations_GetByResourceGroup +### AzureDevOpsRepos_List ```java -/** Samples for CustomAssessmentAutomations GetByResourceGroup. */ -public final class CustomAssessmentAutomationsGetByResourceGroupSamples { +/** + * Samples for AzureDevOpsRepos List. + */ +public final class AzureDevOpsReposListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationGet_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/ListAzureDevOpsRepos_example.json */ /** - * Sample code: Get a Custom Assessment Automation. - * + * Sample code: List_AzureDevOpsRepos. + * * @param manager Entry point to SecurityManager. */ - public static void getACustomAssessmentAutomation(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .customAssessmentAutomations() - .getByResourceGroupWithResponse( - "TestResourceGroup", "MyCustomAssessmentAutomation", com.azure.core.util.Context.NONE); + public static void listAzureDevOpsRepos(com.azure.resourcemanager.security.SecurityManager manager) { + manager.azureDevOpsRepos().list("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", "myAzDevOpsProject", + com.azure.core.util.Context.NONE); } } ``` -### CustomAssessmentAutomations_List +### AzureDevOpsRepos_Update ```java -/** Samples for CustomAssessmentAutomations List. */ -public final class CustomAssessmentAutomationsListSamples { +import com.azure.resourcemanager.security.models.ActionableRemediation; +import com.azure.resourcemanager.security.models.ActionableRemediationState; +import com.azure.resourcemanager.security.models.AzureDevOpsRepository; +import com.azure.resourcemanager.security.models.AzureDevOpsRepositoryProperties; +import com.azure.resourcemanager.security.models.OnboardingState; + +/** + * Samples for AzureDevOpsRepos Update. + */ +public final class AzureDevOpsReposUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationListBySubscription_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/UpdateAzureDevOpsRepos_example.json */ /** - * Sample code: List Custom Assessment Automations in a subscription. - * + * Sample code: Update_AzureDevOpsRepos. + * * @param manager Entry point to SecurityManager. */ - public static void listCustomAssessmentAutomationsInASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.customAssessmentAutomations().list(com.azure.core.util.Context.NONE); + public static void updateAzureDevOpsRepos(com.azure.resourcemanager.security.SecurityManager manager) { + AzureDevOpsRepository resource = manager.azureDevOpsRepos().getWithResponse("myRg", "mySecurityConnectorName", + "myAzDevOpsOrg", "myAzDevOpsProject", "myAzDevOpsRepo", com.azure.core.util.Context.NONE).getValue(); + resource.update() + .withProperties(new AzureDevOpsRepositoryProperties().withOnboardingState(OnboardingState.NOT_APPLICABLE) + .withActionableRemediation(new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) + .apply(); } } ``` -### CustomAssessmentAutomations_ListByResourceGroup +### ComplianceResults_Get ```java -/** Samples for CustomAssessmentAutomations ListByResourceGroup. */ -public final class CustomAssessmentAutomationsListByResourceGroupSamples { +/** + * Samples for ComplianceResults Get. + */ +public final class ComplianceResultsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationListByResourceGroup_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2017-08-01/examples/ComplianceResults/ + * GetComplianceResults_example.json */ /** - * Sample code: List Custom Assessment Automations in a subscription and a resource group. - * + * Sample code: Get compliance results on subscription. + * * @param manager Entry point to SecurityManager. */ - public static void listCustomAssessmentAutomationsInASubscriptionAndAResourceGroup( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .customAssessmentAutomations() - .listByResourceGroup("TestResourceGroup", com.azure.core.util.Context.NONE); + public static void getComplianceResultsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.complianceResults().getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "DesignateMoreThanOneOwner", com.azure.core.util.Context.NONE); } } ``` -### CustomEntityStoreAssignments_Create +### ComplianceResults_List ```java -/** Samples for CustomEntityStoreAssignments Create. */ -public final class CustomEntityStoreAssignmentsCreateSamples { +/** + * Samples for ComplianceResults List. + */ +public final class ComplianceResultsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentCreate_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2017-08-01/examples/ComplianceResults/ + * ListComplianceResults_example.json */ /** - * Sample code: Create a custom entity store assignment. - * + * Sample code: Get compliance results on subscription. + * * @param manager Entry point to SecurityManager. */ - public static void createACustomEntityStoreAssignment(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .customEntityStoreAssignments() - .define("33e7cc6e-a139-4723-a0e5-76993aee0771") - .withExistingResourceGroup("TestResourceGroup") - .withPrincipal("aaduser=f3923a3e-ad57-4752-b1a9-fbf3c8e5e082;72f988bf-86f1-41af-91ab-2d7cd011db47") - .create(); + public static void getComplianceResultsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.complianceResults().list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + com.azure.core.util.Context.NONE); + } +} +``` + +### Compliances_Get + +```java +/** + * Samples for Compliances Get. + */ +public final class CompliancesGetSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/Compliances/ + * GetCompliance_example.json + */ + /** + * Sample code: Get security compliance data for a day. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityComplianceDataForADay(com.azure.resourcemanager.security.SecurityManager manager) { + manager.compliances().getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "2018-01-01Z", + com.azure.core.util.Context.NONE); + } +} +``` + +### Compliances_List + +```java +/** + * Samples for Compliances List. + */ +public final class CompliancesListSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/Compliances/ + * GetCompliances_example.json + */ + /** + * Sample code: Get security compliance data over time. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityComplianceDataOverTime(com.azure.resourcemanager.security.SecurityManager manager) { + manager.compliances().list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + com.azure.core.util.Context.NONE); + } +} +``` + +### Connectors_CreateOrUpdate + +```java +import com.azure.resourcemanager.security.models.AutoProvision; +import com.azure.resourcemanager.security.models.AwAssumeRoleAuthenticationDetailsProperties; +import com.azure.resourcemanager.security.models.AwsCredsAuthenticationDetailsProperties; +import com.azure.resourcemanager.security.models.GcpCredentialsDetailsProperties; +import com.azure.resourcemanager.security.models.HybridComputeSettingsProperties; +import com.azure.resourcemanager.security.models.ProxyServerProperties; +import com.azure.resourcemanager.security.models.ServicePrincipalProperties; + +/** + * Samples for Connectors CreateOrUpdate. + */ +public final class ConnectorsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/ + * CreateUpdateGcpCredentialsConnectorSubscription_example.json + */ + /** + * Sample code: gcpCredentials - Create a cloud account connector for a subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void gcpCredentialsCreateACloudAccountConnectorForASubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.connectors().define("gcp_dev") + .withHybridComputeSettings(new HybridComputeSettingsProperties().withAutoProvision(AutoProvision.OFF)) + .withAuthenticationDetails(new GcpCredentialsDetailsProperties().withOrganizationId("AscDemoOrg") + .withType("service_account").withProjectId("asc-project-1234").withPrivateKeyId("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder") + .withClientEmail("asc-135@asc-project-1234.iam.gserviceaccount.com") + .withClientId("105889053725632919854").withAuthUri("https://accounts.google.com/o/oauth2/auth") + .withTokenUri("fakeTokenPlaceholder") + .withAuthProviderX509CertUrl("https://www.googleapis.com/oauth2/v1/certs").withClientX509CertUrl( + "https://www.googleapis.com/robot/v1/metadata/x509/asc-135%40asc-project-1234.iam.gserviceaccount.com")) + .create(); + } + + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/ + * CreateUpdateAwsCredConnectorSubscription_example.json + */ + /** + * Sample code: AwsCred - Create a cloud account connector for a subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void awsCredCreateACloudAccountConnectorForASubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.connectors().define("aws_dev1") + .withHybridComputeSettings(new HybridComputeSettingsProperties().withAutoProvision(AutoProvision.ON) + .withResourceGroupName("AwsConnectorRG").withRegion("West US 2") + .withProxyServer(new ProxyServerProperties().withIp("167.220.197.140").withPort("34")) + .withServicePrincipal(new ServicePrincipalProperties() + .withApplicationId("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1").withSecret("fakeTokenPlaceholder"))) + .withAuthenticationDetails(new AwsCredsAuthenticationDetailsProperties() + .withAwsAccessKeyId("fakeTokenPlaceholder").withAwsSecretAccessKey("fakeTokenPlaceholder")) + .create(); + } + + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/ + * CreateUpdateAwsAssumeRoleConnectorSubscription_example.json + */ + /** + * Sample code: AwsAssumeRole - Create a cloud account connector for a subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void awsAssumeRoleCreateACloudAccountConnectorForASubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.connectors().define("aws_dev2") + .withHybridComputeSettings(new HybridComputeSettingsProperties().withAutoProvision(AutoProvision.ON) + .withResourceGroupName("AwsConnectorRG").withRegion("West US 2") + .withProxyServer(new ProxyServerProperties().withIp("167.220.197.140").withPort("34")) + .withServicePrincipal(new ServicePrincipalProperties() + .withApplicationId("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1").withSecret("fakeTokenPlaceholder"))) + .withAuthenticationDetails(new AwAssumeRoleAuthenticationDetailsProperties() + .withAwsAssumeRoleArn("arn:aws:iam::81231569658:role/AscConnector") + .withAwsExternalId("20ff7fc3-e762-44dd-bd96-b71116dcdc23")) + .create(); + } +} +``` + +### Connectors_Delete + +```java +/** + * Samples for Connectors Delete. + */ +public final class ConnectorsDeleteSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/ + * DeleteConnectorSubscription_example.json + */ + /** + * Sample code: Delete a cloud account connector from a subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void + deleteACloudAccountConnectorFromASubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.connectors().deleteWithResponse("aws_dev1", com.azure.core.util.Context.NONE); + } +} +``` + +### Connectors_Get + +```java +/** + * Samples for Connectors Get. + */ +public final class ConnectorsGetSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/ + * GetConnectorSubscription_example.json + */ + /** + * Sample code: Details of a specific cloud account connector. + * + * @param manager Entry point to SecurityManager. + */ + public static void + detailsOfASpecificCloudAccountConnector(com.azure.resourcemanager.security.SecurityManager manager) { + manager.connectors().getWithResponse("aws_dev1", com.azure.core.util.Context.NONE); + } +} +``` + +### Connectors_List + +```java +/** + * Samples for Connectors List. + */ +public final class ConnectorsListSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/ + * GetListConnectorSubscription_example.json + */ + /** + * Sample code: Get all cloud accounts connectors of a subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getAllCloudAccountsConnectorsOfASubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.connectors().list(com.azure.core.util.Context.NONE); + } +} +``` + +### CustomAssessmentAutomations_Create + +```java +import com.azure.resourcemanager.security.models.SeverityEnum; +import com.azure.resourcemanager.security.models.SupportedCloudEnum; + +/** + * Samples for CustomAssessmentAutomations Create. + */ +public final class CustomAssessmentAutomationsCreateSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/ + * CustomAssessmentAutomations/customAssessmentAutomationCreate_example.json + */ + /** + * Sample code: Create a Custom Assessment Automation. + * + * @param manager Entry point to SecurityManager. + */ + public static void createACustomAssessmentAutomation(com.azure.resourcemanager.security.SecurityManager manager) { + manager.customAssessmentAutomations().define("MyCustomAssessmentAutomation") + .withExistingResourceGroup("TestResourceGroup") + .withCompressedQuery( + "DQAKAEkAYQBtAF8ARwByAG8AdQBwAA0ACgB8ACAAZQB4AHQAZQBuAGQAIABIAGUAYQBsAHQAaABTAHQAYQB0AHUAcwAgAD0AIABpAGYAZgAoAHQAbwBzAHQAcgBpAG4AZwAoAFIAZQBjAG8AcgBkAC4AVQBzAGUAcgBOAGEAbQBlACkAIABjAG8AbgB0AGEAaQBuAHMAIAAnAHUAcwBlAHIAJwAsACAAJwBVAE4ASABFAEEATABUAEgAWQAnACwAIAAnAEgARQBBAEwAVABIAFkAJwApAA0ACgA=") + .withSupportedCloud(SupportedCloudEnum.AWS).withSeverity(SeverityEnum.MEDIUM) + .withDisplayName("Password Policy").withDescription("Data should be encrypted") + .withRemediationDescription("Encrypt store by...").create(); + } +} +``` + +### CustomAssessmentAutomations_Delete + +```java +/** + * Samples for CustomAssessmentAutomations Delete. + */ +public final class CustomAssessmentAutomationsDeleteSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/ + * CustomAssessmentAutomations/customAssessmentAutomationDelete_example.json + */ + /** + * Sample code: Delete a Custom Assessment Automation. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteACustomAssessmentAutomation(com.azure.resourcemanager.security.SecurityManager manager) { + manager.customAssessmentAutomations().deleteByResourceGroupWithResponse("TestResourceGroup", + "MyCustomAssessmentAutomation", com.azure.core.util.Context.NONE); + } +} +``` + +### CustomAssessmentAutomations_GetByResourceGroup + +```java +/** + * Samples for CustomAssessmentAutomations GetByResourceGroup. + */ +public final class CustomAssessmentAutomationsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/ + * CustomAssessmentAutomations/customAssessmentAutomationGet_example.json + */ + /** + * Sample code: Get a Custom Assessment Automation. + * + * @param manager Entry point to SecurityManager. + */ + public static void getACustomAssessmentAutomation(com.azure.resourcemanager.security.SecurityManager manager) { + manager.customAssessmentAutomations().getByResourceGroupWithResponse("TestResourceGroup", + "MyCustomAssessmentAutomation", com.azure.core.util.Context.NONE); + } +} +``` + +### CustomAssessmentAutomations_List + +```java +/** + * Samples for CustomAssessmentAutomations List. + */ +public final class CustomAssessmentAutomationsListSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/ + * CustomAssessmentAutomations/customAssessmentAutomationListBySubscription_example.json + */ + /** + * Sample code: List Custom Assessment Automations in a subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void + listCustomAssessmentAutomationsInASubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.customAssessmentAutomations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### CustomAssessmentAutomations_ListByResourceGroup + +```java +/** + * Samples for CustomAssessmentAutomations ListByResourceGroup. + */ +public final class CustomAssessmentAutomationsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/ + * CustomAssessmentAutomations/customAssessmentAutomationListByResourceGroup_example.json + */ + /** + * Sample code: List Custom Assessment Automations in a subscription and a resource group. + * + * @param manager Entry point to SecurityManager. + */ + public static void listCustomAssessmentAutomationsInASubscriptionAndAResourceGroup( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.customAssessmentAutomations().listByResourceGroup("TestResourceGroup", + com.azure.core.util.Context.NONE); + } +} +``` + +### CustomEntityStoreAssignments_Create + +```java +/** + * Samples for CustomEntityStoreAssignments Create. + */ +public final class CustomEntityStoreAssignmentsCreateSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/ + * CustomEntityStoreAssignments/customEntityStoreAssignmentCreate_example.json + */ + /** + * Sample code: Create a custom entity store assignment. + * + * @param manager Entry point to SecurityManager. + */ + public static void createACustomEntityStoreAssignment(com.azure.resourcemanager.security.SecurityManager manager) { + manager.customEntityStoreAssignments().define("33e7cc6e-a139-4723-a0e5-76993aee0771") + .withExistingResourceGroup("TestResourceGroup") + .withPrincipal("aaduser=f3923a3e-ad57-4752-b1a9-fbf3c8e5e082;72f988bf-86f1-41af-91ab-2d7cd011db47") + .create(); } } ``` @@ -2595,21 +3074,23 @@ public final class CustomEntityStoreAssignmentsCreateSamples { ### CustomEntityStoreAssignments_Delete ```java -/** Samples for CustomEntityStoreAssignments Delete. */ +/** + * Samples for CustomEntityStoreAssignments Delete. + */ public final class CustomEntityStoreAssignmentsDeleteSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentDelete_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/ + * CustomEntityStoreAssignments/customEntityStoreAssignmentDelete_example.json */ /** * Sample code: Delete a custom entity store assignment. - * + * * @param manager Entry point to SecurityManager. */ public static void deleteACustomEntityStoreAssignment(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .customEntityStoreAssignments() - .deleteByResourceGroupWithResponse( - "TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", com.azure.core.util.Context.NONE); + manager.customEntityStoreAssignments().deleteByResourceGroupWithResponse("TestResourceGroup", + "33e7cc6e-a139-4723-a0e5-76993aee0771", com.azure.core.util.Context.NONE); } } ``` @@ -2617,21 +3098,23 @@ public final class CustomEntityStoreAssignmentsDeleteSamples { ### CustomEntityStoreAssignments_GetByResourceGroup ```java -/** Samples for CustomEntityStoreAssignments GetByResourceGroup. */ +/** + * Samples for CustomEntityStoreAssignments GetByResourceGroup. + */ public final class CustomEntityStoreAssignmentsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentGet_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/ + * CustomEntityStoreAssignments/customEntityStoreAssignmentGet_example.json */ /** * Sample code: Get a custom entity store assignment. - * + * * @param manager Entry point to SecurityManager. */ public static void getACustomEntityStoreAssignment(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .customEntityStoreAssignments() - .getByResourceGroupWithResponse( - "TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", com.azure.core.util.Context.NONE); + manager.customEntityStoreAssignments().getByResourceGroupWithResponse("TestResourceGroup", + "33e7cc6e-a139-4723-a0e5-76993aee0771", com.azure.core.util.Context.NONE); } } ``` @@ -2639,18 +3122,22 @@ public final class CustomEntityStoreAssignmentsGetByResourceGroupSamples { ### CustomEntityStoreAssignments_List ```java -/** Samples for CustomEntityStoreAssignments List. */ +/** + * Samples for CustomEntityStoreAssignments List. + */ public final class CustomEntityStoreAssignmentsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentListBySubscription_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/ + * CustomEntityStoreAssignments/customEntityStoreAssignmentListBySubscription_example.json */ /** * Sample code: List custom entity store assignments in a subscription. - * + * * @param manager Entry point to SecurityManager. */ - public static void listCustomEntityStoreAssignmentsInASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void + listCustomEntityStoreAssignmentsInASubscription(com.azure.resourcemanager.security.SecurityManager manager) { manager.customEntityStoreAssignments().list(com.azure.core.util.Context.NONE); } } @@ -2658,22 +3145,296 @@ public final class CustomEntityStoreAssignmentsListSamples { ### CustomEntityStoreAssignments_ListByResourceGroup -```java -/** Samples for CustomEntityStoreAssignments ListByResourceGroup. */ -public final class CustomEntityStoreAssignmentsListByResourceGroupSamples { +```java +/** + * Samples for CustomEntityStoreAssignments ListByResourceGroup. + */ +public final class CustomEntityStoreAssignmentsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/ + * CustomEntityStoreAssignments/customEntityStoreAssignmentListByResourceGroup_example.json + */ + /** + * Sample code: List custom entity store assignments in a subscription and a resource group. + * + * @param manager Entry point to SecurityManager. + */ + public static void listCustomEntityStoreAssignmentsInASubscriptionAndAResourceGroup( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.customEntityStoreAssignments().listByResourceGroup("TestResourceGroup", + com.azure.core.util.Context.NONE); + } +} +``` + +### DefenderForStorage_Create + +```java +import com.azure.resourcemanager.security.models.SettingName; + +/** + * Samples for DefenderForStorage Create. + */ +public final class DefenderForStorageCreateSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-12-01-preview/examples/DefenderForStorage + * /PutDefenderForStorageSettings_example.json + */ + /** + * Sample code: Creates or updates the Defender for Storage settings on a specified resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void createsOrUpdatesTheDefenderForStorageSettingsOnASpecifiedResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.defenderForStorages().define(SettingName.CURRENT).withExistingResourceId( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount") + .withIsEnabled(true).withOverrideSubscriptionLevelSettings(true) + .withScanResultsEventGridTopicResourceId( + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.EventGrid/topics/sampletopic") + .withIsEnabledMalwareScanningIsEnabled(true).withCapGBPerMonth(-1) + .withIsEnabledSensitiveDataDiscoveryIsEnabled(true).create(); + } +} +``` + +### DefenderForStorage_Get + +```java +import com.azure.resourcemanager.security.models.SettingName; + +/** + * Samples for DefenderForStorage Get. + */ +public final class DefenderForStorageGetSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-12-01-preview/examples/DefenderForStorage + * /GetDefenderForStorageSettings_example.json + */ + /** + * Sample code: Gets the Defender for Storage settings for the specified resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void getsTheDefenderForStorageSettingsForTheSpecifiedResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.defenderForStorages().getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", + SettingName.CURRENT, com.azure.core.util.Context.NONE); + } +} +``` + +### DevOpsConfigurations_CreateOrUpdate + +```java +import com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner; +import com.azure.resourcemanager.security.models.Authorization; +import com.azure.resourcemanager.security.models.AutoDiscovery; +import com.azure.resourcemanager.security.models.DevOpsConfigurationProperties; +import java.util.Arrays; + +/** + * Samples for DevOpsConfigurations CreateOrUpdate. + */ +public final class DevOpsConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/CreateOrUpdateDevOpsConfigurationsOnboardCurrentAndFuture_example.json + */ + /** + * Sample code: CreateOrUpdate_DevOpsConfigurations_OnboardCurrentAndFuture. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateDevOpsConfigurationsOnboardCurrentAndFuture( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.devOpsConfigurations().createOrUpdate("myRg", "mySecurityConnectorName", + new DevOpsConfigurationInner().withProperties(new DevOpsConfigurationProperties() + .withAuthorization(new Authorization().withCode("fakeTokenPlaceholder")) + .withAutoDiscovery(AutoDiscovery.ENABLED)), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/CreateOrUpdateDevOpsConfigurationsOnboardCurrentOnly_example.json + */ + /** + * Sample code: CreateOrUpdate_DevOpsConfigurations_OnboardCurrentOnly. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateDevOpsConfigurationsOnboardCurrentOnly( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.devOpsConfigurations().createOrUpdate("myRg", "mySecurityConnectorName", + new DevOpsConfigurationInner().withProperties(new DevOpsConfigurationProperties() + .withAuthorization(new Authorization().withCode("fakeTokenPlaceholder")) + .withAutoDiscovery(AutoDiscovery.DISABLED)), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/CreateOrUpdateDevOpsConfigurationsOnboardSelected_example.json + */ + /** + * Sample code: CreateOrUpdate_DevOpsConfigurations_OnboardSelected. + * + * @param manager Entry point to SecurityManager. + */ + public static void + createOrUpdateDevOpsConfigurationsOnboardSelected(com.azure.resourcemanager.security.SecurityManager manager) { + manager.devOpsConfigurations().createOrUpdate("myRg", "mySecurityConnectorName", + new DevOpsConfigurationInner().withProperties(new DevOpsConfigurationProperties() + .withAuthorization(new Authorization().withCode("fakeTokenPlaceholder")) + .withAutoDiscovery(AutoDiscovery.DISABLED).withTopLevelInventoryList(Arrays.asList("org1", "org2"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### DevOpsConfigurations_Delete + +```java +/** + * Samples for DevOpsConfigurations Delete. + */ +public final class DevOpsConfigurationsDeleteSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/DeleteDevOpsConfigurations_example.json + */ + /** + * Sample code: Delete_DevOpsConfigurations. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteDevOpsConfigurations(com.azure.resourcemanager.security.SecurityManager manager) { + manager.devOpsConfigurations().delete("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + } +} +``` + +### DevOpsConfigurations_Get + +```java +/** + * Samples for DevOpsConfigurations Get. + */ +public final class DevOpsConfigurationsGetSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/GetDevOpsConfigurations_example.json + */ + /** + * Sample code: Get_DevOpsConfigurations. + * + * @param manager Entry point to SecurityManager. + */ + public static void getDevOpsConfigurations(com.azure.resourcemanager.security.SecurityManager manager) { + manager.devOpsConfigurations().getWithResponse("myRg", "mySecurityConnectorName", + com.azure.core.util.Context.NONE); + } +} +``` + +### DevOpsConfigurations_List + +```java +/** + * Samples for DevOpsConfigurations List. + */ +public final class DevOpsConfigurationsListSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/ListDevOpsConfigurations_example.json + */ + /** + * Sample code: List_DevOpsConfigurations. + * + * @param manager Entry point to SecurityManager. + */ + public static void listDevOpsConfigurations(com.azure.resourcemanager.security.SecurityManager manager) { + manager.devOpsConfigurations().list("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + } +} +``` + +### DevOpsConfigurations_Update + +```java +import com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner; +import com.azure.resourcemanager.security.models.AutoDiscovery; +import com.azure.resourcemanager.security.models.DevOpsConfigurationProperties; + +/** + * Samples for DevOpsConfigurations Update. + */ +public final class DevOpsConfigurationsUpdateSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/UpdateDevOpsConfigurations_example.json + */ + /** + * Sample code: Update_DevOpsConfigurations. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateDevOpsConfigurations(com.azure.resourcemanager.security.SecurityManager manager) { + manager.devOpsConfigurations().update("myRg", "mySecurityConnectorName", + new DevOpsConfigurationInner() + .withProperties(new DevOpsConfigurationProperties().withAutoDiscovery(AutoDiscovery.ENABLED)), + com.azure.core.util.Context.NONE); + } +} +``` + +### DevOpsOperationResults_Get + +```java +/** + * Samples for DevOpsOperationResults Get. + */ +public final class DevOpsOperationResultsGetSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/GetDevOpsOperationResultsFailed_example.json + */ + /** + * Sample code: Get_DevOpsOperationResults_Failed. + * + * @param manager Entry point to SecurityManager. + */ + public static void getDevOpsOperationResultsFailed(com.azure.resourcemanager.security.SecurityManager manager) { + manager.devOpsOperationResults().getWithResponse("myRg", "mySecurityConnectorName", + "8d4caace-e7b3-4b3e-af99-73f76829ebcf", com.azure.core.util.Context.NONE); + } + /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentListByResourceGroup_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/GetDevOpsOperationResultsSucceeded_example.json */ /** - * Sample code: List custom entity store assignments in a subscription and a resource group. - * + * Sample code: Get_DevOpsOperationResults_Succeeded. + * * @param manager Entry point to SecurityManager. */ - public static void listCustomEntityStoreAssignmentsInASubscriptionAndAResourceGroup( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .customEntityStoreAssignments() - .listByResourceGroup("TestResourceGroup", com.azure.core.util.Context.NONE); + public static void getDevOpsOperationResultsSucceeded(com.azure.resourcemanager.security.SecurityManager manager) { + manager.devOpsOperationResults().getWithResponse("myRg", "mySecurityConnectorName", + "4e826cf1-5c36-4808-a7d2-fb4f5170978b", com.azure.core.util.Context.NONE); } } ``` @@ -2685,31 +3446,26 @@ import com.azure.resourcemanager.security.models.ActiveConnectionsNotInAllowedRa import java.time.Duration; import java.util.Arrays; -/** Samples for DeviceSecurityGroups CreateOrUpdate. */ +/** + * Samples for DeviceSecurityGroups CreateOrUpdate. + */ public final class DeviceSecurityGroupsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/PutDeviceSecurityGroups_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/ + * PutDeviceSecurityGroups_example.json */ /** * Sample code: Create or update a device security group for the specified IoT hub resource. - * + * * @param manager Entry point to SecurityManager. */ public static void createOrUpdateADeviceSecurityGroupForTheSpecifiedIoTHubResource( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .deviceSecurityGroups() - .define("samplesecuritygroup") - .withExistingResourceId( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub") - .withTimeWindowRules( - Arrays - .asList( - new ActiveConnectionsNotInAllowedRange() - .withIsEnabled(true) - .withMinThreshold(0) - .withMaxThreshold(30) - .withTimeWindowSize(Duration.parse("PT05M")))) + manager.deviceSecurityGroups().define("samplesecuritygroup").withExistingResourceId( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub") + .withTimeWindowRules(Arrays.asList(new ActiveConnectionsNotInAllowedRange().withIsEnabled(true) + .withMinThreshold(0).withMaxThreshold(30).withTimeWindowSize(Duration.parse("PT05M")))) .create(); } } @@ -2718,24 +3474,25 @@ public final class DeviceSecurityGroupsCreateOrUpdateSamples { ### DeviceSecurityGroups_Delete ```java -/** Samples for DeviceSecurityGroups Delete. */ +/** + * Samples for DeviceSecurityGroups Delete. + */ public final class DeviceSecurityGroupsDeleteSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/DeleteDeviceSecurityGroups_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/ + * DeleteDeviceSecurityGroups_example.json */ /** * Sample code: Delete a device security group for the specified IoT Hub resource. - * + * * @param manager Entry point to SecurityManager. */ public static void deleteADeviceSecurityGroupForTheSpecifiedIoTHubResource( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .deviceSecurityGroups() - .deleteByResourceGroupWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", - "samplesecuritygroup", - com.azure.core.util.Context.NONE); + manager.deviceSecurityGroups().deleteByResourceGroupWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", + "samplesecuritygroup", com.azure.core.util.Context.NONE); } } ``` @@ -2743,24 +3500,25 @@ public final class DeviceSecurityGroupsDeleteSamples { ### DeviceSecurityGroups_Get ```java -/** Samples for DeviceSecurityGroups Get. */ +/** + * Samples for DeviceSecurityGroups Get. + */ public final class DeviceSecurityGroupsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/GetDeviceSecurityGroups_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/ + * GetDeviceSecurityGroups_example.json */ /** * Sample code: Get a device security group for the specified IoT Hub resource. - * + * * @param manager Entry point to SecurityManager. */ public static void getADeviceSecurityGroupForTheSpecifiedIoTHubResource( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .deviceSecurityGroups() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", - "samplesecuritygroup", - com.azure.core.util.Context.NONE); + manager.deviceSecurityGroups().getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", + "samplesecuritygroup", com.azure.core.util.Context.NONE); } } ``` @@ -2768,23 +3526,25 @@ public final class DeviceSecurityGroupsGetSamples { ### DeviceSecurityGroups_List ```java -/** Samples for DeviceSecurityGroups List. */ +/** + * Samples for DeviceSecurityGroups List. + */ public final class DeviceSecurityGroupsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/ListDeviceSecurityGroups_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/ + * ListDeviceSecurityGroups_example.json */ /** * Sample code: List all device security groups for the specified IoT Hub resource. - * + * * @param manager Entry point to SecurityManager. */ public static void listAllDeviceSecurityGroupsForTheSpecifiedIoTHubResource( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .deviceSecurityGroups() - .list( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", - com.azure.core.util.Context.NONE); + manager.deviceSecurityGroups().list( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", + com.azure.core.util.Context.NONE); } } ``` @@ -2792,21 +3552,24 @@ public final class DeviceSecurityGroupsListSamples { ### DiscoveredSecuritySolutions_Get ```java -/** Samples for DiscoveredSecuritySolutions Get. */ +/** + * Samples for DiscoveredSecuritySolutions Get. + */ public final class DiscoveredSecuritySolutionsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionResourceGroupLocation_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions + * /GetDiscoveredSecuritySolutionResourceGroupLocation_example.json */ /** * Sample code: Get discovered security solution from a security data location. - * + * * @param manager Entry point to SecurityManager. */ public static void getDiscoveredSecuritySolutionFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .discoveredSecuritySolutions() - .getWithResponse("myRg2", "centralus", "paloalto7", com.azure.core.util.Context.NONE); + manager.discoveredSecuritySolutions().getWithResponse("myRg2", "centralus", "paloalto7", + com.azure.core.util.Context.NONE); } } ``` @@ -2814,14 +3577,18 @@ public final class DiscoveredSecuritySolutionsGetSamples { ### DiscoveredSecuritySolutions_List ```java -/** Samples for DiscoveredSecuritySolutions List. */ +/** + * Samples for DiscoveredSecuritySolutions List. + */ public final class DiscoveredSecuritySolutionsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionsSubscription_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions + * /GetDiscoveredSecuritySolutionsSubscription_example.json */ /** * Sample code: Get discovered security solutions. - * + * * @param manager Entry point to SecurityManager. */ public static void getDiscoveredSecuritySolutions(com.azure.resourcemanager.security.SecurityManager manager) { @@ -2833,14 +3600,18 @@ public final class DiscoveredSecuritySolutionsListSamples { ### DiscoveredSecuritySolutions_ListByHomeRegion ```java -/** Samples for DiscoveredSecuritySolutions ListByHomeRegion. */ +/** + * Samples for DiscoveredSecuritySolutions ListByHomeRegion. + */ public final class DiscoveredSecuritySolutionsListByHomeRegionSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionsSubscriptionLocation_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions + * /GetDiscoveredSecuritySolutionsSubscriptionLocation_example.json */ /** * Sample code: Get discovered security solutions from a security data location. - * + * * @param manager Entry point to SecurityManager. */ public static void getDiscoveredSecuritySolutionsFromASecurityDataLocation( @@ -2853,24 +3624,23 @@ public final class DiscoveredSecuritySolutionsListByHomeRegionSamples { ### ExternalSecuritySolutions_Get ```java -/** Samples for ExternalSecuritySolutions Get. */ +/** + * Samples for ExternalSecuritySolutions Get. + */ public final class ExternalSecuritySolutionsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/GetExternalSecuritySolution_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/ + * GetExternalSecuritySolution_example.json */ /** * Sample code: Get external security solution. - * + * * @param manager Entry point to SecurityManager. */ public static void getExternalSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .externalSecuritySolutions() - .getWithResponse( - "defaultresourcegroup-eus", - "centralus", - "aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus", - com.azure.core.util.Context.NONE); + manager.externalSecuritySolutions().getWithResponse("defaultresourcegroup-eus", "centralus", + "aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus", com.azure.core.util.Context.NONE); } } ``` @@ -2878,18 +3648,22 @@ public final class ExternalSecuritySolutionsGetSamples { ### ExternalSecuritySolutions_List ```java -/** Samples for ExternalSecuritySolutions List. */ +/** + * Samples for ExternalSecuritySolutions List. + */ public final class ExternalSecuritySolutionsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/GetExternalSecuritySolutionsSubscription_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/ + * GetExternalSecuritySolutionsSubscription_example.json */ /** * Sample code: Get external security solutions on a subscription. - * + * * @param manager Entry point to SecurityManager. */ - public static void getExternalSecuritySolutionsOnASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void + getExternalSecuritySolutionsOnASubscription(com.azure.resourcemanager.security.SecurityManager manager) { manager.externalSecuritySolutions().list(com.azure.core.util.Context.NONE); } } @@ -2898,14 +3672,18 @@ public final class ExternalSecuritySolutionsListSamples { ### ExternalSecuritySolutions_ListByHomeRegion ```java -/** Samples for ExternalSecuritySolutions ListByHomeRegion. */ +/** + * Samples for ExternalSecuritySolutions ListByHomeRegion. + */ public final class ExternalSecuritySolutionsListByHomeRegionSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/GetExternalSecuritySolutionsSubscriptionLocation_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/ + * GetExternalSecuritySolutionsSubscriptionLocation_example.json */ /** * Sample code: Get external security solutions on a subscription from security data location. - * + * * @param manager Entry point to SecurityManager. */ public static void getExternalSecuritySolutionsOnASubscriptionFromSecurityDataLocation( @@ -2915,6 +3693,268 @@ public final class ExternalSecuritySolutionsListByHomeRegionSamples { } ``` +### GitHubOwners_Get + +```java +/** + * Samples for GitHubOwners Get. + */ +public final class GitHubOwnersGetSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/GetGitHubOwners_example.json + */ + /** + * Sample code: Get_GitHubOwners. + * + * @param manager Entry point to SecurityManager. + */ + public static void getGitHubOwners(com.azure.resourcemanager.security.SecurityManager manager) { + manager.gitHubOwners().getWithResponse("myRg", "mySecurityConnectorName", "myGitHubOwner", + com.azure.core.util.Context.NONE); + } +} +``` + +### GitHubOwners_List + +```java +/** + * Samples for GitHubOwners List. + */ +public final class GitHubOwnersListSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/ListGitHubOwners_example.json + */ + /** + * Sample code: List_GitHubOwners. + * + * @param manager Entry point to SecurityManager. + */ + public static void listGitHubOwners(com.azure.resourcemanager.security.SecurityManager manager) { + manager.gitHubOwners().list("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + } +} +``` + +### GitHubOwners_ListAvailable + +```java +/** + * Samples for GitHubOwners ListAvailable. + */ +public final class GitHubOwnersListAvailableSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/ListAvailableGitHubOwners_example.json + */ + /** + * Sample code: ListAvailable_GitHubOwners. + * + * @param manager Entry point to SecurityManager. + */ + public static void listAvailableGitHubOwners(com.azure.resourcemanager.security.SecurityManager manager) { + manager.gitHubOwners().listAvailableWithResponse("myRg", "mySecurityConnectorName", + com.azure.core.util.Context.NONE); + } +} +``` + +### GitHubRepos_Get + +```java +/** + * Samples for GitHubRepos Get. + */ +public final class GitHubReposGetSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/GetGitHubRepos_example.json + */ + /** + * Sample code: Get_GitHubRepos. + * + * @param manager Entry point to SecurityManager. + */ + public static void getGitHubRepos(com.azure.resourcemanager.security.SecurityManager manager) { + manager.gitHubRepos().getWithResponse("myRg", "mySecurityConnectorName", "myGitHubOwner", "myGitHubRepo", + com.azure.core.util.Context.NONE); + } +} +``` + +### GitHubRepos_List + +```java +/** + * Samples for GitHubRepos List. + */ +public final class GitHubReposListSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/ListGitHubRepos_example.json + */ + /** + * Sample code: List_GitHubRepos. + * + * @param manager Entry point to SecurityManager. + */ + public static void listGitHubRepos(com.azure.resourcemanager.security.SecurityManager manager) { + manager.gitHubRepos().list("myRg", "mySecurityConnectorName", "myGitHubOwner", + com.azure.core.util.Context.NONE); + } +} +``` + +### GitLabGroups_Get + +```java +/** + * Samples for GitLabGroups Get. + */ +public final class GitLabGroupsGetSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/GetGitLabGroups_example.json + */ + /** + * Sample code: Get_GitLabGroups. + * + * @param manager Entry point to SecurityManager. + */ + public static void getGitLabGroups(com.azure.resourcemanager.security.SecurityManager manager) { + manager.gitLabGroups().getWithResponse("myRg", "mySecurityConnectorName", "myGitLabGroup$mySubGroup", + com.azure.core.util.Context.NONE); + } +} +``` + +### GitLabGroups_List + +```java +/** + * Samples for GitLabGroups List. + */ +public final class GitLabGroupsListSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/ListGitLabGroups_example.json + */ + /** + * Sample code: List_GitLabGroups. + * + * @param manager Entry point to SecurityManager. + */ + public static void listGitLabGroups(com.azure.resourcemanager.security.SecurityManager manager) { + manager.gitLabGroups().list("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + } +} +``` + +### GitLabGroups_ListAvailable + +```java +/** + * Samples for GitLabGroups ListAvailable. + */ +public final class GitLabGroupsListAvailableSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/ListAvailableGitLabGroups_example.json + */ + /** + * Sample code: ListAvailable_GitLabGroups. + * + * @param manager Entry point to SecurityManager. + */ + public static void listAvailableGitLabGroups(com.azure.resourcemanager.security.SecurityManager manager) { + manager.gitLabGroups().listAvailableWithResponse("myRg", "mySecurityConnectorName", + com.azure.core.util.Context.NONE); + } +} +``` + +### GitLabProjects_Get + +```java +/** + * Samples for GitLabProjects Get. + */ +public final class GitLabProjectsGetSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/GetGitLabProjects_example.json + */ + /** + * Sample code: Get_GitLabProjects. + * + * @param manager Entry point to SecurityManager. + */ + public static void getGitLabProjects(com.azure.resourcemanager.security.SecurityManager manager) { + manager.gitLabProjects().getWithResponse("myRg", "mySecurityConnectorName", "myGitLabGroup$mySubGroup", + "myGitLabProject", com.azure.core.util.Context.NONE); + } +} +``` + +### GitLabProjects_List + +```java +/** + * Samples for GitLabProjects List. + */ +public final class GitLabProjectsListSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/ListGitLabProjects_example.json + */ + /** + * Sample code: List_GitLabProjects. + * + * @param manager Entry point to SecurityManager. + */ + public static void listGitLabProjects(com.azure.resourcemanager.security.SecurityManager manager) { + manager.gitLabProjects().list("myRg", "mySecurityConnectorName", "myGitLabGroup$mySubGroup", + com.azure.core.util.Context.NONE); + } +} +``` + +### GitLabSubgroups_List + +```java +/** + * Samples for GitLabSubgroups List. + */ +public final class GitLabSubgroupsListSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/ + * SecurityConnectorsDevOps/ListGitLabSubgroups_example.json + */ + /** + * Sample code: List_GitLabSubgroups. + * + * @param manager Entry point to SecurityManager. + */ + public static void listGitLabSubgroups(com.azure.resourcemanager.security.SecurityManager manager) { + manager.gitLabSubgroups().listWithResponse("myRg", "mySecurityConnectorName", "myGitLabGroup", + com.azure.core.util.Context.NONE); + } +} +``` + ### GovernanceAssignments_CreateOrUpdate ```java @@ -2923,39 +3963,32 @@ import com.azure.resourcemanager.security.models.GovernanceEmailNotification; import com.azure.resourcemanager.security.models.RemediationEta; import java.time.OffsetDateTime; -/** Samples for GovernanceAssignments CreateOrUpdate. */ +/** + * Samples for GovernanceAssignments CreateOrUpdate. + */ public final class GovernanceAssignmentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceAssignments/PutGovernanceAssignment_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/ + * GovernanceAssignments/PutGovernanceAssignment_example.json */ /** * Sample code: Create Governance assignment. - * + * * @param manager Entry point to SecurityManager. */ public static void createGovernanceAssignment(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceAssignments() - .define("6634ff9f-127b-4bf2-8e6e-b1737f5e789c") - .withExistingAssessment( - "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", - "6b9421dd-5555-2251-9b3d-2be58e2f82cd") - .withOwner("user@contoso.com") + manager.governanceAssignments().define("6634ff9f-127b-4bf2-8e6e-b1737f5e789c").withExistingAssessment( + "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", + "6b9421dd-5555-2251-9b3d-2be58e2f82cd").withOwner("user@contoso.com") .withRemediationDueDate(OffsetDateTime.parse("2022-01-07T13:00:00.0000000Z")) - .withRemediationEta( - new RemediationEta() - .withEta(OffsetDateTime.parse("2022-01-08T13:00:00.0000000Z")) - .withJustification("Justification of ETA")) + .withRemediationEta(new RemediationEta().withEta(OffsetDateTime.parse("2022-01-08T13:00:00.0000000Z")) + .withJustification("Justification of ETA")) .withIsGracePeriod(true) - .withGovernanceEmailNotification( - new GovernanceEmailNotification() - .withDisableManagerEmailNotification(false) - .withDisableOwnerEmailNotification(false)) - .withAdditionalData( - new GovernanceAssignmentAdditionalData() - .withTicketNumber(123123) - .withTicketLink("https://snow.com") - .withTicketStatus("Active")) + .withGovernanceEmailNotification(new GovernanceEmailNotification() + .withDisableManagerEmailNotification(false).withDisableOwnerEmailNotification(false)) + .withAdditionalData(new GovernanceAssignmentAdditionalData().withTicketNumber(123123) + .withTicketLink("https://snow.com").withTicketStatus("Active")) .create(); } } @@ -2964,24 +3997,25 @@ public final class GovernanceAssignmentsCreateOrUpdateSamples { ### GovernanceAssignments_Delete ```java -/** Samples for GovernanceAssignments Delete. */ +/** + * Samples for GovernanceAssignments Delete. + */ public final class GovernanceAssignmentsDeleteSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceAssignments/DeleteGovernanceAssignment_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/ + * GovernanceAssignments/DeleteGovernanceAssignment_example.json */ /** * Sample code: Delete security assignment. - * + * * @param manager Entry point to SecurityManager. */ public static void deleteSecurityAssignment(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceAssignments() - .deleteWithResponse( - "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", - "6b9421dd-5555-2251-9b3d-2be58e2f82cd", - "6634ff9f-127b-4bf2-8e6e-b1737f5e789c", - com.azure.core.util.Context.NONE); + manager.governanceAssignments().deleteWithResponse( + "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", + "6b9421dd-5555-2251-9b3d-2be58e2f82cd", "6634ff9f-127b-4bf2-8e6e-b1737f5e789c", + com.azure.core.util.Context.NONE); } } ``` @@ -2989,25 +4023,26 @@ public final class GovernanceAssignmentsDeleteSamples { ### GovernanceAssignments_Get ```java -/** Samples for GovernanceAssignments Get. */ +/** + * Samples for GovernanceAssignments Get. + */ public final class GovernanceAssignmentsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceAssignments/GetGovernanceAssignment_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/ + * GovernanceAssignments/GetGovernanceAssignment_example.json */ /** * Sample code: Get governanceAssignment by specific governanceAssignmentKey. - * + * * @param manager Entry point to SecurityManager. */ public static void getGovernanceAssignmentBySpecificGovernanceAssignmentKey( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceAssignments() - .getWithResponse( - "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", - "6b9421dd-5555-2251-9b3d-2be58e2f82cd", - "6634ff9f-127b-4bf2-8e6e-b1737f5e789c", - com.azure.core.util.Context.NONE); + manager.governanceAssignments().getWithResponse( + "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", + "6b9421dd-5555-2251-9b3d-2be58e2f82cd", "6634ff9f-127b-4bf2-8e6e-b1737f5e789c", + com.azure.core.util.Context.NONE); } } ``` @@ -3015,23 +4050,23 @@ public final class GovernanceAssignmentsGetSamples { ### GovernanceAssignments_List ```java -/** Samples for GovernanceAssignments List. */ +/** + * Samples for GovernanceAssignments List. + */ public final class GovernanceAssignmentsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceAssignments/ListGovernanceAssignments_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/ + * GovernanceAssignments/ListGovernanceAssignments_example.json */ /** * Sample code: List governance assignments. - * + * * @param manager Entry point to SecurityManager. */ public static void listGovernanceAssignments(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceAssignments() - .list( - "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd", - "6b9421dd-5555-2251-9b3d-2be58e2f82cd", - com.azure.core.util.Context.NONE); + manager.governanceAssignments().list("subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd", + "6b9421dd-5555-2251-9b3d-2be58e2f82cd", com.azure.core.util.Context.NONE); } } ``` @@ -3049,136 +4084,92 @@ import com.azure.resourcemanager.security.models.GovernanceRuleType; import java.io.IOException; import java.util.Arrays; -/** Samples for GovernanceRules CreateOrUpdate. */ +/** + * Samples for GovernanceRules CreateOrUpdate. + */ public final class GovernanceRulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PutManagementGroupGovernanceRule_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ + * PutManagementGroupGovernanceRule_example.json */ /** * Sample code: Create or update governance rule over management group scope. - * + * * @param manager Entry point to SecurityManager. */ public static void createOrUpdateGovernanceRuleOverManagementGroupScope( com.azure.resourcemanager.security.SecurityManager manager) throws IOException { - manager - .governanceRules() - .define("ad9a8e26-29d9-4829-bb30-e597a58cdbb8") + manager.governanceRules().define("ad9a8e26-29d9-4829-bb30-e597a58cdbb8") .withExistingScope("providers/Microsoft.Management/managementGroups/contoso") - .withDisplayName("Management group rule") - .withDescription("A rule for a management group") - .withRemediationTimeframe("7.00:00:00") - .withIsGracePeriod(true) - .withRulePriority(200) - .withIsDisabled(false) + .withDisplayName("Management group rule").withDescription("A rule for a management group") + .withRemediationTimeframe("7.00:00:00").withIsGracePeriod(true).withRulePriority(200).withIsDisabled(false) .withRuleType(GovernanceRuleType.INTEGRATED) .withSourceResourceType(GovernanceRuleSourceResourceType.ASSESSMENTS) .withExcludedScopes(Arrays.asList("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23")) - .withConditionSets( - Arrays - .asList( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"conditions\":[{\"operator\":\"In\",\"property\":\"$.AssessmentKey\",\"value\":\"[\\\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\\\"," - + " \\\"fe83f80b-073d-4ccf-93d9-6797eb870201\\\"]\"}]}", - Object.class, - SerializerEncoding.JSON))) - .withOwnerSource( - new GovernanceRuleOwnerSource() - .withType(GovernanceRuleOwnerSourceType.MANUALLY) - .withValue("user@contoso.com")) - .withGovernanceEmailNotification( - new GovernanceRuleEmailNotification() - .withDisableManagerEmailNotification(true) - .withDisableOwnerEmailNotification(false)) + .withConditionSets(Arrays.asList(SerializerFactory.createDefaultManagementSerializerAdapter().deserialize( + "{\"conditions\":[{\"operator\":\"In\",\"property\":\"$.AssessmentKey\",\"value\":\"[\\\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\\\", \\\"fe83f80b-073d-4ccf-93d9-6797eb870201\\\"]\"}]}", + Object.class, SerializerEncoding.JSON))) + .withOwnerSource(new GovernanceRuleOwnerSource().withType(GovernanceRuleOwnerSourceType.MANUALLY) + .withValue("user@contoso.com")) + .withGovernanceEmailNotification(new GovernanceRuleEmailNotification() + .withDisableManagerEmailNotification(true).withDisableOwnerEmailNotification(false)) .create(); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PutSecurityConnectorGovernanceRule_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ + * PutSecurityConnectorGovernanceRule_example.json */ /** * Sample code: Create or update governance rule over security connector scope. - * + * * @param manager Entry point to SecurityManager. */ public static void createOrUpdateGovernanceRuleOverSecurityConnectorScope( com.azure.resourcemanager.security.SecurityManager manager) throws IOException { - manager - .governanceRules() - .define("ad9a8e26-29d9-4829-bb30-e597a58cdbb8") - .withExistingScope( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector") - .withDisplayName("GCP Admin's rule") - .withDescription("A rule on critical GCP recommendations") - .withRemediationTimeframe("7.00:00:00") - .withIsGracePeriod(true) - .withRulePriority(200) - .withIsDisabled(false) + manager.governanceRules().define("ad9a8e26-29d9-4829-bb30-e597a58cdbb8").withExistingScope( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector") + .withDisplayName("GCP Admin's rule").withDescription("A rule on critical GCP recommendations") + .withRemediationTimeframe("7.00:00:00").withIsGracePeriod(true).withRulePriority(200).withIsDisabled(false) .withRuleType(GovernanceRuleType.INTEGRATED) .withSourceResourceType(GovernanceRuleSourceResourceType.ASSESSMENTS) - .withConditionSets( - Arrays - .asList( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"conditions\":[{\"operator\":\"In\",\"property\":\"$.AssessmentKey\",\"value\":\"[\\\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\\\"," - + " \\\"fe83f80b-073d-4ccf-93d9-6797eb870201\\\"]\"}]}", - Object.class, - SerializerEncoding.JSON))) - .withOwnerSource( - new GovernanceRuleOwnerSource() - .withType(GovernanceRuleOwnerSourceType.MANUALLY) - .withValue("user@contoso.com")) - .withGovernanceEmailNotification( - new GovernanceRuleEmailNotification() - .withDisableManagerEmailNotification(true) - .withDisableOwnerEmailNotification(false)) + .withConditionSets(Arrays.asList(SerializerFactory.createDefaultManagementSerializerAdapter().deserialize( + "{\"conditions\":[{\"operator\":\"In\",\"property\":\"$.AssessmentKey\",\"value\":\"[\\\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\\\", \\\"fe83f80b-073d-4ccf-93d9-6797eb870201\\\"]\"}]}", + Object.class, SerializerEncoding.JSON))) + .withOwnerSource(new GovernanceRuleOwnerSource().withType(GovernanceRuleOwnerSourceType.MANUALLY) + .withValue("user@contoso.com")) + .withGovernanceEmailNotification(new GovernanceRuleEmailNotification() + .withDisableManagerEmailNotification(true).withDisableOwnerEmailNotification(false)) .create(); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PutGovernanceRule_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ + * PutGovernanceRule_example.json */ /** * Sample code: Create or update governance rule over subscription scope. - * + * * @param manager Entry point to SecurityManager. */ public static void createOrUpdateGovernanceRuleOverSubscriptionScope( com.azure.resourcemanager.security.SecurityManager manager) throws IOException { - manager - .governanceRules() - .define("ad9a8e26-29d9-4829-bb30-e597a58cdbb8") - .withExistingScope("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23") - .withDisplayName("Admin's rule") - .withDescription("A rule for critical recommendations") - .withRemediationTimeframe("7.00:00:00") - .withIsGracePeriod(true) - .withRulePriority(200) - .withIsDisabled(false) + manager.governanceRules().define("ad9a8e26-29d9-4829-bb30-e597a58cdbb8") + .withExistingScope("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23").withDisplayName("Admin's rule") + .withDescription("A rule for critical recommendations").withRemediationTimeframe("7.00:00:00") + .withIsGracePeriod(true).withRulePriority(200).withIsDisabled(false) .withRuleType(GovernanceRuleType.INTEGRATED) .withSourceResourceType(GovernanceRuleSourceResourceType.ASSESSMENTS) - .withConditionSets( - Arrays - .asList( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"conditions\":[{\"operator\":\"In\",\"property\":\"$.AssessmentKey\",\"value\":\"[\\\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\\\"," - + " \\\"fe83f80b-073d-4ccf-93d9-6797eb870201\\\"]\"}]}", - Object.class, - SerializerEncoding.JSON))) - .withOwnerSource( - new GovernanceRuleOwnerSource() - .withType(GovernanceRuleOwnerSourceType.MANUALLY) - .withValue("user@contoso.com")) - .withGovernanceEmailNotification( - new GovernanceRuleEmailNotification() - .withDisableManagerEmailNotification(false) - .withDisableOwnerEmailNotification(false)) + .withConditionSets(Arrays.asList(SerializerFactory.createDefaultManagementSerializerAdapter().deserialize( + "{\"conditions\":[{\"operator\":\"In\",\"property\":\"$.AssessmentKey\",\"value\":\"[\\\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\\\", \\\"fe83f80b-073d-4ccf-93d9-6797eb870201\\\"]\"}]}", + Object.class, SerializerEncoding.JSON))) + .withOwnerSource(new GovernanceRuleOwnerSource().withType(GovernanceRuleOwnerSourceType.MANUALLY) + .withValue("user@contoso.com")) + .withGovernanceEmailNotification(new GovernanceRuleEmailNotification() + .withDisableManagerEmailNotification(false).withDisableOwnerEmailNotification(false)) .create(); } } @@ -3187,60 +4178,57 @@ public final class GovernanceRulesCreateOrUpdateSamples { ### GovernanceRules_Delete ```java -/** Samples for GovernanceRules Delete. */ +/** + * Samples for GovernanceRules Delete. + */ public final class GovernanceRulesDeleteSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteManagementGroupGovernanceRule_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ + * DeleteManagementGroupGovernanceRule_example.json */ /** * Sample code: Delete a Governance rule over management group scope. - * + * * @param manager Entry point to SecurityManager. */ - public static void deleteAGovernanceRuleOverManagementGroupScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .delete( - "providers/Microsoft.Management/managementGroups/contoso", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - com.azure.core.util.Context.NONE); + public static void + deleteAGovernanceRuleOverManagementGroupScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceRules().delete("providers/Microsoft.Management/managementGroups/contoso", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteGovernanceRule_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ + * DeleteGovernanceRule_example.json */ /** * Sample code: Delete a Governance rule over subscription scope. - * + * * @param manager Entry point to SecurityManager. */ - public static void deleteAGovernanceRuleOverSubscriptionScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .delete( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - com.azure.core.util.Context.NONE); + public static void + deleteAGovernanceRuleOverSubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceRules().delete("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteSecurityConnectorGovernanceRule_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ + * DeleteSecurityConnectorGovernanceRule_example.json */ /** * Sample code: Delete a Governance rule over security connector scope. - * + * * @param manager Entry point to SecurityManager. */ - public static void deleteAGovernanceRuleOverSecurityConnectorScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .delete( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - com.azure.core.util.Context.NONE); + public static void + deleteAGovernanceRuleOverSecurityConnectorScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceRules().delete( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); } } ``` @@ -3248,63 +4236,58 @@ public final class GovernanceRulesDeleteSamples { ### GovernanceRules_Execute ```java -/** Samples for GovernanceRules Execute. */ + +/** + * Samples for GovernanceRules Execute. + */ public final class GovernanceRulesExecuteSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PostSecurityConnectorGovernanceRule_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ + * PostSecurityConnectorGovernanceRule_example.json */ /** * Sample code: Execute governance rule over security connector scope. - * + * * @param manager Entry point to SecurityManager. */ - public static void executeGovernanceRuleOverSecurityConnectorScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .execute( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - null, - com.azure.core.util.Context.NONE); + public static void + executeGovernanceRuleOverSecurityConnectorScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceRules().execute( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PostGovernanceRule_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ + * PostGovernanceRule_example.json */ /** * Sample code: Execute Governance rule over subscription scope. - * + * * @param manager Entry point to SecurityManager. */ - public static void executeGovernanceRuleOverSubscriptionScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .execute( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - null, - com.azure.core.util.Context.NONE); + public static void + executeGovernanceRuleOverSubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceRules().execute("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PostManagementGroupGovernanceRule_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ + * PostManagementGroupGovernanceRule_example.json */ /** * Sample code: Execute governance rule over management group scope. - * + * * @param manager Entry point to SecurityManager. */ - public static void executeGovernanceRuleOverManagementGroupScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .execute( - "providers/Microsoft.Management/managementGroups/contoso", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - null, - com.azure.core.util.Context.NONE); + public static void + executeGovernanceRuleOverManagementGroupScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceRules().execute("providers/Microsoft.Management/managementGroups/contoso", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", null, com.azure.core.util.Context.NONE); } } ``` @@ -3312,60 +4295,57 @@ public final class GovernanceRulesExecuteSamples { ### GovernanceRules_Get ```java -/** Samples for GovernanceRules Get. */ +/** + * Samples for GovernanceRules Get. + */ public final class GovernanceRulesGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetManagementGroupGovernanceRule_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ + * GetManagementGroupGovernanceRule_example.json */ /** * Sample code: Get a governance rule over management group scope. - * + * * @param manager Entry point to SecurityManager. */ - public static void getAGovernanceRuleOverManagementGroupScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .getWithResponse( - "providers/Microsoft.Management/managementGroups/contoso", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - com.azure.core.util.Context.NONE); + public static void + getAGovernanceRuleOverManagementGroupScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceRules().getWithResponse("providers/Microsoft.Management/managementGroups/contoso", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetGovernanceRule_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ + * GetGovernanceRule_example.json */ /** * Sample code: Get a governance rule over subscription scope. - * + * * @param manager Entry point to SecurityManager. */ - public static void getAGovernanceRuleOverSubscriptionScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - com.azure.core.util.Context.NONE); + public static void + getAGovernanceRuleOverSubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceRules().getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetSecurityConnectorGovernanceRule_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ + * GetSecurityConnectorGovernanceRule_example.json */ /** * Sample code: Get a governance rule over security connector scope. - * + * * @param manager Entry point to SecurityManager. */ - public static void getAGovernanceRuleOverSecurityConnectorScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - com.azure.core.util.Context.NONE); + public static void + getAGovernanceRuleOverSecurityConnectorScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceRules().getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); } } ``` @@ -3373,53 +4353,57 @@ public final class GovernanceRulesGetSamples { ### GovernanceRules_List ```java -/** Samples for GovernanceRules List. */ +/** + * Samples for GovernanceRules List. + */ public final class GovernanceRulesListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ListBySubscriptionGovernanceRules_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ + * ListBySubscriptionGovernanceRules_example.json */ /** * Sample code: List governance rules by subscription scope. - * + * * @param manager Entry point to SecurityManager. */ - public static void listGovernanceRulesBySubscriptionScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); + public static void + listGovernanceRulesBySubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceRules().list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ListBySecurityConnectorGovernanceRules_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ + * ListBySecurityConnectorGovernanceRules_example.json */ /** * Sample code: List governance rules by security connector scope. - * + * * @param manager Entry point to SecurityManager. */ - public static void listGovernanceRulesBySecurityConnectorScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .list( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", - com.azure.core.util.Context.NONE); + public static void + listGovernanceRulesBySecurityConnectorScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceRules().list( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ListByManagementGroupGovernanceRules_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ + * ListByManagementGroupGovernanceRules_example.json */ /** * Sample code: List governance rules by management group scope. - * + * * @param manager Entry point to SecurityManager. */ - public static void listGovernanceRulesByManagementGroupScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .list("providers/Microsoft.Management/managementGroups/contoso", com.azure.core.util.Context.NONE); + public static void + listGovernanceRulesByManagementGroupScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceRules().list("providers/Microsoft.Management/managementGroups/contoso", + com.azure.core.util.Context.NONE); } } ``` @@ -3427,87 +4411,85 @@ public final class GovernanceRulesListSamples { ### GovernanceRules_OperationResults ```java -/** Samples for GovernanceRules OperationResults. */ +/** + * Samples for GovernanceRules OperationResults. + */ public final class GovernanceRulesOperationResultsSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetManagementGroupGovernanceRuleExecuteStatus_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ + * GetManagementGroupGovernanceRuleExecuteStatus_example.json */ /** * Sample code: Get governance rules long run operation result over management group. - * + * * @param manager Entry point to SecurityManager. */ public static void getGovernanceRulesLongRunOperationResultOverManagementGroup( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .operationResultsWithResponse( - "providers/Microsoft.Management/managementGroups/contoso", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", - com.azure.core.util.Context.NONE); + manager.governanceRules().operationResultsWithResponse( + "providers/Microsoft.Management/managementGroups/contoso", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetSecurityConnectorGovernanceRuleExecuteStatus_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ + * GetSecurityConnectorGovernanceRuleExecuteStatus_example.json */ /** * Sample code: Get governance rules long run operation result over security connector. - * + * * @param manager Entry point to SecurityManager. */ public static void getGovernanceRulesLongRunOperationResultOverSecurityConnector( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .operationResultsWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", - com.azure.core.util.Context.NONE); + manager.governanceRules().operationResultsWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetGovernanceRuleExecuteStatus_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ + * GetGovernanceRuleExecuteStatus_example.json */ /** * Sample code: Get governance rules long run operation result over subscription. - * + * * @param manager Entry point to SecurityManager. */ public static void getGovernanceRulesLongRunOperationResultOverSubscription( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .operationResultsWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", - com.azure.core.util.Context.NONE); + manager.governanceRules().operationResultsWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", + com.azure.core.util.Context.NONE); } } ``` -### HealthReportOperation_Get +### HealthReports_Get ```java -/** Samples for HealthReportOperation Get. */ -public final class HealthReportOperationGetSamples { +/** + * Samples for HealthReports Get. + */ +public final class HealthReportsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/HealthReports/GetHealthReport_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-05-01-preview/examples/HealthReports/ + * GetHealthReports_example.json */ /** * Sample code: Get health report of resource. - * + * * @param manager Entry point to SecurityManager. */ public static void getHealthReportOfResource(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .healthReportOperations() - .getWithResponse( - "subscriptions/a1efb6ca-fbc5-4782-9aaa-5c7daded1ce2/resourcegroups/E2E-IBB0WX/providers/Microsoft.Security/securityconnectors/AwsConnectorAllOfferings", - "909c629a-bf39-4521-8e4f-10b443a0bc02", - com.azure.core.util.Context.NONE); + manager.healthReports().getWithResponse( + "subscriptions/a1efb6ca-fbc5-4782-9aaa-5c7daded1ce2/resourcegroups/E2E-IBB0WX/providers/Microsoft.Security/securityconnectors/AwsConnectorAllOfferings", + "909c629a-bf39-4521-8e4f-10b443a0bc02", com.azure.core.util.Context.NONE); } } ``` @@ -3515,20 +4497,23 @@ public final class HealthReportOperationGetSamples { ### HealthReports_List ```java -/** Samples for HealthReports List. */ +/** + * Samples for HealthReports List. + */ public final class HealthReportsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/HealthReports/ListHealthReports_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-05-01-preview/examples/HealthReports/ + * ListHealthReports_example.json */ /** * Sample code: List health reports. - * + * * @param manager Entry point to SecurityManager. */ public static void listHealthReports(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .healthReports() - .list("subscriptions/a1efb6ca-fbc5-4782-9aaa-5c7daded1ce2", com.azure.core.util.Context.NONE); + manager.healthReports().list("subscriptions/a1efb6ca-fbc5-4782-9aaa-5c7daded1ce2", + com.azure.core.util.Context.NONE); } } ``` @@ -3542,260 +4527,128 @@ import com.azure.resourcemanager.security.models.InformationType; import com.azure.resourcemanager.security.models.SensitivityLabel; import java.util.Arrays; import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -/** Samples for InformationProtectionPolicies CreateOrUpdate. */ -public final class InformationProtectionPoliciesCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/InformationProtectionPolicies/CreateOrUpdateInformationProtectionPolicy_example.json - */ - /** - * Sample code: Create or update an information protection policy for a management group. - * - * @param manager Entry point to SecurityManager. - */ - public static void createOrUpdateAnInformationProtectionPolicyForAManagementGroup( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .informationProtectionPolicies() - .define(InformationProtectionPolicyName.CUSTOM) - .withExistingScope("providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e") - .withLabels( - mapOf( - "1345da73-bc5a-4a8f-b7dd-3820eb713da8", - new SensitivityLabel().withDisplayName("Public").withOrder(100).withEnabled(true), - "575739d2-3d53-4df0-9042-4c7772d5c7b1", - new SensitivityLabel().withDisplayName("Confidential").withOrder(300).withEnabled(true), - "7aa516c7-5a53-4857-bc6e-6808c6acd542", - new SensitivityLabel().withDisplayName("General").withOrder(200).withEnabled(true))) - .withInformationTypes( - mapOf( - "3bf35491-99b8-41f2-86d5-c1200a7df658", - new InformationType() - .withDisplayName("Custom") - .withOrder(1400) - .withRecommendedLabelId(UUID.fromString("7aa516c7-5a53-4857-bc6e-6808c6acd542")) - .withEnabled(true) - .withCustom(true) - .withKeywords( - Arrays - .asList( - new InformationProtectionKeyword() - .withPattern("%custom%") - .withCustom(true) - .withCanBeNumeric(true))), - "7fb9419d-2473-4ad8-8e11-b25cc8cf6a07", - new InformationType() - .withDisplayName("Networking") - .withOrder(100) - .withRecommendedLabelId(UUID.fromString("575739d2-3d53-4df0-9042-4c7772d5c7b1")) - .withEnabled(true) - .withCustom(false) - .withKeywords( - Arrays - .asList( - new InformationProtectionKeyword() - .withPattern("%networking%") - .withCustom(true) - .withCanBeNumeric(false))))) - .create(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} -``` - -### InformationProtectionPolicies_Get - -```java -import com.azure.resourcemanager.security.models.InformationProtectionPolicyName; - -/** Samples for InformationProtectionPolicies Get. */ -public final class InformationProtectionPoliciesGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/InformationProtectionPolicies/GetCustomInformationProtectionPolicy_example.json - */ - /** - * Sample code: Get the customized information protection policy for a management group. - * - * @param manager Entry point to SecurityManager. - */ - public static void getTheCustomizedInformationProtectionPolicyForAManagementGroup( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .informationProtectionPolicies() - .getWithResponse( - "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", - InformationProtectionPolicyName.CUSTOM, - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/InformationProtectionPolicies/GetEffectiveInformationProtectionPolicy_example.json - */ - /** - * Sample code: Get the effective information protection policy for a management group. - * - * @param manager Entry point to SecurityManager. - */ - public static void getTheEffectiveInformationProtectionPolicyForAManagementGroup( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .informationProtectionPolicies() - .getWithResponse( - "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", - InformationProtectionPolicyName.EFFECTIVE, - com.azure.core.util.Context.NONE); - } -} -``` - -### InformationProtectionPolicies_List - -```java -/** Samples for InformationProtectionPolicies List. */ -public final class InformationProtectionPoliciesListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/InformationProtectionPolicies/ListInformationProtectionPolicies_example.json - */ - /** - * Sample code: Get information protection policies. - * - * @param manager Entry point to SecurityManager. - */ - public static void getInformationProtectionPolicies(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .informationProtectionPolicies() - .list( - "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", - com.azure.core.util.Context.NONE); - } -} -``` - -### IngestionSettings_Create - -```java -/** Samples for IngestionSettings Create. */ -public final class IngestionSettingsCreateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/CreateIngestionSetting_example.json - */ - /** - * Sample code: Create an ingestion setting for subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void createAnIngestionSettingForSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().define("default").create(); - } -} -``` - -### IngestionSettings_Delete - -```java -/** Samples for IngestionSettings Delete. */ -public final class IngestionSettingsDeleteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/DeleteIngestionSetting_example.json - */ - /** - * Sample code: Delete an ingestion setting for the subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteAnIngestionSettingForTheSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().deleteWithResponse("default", com.azure.core.util.Context.NONE); - } -} -``` - -### IngestionSettings_Get +import java.util.Map; +import java.util.UUID; -```java -/** Samples for IngestionSettings Get. */ -public final class IngestionSettingsGetSamples { +/** + * Samples for InformationProtectionPolicies CreateOrUpdate. + */ +public final class InformationProtectionPoliciesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/GetIngestionSetting_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/ + * InformationProtectionPolicies/CreateOrUpdateInformationProtectionPolicy_example.json */ /** - * Sample code: Get a ingestion setting on subscription. - * + * Sample code: Create or update an information protection policy for a management group. + * * @param manager Entry point to SecurityManager. */ - public static void getAIngestionSettingOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().getWithResponse("default", com.azure.core.util.Context.NONE); + public static void createOrUpdateAnInformationProtectionPolicyForAManagementGroup( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.informationProtectionPolicies().define(InformationProtectionPolicyName.CUSTOM) + .withExistingScope("providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e") + .withLabels( + mapOf("1345da73-bc5a-4a8f-b7dd-3820eb713da8", + new SensitivityLabel().withDisplayName("Public").withOrder(100).withEnabled(true), + "575739d2-3d53-4df0-9042-4c7772d5c7b1", + new SensitivityLabel().withDisplayName("Confidential").withOrder(300).withEnabled(true), + "7aa516c7-5a53-4857-bc6e-6808c6acd542", new SensitivityLabel().withDisplayName("General") + .withOrder(200).withEnabled(true))) + .withInformationTypes(mapOf("3bf35491-99b8-41f2-86d5-c1200a7df658", + new InformationType().withDisplayName("Custom").withOrder(1400) + .withRecommendedLabelId(UUID.fromString("7aa516c7-5a53-4857-bc6e-6808c6acd542")).withEnabled(true) + .withCustom(true) + .withKeywords(Arrays.asList(new InformationProtectionKeyword() + .withPattern("%custom%").withCustom(true).withCanBeNumeric(true))), + "7fb9419d-2473-4ad8-8e11-b25cc8cf6a07", + new InformationType().withDisplayName("Networking").withOrder(100) + .withRecommendedLabelId(UUID.fromString("575739d2-3d53-4df0-9042-4c7772d5c7b1")).withEnabled(true) + .withCustom(false).withKeywords(Arrays.asList(new InformationProtectionKeyword() + .withPattern("%networking%").withCustom(true).withCanBeNumeric(false))))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` -### IngestionSettings_List +### InformationProtectionPolicies_Get ```java -/** Samples for IngestionSettings List. */ -public final class IngestionSettingsListSamples { +import com.azure.resourcemanager.security.models.InformationProtectionPolicyName; + +/** + * Samples for InformationProtectionPolicies Get. + */ +public final class InformationProtectionPoliciesGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/GetIngestionSettings_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/ + * InformationProtectionPolicies/GetCustomInformationProtectionPolicy_example.json */ /** - * Sample code: Get ingestion settings on subscription. - * + * Sample code: Get the customized information protection policy for a management group. + * * @param manager Entry point to SecurityManager. */ - public static void getIngestionSettingsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().list(com.azure.core.util.Context.NONE); + public static void getTheCustomizedInformationProtectionPolicyForAManagementGroup( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.informationProtectionPolicies().getWithResponse( + "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", + InformationProtectionPolicyName.CUSTOM, com.azure.core.util.Context.NONE); } -} -``` - -### IngestionSettings_ListConnectionStrings -```java -/** Samples for IngestionSettings ListConnectionStrings. */ -public final class IngestionSettingsListConnectionStringsSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/ListConnectionStrings_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/ + * InformationProtectionPolicies/GetEffectiveInformationProtectionPolicy_example.json */ /** - * Sample code: List connection strings for ingesting security data and logs. - * + * Sample code: Get the effective information protection policy for a management group. + * * @param manager Entry point to SecurityManager. */ - public static void listConnectionStringsForIngestingSecurityDataAndLogs( + public static void getTheEffectiveInformationProtectionPolicyForAManagementGroup( com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().listConnectionStringsWithResponse("default", com.azure.core.util.Context.NONE); + manager.informationProtectionPolicies().getWithResponse( + "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", + InformationProtectionPolicyName.EFFECTIVE, com.azure.core.util.Context.NONE); } } ``` -### IngestionSettings_ListTokens +### InformationProtectionPolicies_List ```java -/** Samples for IngestionSettings ListTokens. */ -public final class IngestionSettingsListTokensSamples { +/** + * Samples for InformationProtectionPolicies List. + */ +public final class InformationProtectionPoliciesListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/ListTokensIngestionSetting_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/ + * InformationProtectionPolicies/ListInformationProtectionPolicies_example.json */ /** - * Sample code: List ingestion setting tokens. - * + * Sample code: Get information protection policies. + * * @param manager Entry point to SecurityManager. */ - public static void listIngestionSettingTokens(com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().listTokensWithResponse("default", com.azure.core.util.Context.NONE); + public static void getInformationProtectionPolicies(com.azure.resourcemanager.security.SecurityManager manager) { + manager.informationProtectionPolicies().list( + "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", + com.azure.core.util.Context.NONE); } } ``` @@ -3813,50 +4666,42 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for IotSecuritySolution CreateOrUpdate. */ +/** + * Samples for IotSecuritySolution CreateOrUpdate. + */ public final class IotSecuritySolutionCreateOrUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/CreateIoTSecuritySolution.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/ + * CreateIoTSecuritySolution.json */ /** * Sample code: Create or update a IoT security solution. - * + * * @param manager Entry point to SecurityManager. */ public static void createOrUpdateAIoTSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .iotSecuritySolutions() - .define("default") - .withExistingResourceGroup("MyGroup") - .withRegion("East Us") + manager.iotSecuritySolutions().define("default").withExistingResourceGroup("MyGroup").withRegion("East Us") .withTags(mapOf()) .withWorkspace( "/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1") - .withDisplayName("Solution Default") - .withStatus(SecuritySolutionStatus.ENABLED) - .withExport(Arrays.asList()) + .withDisplayName("Solution Default").withStatus(SecuritySolutionStatus.ENABLED).withExport(Arrays.asList()) .withDisabledDataSources(Arrays.asList()) - .withIotHubs( - Arrays - .asList( - "/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")) - .withUserDefinedResources( - new UserDefinedResourcesProperties() - .withQuery("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\"") - .withQuerySubscriptions(Arrays.asList("075423e9-7d33-4166-8bdf-3920b04e3735"))) - .withRecommendationsConfiguration( - Arrays - .asList( - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_OPEN_PORTS) - .withStatus(RecommendationConfigStatus.DISABLED), - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_SHARED_CREDENTIALS) - .withStatus(RecommendationConfigStatus.DISABLED))) - .withUnmaskedIpLoggingStatus(UnmaskedIpLoggingStatus.ENABLED) - .create(); - } - + .withIotHubs(Arrays.asList( + "/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")) + .withUserDefinedResources(new UserDefinedResourcesProperties() + .withQuery("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\"") + .withQuerySubscriptions(Arrays.asList("075423e9-7d33-4166-8bdf-3920b04e3735"))) + .withRecommendationsConfiguration(Arrays.asList( + new RecommendationConfigurationProperties().withRecommendationType(RecommendationType.IO_T_OPEN_PORTS) + .withStatus(RecommendationConfigStatus.DISABLED), + new RecommendationConfigurationProperties() + .withRecommendationType(RecommendationType.IO_T_SHARED_CREDENTIALS) + .withStatus(RecommendationConfigStatus.DISABLED))) + .withUnmaskedIpLoggingStatus(UnmaskedIpLoggingStatus.ENABLED).create(); + } + + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -3873,20 +4718,23 @@ public final class IotSecuritySolutionCreateOrUpdateSamples { ### IotSecuritySolution_Delete ```java -/** Samples for IotSecuritySolution Delete. */ +/** + * Samples for IotSecuritySolution Delete. + */ public final class IotSecuritySolutionDeleteSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/DeleteIoTSecuritySolution.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/ + * DeleteIoTSecuritySolution.json */ /** * Sample code: Delete an IoT security solution. - * + * * @param manager Entry point to SecurityManager. */ public static void deleteAnIoTSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .iotSecuritySolutions() - .deleteByResourceGroupWithResponse("MyGroup", "default", com.azure.core.util.Context.NONE); + manager.iotSecuritySolutions().deleteByResourceGroupWithResponse("MyGroup", "default", + com.azure.core.util.Context.NONE); } } ``` @@ -3894,20 +4742,23 @@ public final class IotSecuritySolutionDeleteSamples { ### IotSecuritySolution_GetByResourceGroup ```java -/** Samples for IotSecuritySolution GetByResourceGroup. */ +/** + * Samples for IotSecuritySolution GetByResourceGroup. + */ public final class IotSecuritySolutionGetByResourceGroupSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolution.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/ + * GetIoTSecuritySolution.json */ /** * Sample code: Get a IoT security solution. - * + * * @param manager Entry point to SecurityManager. */ public static void getAIoTSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .iotSecuritySolutions() - .getByResourceGroupWithResponse("MyGroup", "default", com.azure.core.util.Context.NONE); + manager.iotSecuritySolutions().getByResourceGroupWithResponse("MyGroup", "default", + com.azure.core.util.Context.NONE); } } ``` @@ -3915,36 +4766,39 @@ public final class IotSecuritySolutionGetByResourceGroupSamples { ### IotSecuritySolution_List ```java -/** Samples for IotSecuritySolution List. */ +/** + * Samples for IotSecuritySolution List. + */ public final class IotSecuritySolutionListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsList.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/ + * GetIoTSecuritySolutionsList.json */ /** * Sample code: List IoT Security solutions by subscription. - * + * * @param manager Entry point to SecurityManager. */ - public static void listIoTSecuritySolutionsBySubscription( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void + listIoTSecuritySolutionsBySubscription(com.azure.resourcemanager.security.SecurityManager manager) { manager.iotSecuritySolutions().list(null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsListByIotHub.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/ + * GetIoTSecuritySolutionsListByIotHub.json */ /** * Sample code: List IoT Security solutions by IoT Hub. - * + * * @param manager Entry point to SecurityManager. */ public static void listIoTSecuritySolutionsByIoTHub(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .iotSecuritySolutions() - .list( - "properties.iotHubs/any(i eq" - + " \"/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub\")", - com.azure.core.util.Context.NONE); + manager.iotSecuritySolutions().list( + "properties.iotHubs/any(i eq \"/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub\")", + com.azure.core.util.Context.NONE); } } ``` @@ -3952,37 +4806,39 @@ public final class IotSecuritySolutionListSamples { ### IotSecuritySolution_ListByResourceGroup ```java -/** Samples for IotSecuritySolution ListByResourceGroup. */ +/** + * Samples for IotSecuritySolution ListByResourceGroup. + */ public final class IotSecuritySolutionListByResourceGroupSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsListByIotHubAndRg.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/ + * GetIoTSecuritySolutionsListByIotHubAndRg.json */ /** * Sample code: List IoT Security solutions by resource group and IoT Hub. - * + * * @param manager Entry point to SecurityManager. */ - public static void listIoTSecuritySolutionsByResourceGroupAndIoTHub( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .iotSecuritySolutions() - .listByResourceGroup( - "MyRg", - "properties.iotHubs/any(i eq" - + " \"/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub\")", - com.azure.core.util.Context.NONE); + public static void + listIoTSecuritySolutionsByResourceGroupAndIoTHub(com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutions().listByResourceGroup("MyRg", + "properties.iotHubs/any(i eq \"/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub\")", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsListByRg.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/ + * GetIoTSecuritySolutionsListByRg.json */ /** * Sample code: List IoT Security solutions by resource group. - * + * * @param manager Entry point to SecurityManager. */ - public static void listIoTSecuritySolutionsByResourceGroup( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void + listIoTSecuritySolutionsByResourceGroup(com.azure.resourcemanager.security.SecurityManager manager) { manager.iotSecuritySolutions().listByResourceGroup("MyGroup", null, com.azure.core.util.Context.NONE); } } @@ -4000,42 +4856,38 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for IotSecuritySolution Update. */ +/** + * Samples for IotSecuritySolution Update. + */ public final class IotSecuritySolutionUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/UpdateIoTSecuritySolution.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/ + * UpdateIoTSecuritySolution.json */ /** * Sample code: Use this method to update existing IoT Security solution. - * + * * @param manager Entry point to SecurityManager. */ - public static void useThisMethodToUpdateExistingIoTSecuritySolution( - com.azure.resourcemanager.security.SecurityManager manager) { - IoTSecuritySolutionModel resource = - manager - .iotSecuritySolutions() - .getByResourceGroupWithResponse("myRg", "default", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .withTags(mapOf("foo", "bar")) - .withUserDefinedResources( - new UserDefinedResourcesProperties() - .withQuery("where type != \"microsoft.devices/iothubs\" | where name contains \"v2\"") - .withQuerySubscriptions(Arrays.asList("075423e9-7d33-4166-8bdf-3920b04e3735"))) - .withRecommendationsConfiguration( - Arrays - .asList( - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_OPEN_PORTS) - .withStatus(RecommendationConfigStatus.DISABLED), - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_SHARED_CREDENTIALS) - .withStatus(RecommendationConfigStatus.DISABLED))) + public static void + useThisMethodToUpdateExistingIoTSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { + IoTSecuritySolutionModel resource = manager.iotSecuritySolutions() + .getByResourceGroupWithResponse("myRg", "default", com.azure.core.util.Context.NONE).getValue(); + resource.update().withTags(mapOf("foo", "bar")) + .withUserDefinedResources(new UserDefinedResourcesProperties() + .withQuery("where type != \"microsoft.devices/iothubs\" | where name contains \"v2\"") + .withQuerySubscriptions(Arrays.asList("075423e9-7d33-4166-8bdf-3920b04e3735"))) + .withRecommendationsConfiguration(Arrays.asList( + new RecommendationConfigurationProperties().withRecommendationType(RecommendationType.IO_T_OPEN_PORTS) + .withStatus(RecommendationConfigStatus.DISABLED), + new RecommendationConfigurationProperties() + .withRecommendationType(RecommendationType.IO_T_SHARED_CREDENTIALS) + .withStatus(RecommendationConfigStatus.DISABLED))) .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -4052,14 +4904,17 @@ public final class IotSecuritySolutionUpdateSamples { ### IotSecuritySolutionAnalytics_Get ```java -/** Samples for IotSecuritySolutionAnalytics Get. */ +/** + * Samples for IotSecuritySolutionAnalytics Get. + */ public final class IotSecuritySolutionAnalyticsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAnalytics.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/ + * IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAnalytics.json */ /** * Sample code: Get Security Solution Analytics. - * + * * @param manager Entry point to SecurityManager. */ public static void getSecuritySolutionAnalytics(com.azure.resourcemanager.security.SecurityManager manager) { @@ -4071,14 +4926,17 @@ public final class IotSecuritySolutionAnalyticsGetSamples { ### IotSecuritySolutionAnalytics_List ```java -/** Samples for IotSecuritySolutionAnalytics List. */ +/** + * Samples for IotSecuritySolutionAnalytics List. + */ public final class IotSecuritySolutionAnalyticsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAnalyticsList.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/ + * IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAnalyticsList.json */ /** * Sample code: Get Security Solution Analytics. - * + * * @param manager Entry point to SecurityManager. */ public static void getSecuritySolutionAnalytics(com.azure.resourcemanager.security.SecurityManager manager) { @@ -4090,25 +4948,23 @@ public final class IotSecuritySolutionAnalyticsListSamples { ### IotSecuritySolutionsAnalyticsAggregatedAlert_Dismiss ```java -/** Samples for IotSecuritySolutionsAnalyticsAggregatedAlert Dismiss. */ +/** + * Samples for IotSecuritySolutionsAnalyticsAggregatedAlert Dismiss. + */ public final class IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/PostIoTSecuritySolutionsSecurityAggregatedAlertDismiss.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/ + * IoTSecuritySolutionsAnalytics/PostIoTSecuritySolutionsSecurityAggregatedAlertDismiss.json */ /** * Sample code: Dismiss an aggregated IoT Security Solution Alert. - * + * * @param manager Entry point to SecurityManager. */ - public static void dismissAnAggregatedIoTSecuritySolutionAlert( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .iotSecuritySolutionsAnalyticsAggregatedAlerts() - .dismissWithResponse( - "IoTEdgeResources", - "default", - "IoT_Bruteforce_Fail/2019-02-02/dismiss", - com.azure.core.util.Context.NONE); + public static void + dismissAnAggregatedIoTSecuritySolutionAlert(com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutionsAnalyticsAggregatedAlerts().dismissWithResponse("IoTEdgeResources", "default", + "IoT_Bruteforce_Fail/2019-02-02/dismiss", com.azure.core.util.Context.NONE); } } ``` @@ -4116,23 +4972,25 @@ public final class IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples { ### IotSecuritySolutionsAnalyticsAggregatedAlert_Get ```java -/** Samples for IotSecuritySolutionsAnalyticsAggregatedAlert Get. */ +/** + * Samples for IotSecuritySolutionsAnalyticsAggregatedAlert Get. + */ public final class IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAggregatedAlert.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/ + * IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAggregatedAlert.json */ /** * Sample code: Get the aggregated security analytics alert of yours IoT Security solution. This aggregation is * performed by alert name. - * + * * @param manager Entry point to SecurityManager. */ public static void getTheAggregatedSecurityAnalyticsAlertOfYoursIoTSecuritySolutionThisAggregationIsPerformedByAlertName( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .iotSecuritySolutionsAnalyticsAggregatedAlerts() - .getWithResponse("MyGroup", "default", "IoT_Bruteforce_Fail/2019-02-02", com.azure.core.util.Context.NONE); + manager.iotSecuritySolutionsAnalyticsAggregatedAlerts().getWithResponse("MyGroup", "default", + "IoT_Bruteforce_Fail/2019-02-02", com.azure.core.util.Context.NONE); } } ``` @@ -4140,21 +4998,23 @@ public final class IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples { ### IotSecuritySolutionsAnalyticsAggregatedAlert_List ```java -/** Samples for IotSecuritySolutionsAnalyticsAggregatedAlert List. */ +/** + * Samples for IotSecuritySolutionsAnalyticsAggregatedAlert List. + */ public final class IotSecuritySolutionsAnalyticsAggregatedAlertListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAggregatedAlertList.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/ + * IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAggregatedAlertList.json */ /** * Sample code: Get the aggregated alert list of yours IoT Security solution. - * + * * @param manager Entry point to SecurityManager. */ public static void getTheAggregatedAlertListOfYoursIoTSecuritySolution( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .iotSecuritySolutionsAnalyticsAggregatedAlerts() - .list("MyGroup", "default", null, com.azure.core.util.Context.NONE); + manager.iotSecuritySolutionsAnalyticsAggregatedAlerts().list("MyGroup", "default", null, + com.azure.core.util.Context.NONE); } } ``` @@ -4162,21 +5022,23 @@ public final class IotSecuritySolutionsAnalyticsAggregatedAlertListSamples { ### IotSecuritySolutionsAnalyticsRecommendation_Get ```java -/** Samples for IotSecuritySolutionsAnalyticsRecommendation Get. */ +/** + * Samples for IotSecuritySolutionsAnalyticsRecommendation Get. + */ public final class IotSecuritySolutionsAnalyticsRecommendationGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityRecommendation.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/ + * IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityRecommendation.json */ /** * Sample code: Get the aggregated security analytics recommendation of yours IoT Security solution. - * + * * @param manager Entry point to SecurityManager. */ public static void getTheAggregatedSecurityAnalyticsRecommendationOfYoursIoTSecuritySolution( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .iotSecuritySolutionsAnalyticsRecommendations() - .getWithResponse("IoTEdgeResources", "default", "OpenPortsOnDevice", com.azure.core.util.Context.NONE); + manager.iotSecuritySolutionsAnalyticsRecommendations().getWithResponse("IoTEdgeResources", "default", + "OpenPortsOnDevice", com.azure.core.util.Context.NONE); } } ``` @@ -4184,21 +5046,23 @@ public final class IotSecuritySolutionsAnalyticsRecommendationGetSamples { ### IotSecuritySolutionsAnalyticsRecommendation_List ```java -/** Samples for IotSecuritySolutionsAnalyticsRecommendation List. */ +/** + * Samples for IotSecuritySolutionsAnalyticsRecommendation List. + */ public final class IotSecuritySolutionsAnalyticsRecommendationListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityRecommendationList.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/ + * IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityRecommendationList.json */ /** * Sample code: Get the list of aggregated security analytics recommendations of yours IoT Security solution. - * + * * @param manager Entry point to SecurityManager. */ public static void getTheListOfAggregatedSecurityAnalyticsRecommendationsOfYoursIoTSecuritySolution( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .iotSecuritySolutionsAnalyticsRecommendations() - .list("IoTEdgeResources", "default", null, com.azure.core.util.Context.NONE); + manager.iotSecuritySolutionsAnalyticsRecommendations().list("IoTEdgeResources", "default", null, + com.azure.core.util.Context.NONE); } } ``` @@ -4217,63 +5081,39 @@ import com.azure.resourcemanager.security.models.StatusReason; import java.time.OffsetDateTime; import java.util.Arrays; -/** Samples for JitNetworkAccessPolicies CreateOrUpdate. */ +/** + * Samples for JitNetworkAccessPolicies CreateOrUpdate. + */ public final class JitNetworkAccessPoliciesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/CreateJitNetworkAccessPolicy_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/ + * CreateJitNetworkAccessPolicy_example.json */ /** * Sample code: Create JIT network access policy. - * + * * @param manager Entry point to SecurityManager. */ public static void createJITNetworkAccessPolicy(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .jitNetworkAccessPolicies() - .define("default") - .withExistingLocation("myRg1", "westeurope") - .withVirtualMachines( - Arrays - .asList( - new JitNetworkAccessPolicyVirtualMachine() - .withId( - "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1") - .withPorts( - Arrays - .asList( - new JitNetworkAccessPortRule() - .withNumber(22) - .withProtocol(Protocol.ASTERISK) - .withAllowedSourceAddressPrefix("*") - .withMaxRequestAccessDuration("PT3H"), - new JitNetworkAccessPortRule() - .withNumber(3389) - .withProtocol(Protocol.ASTERISK) - .withAllowedSourceAddressPrefix("*") - .withMaxRequestAccessDuration("PT3H"))))) + manager.jitNetworkAccessPolicies().define("default").withExistingLocation("myRg1", "westeurope") + .withVirtualMachines(Arrays.asList(new JitNetworkAccessPolicyVirtualMachine().withId( + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1") + .withPorts(Arrays.asList( + new JitNetworkAccessPortRule().withNumber(22).withProtocol(Protocol.ASTERISK) + .withAllowedSourceAddressPrefix("*").withMaxRequestAccessDuration("PT3H"), + new JitNetworkAccessPortRule().withNumber(3389).withProtocol(Protocol.ASTERISK) + .withAllowedSourceAddressPrefix("*").withMaxRequestAccessDuration("PT3H"))))) .withKind("Basic") - .withRequests( - Arrays - .asList( - new JitNetworkAccessRequestInner() - .withVirtualMachines( - Arrays - .asList( - new JitNetworkAccessRequestVirtualMachine() - .withId( - "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1") - .withPorts( - Arrays - .asList( - new JitNetworkAccessRequestPort() - .withNumber(3389) - .withAllowedSourceAddressPrefix("192.127.0.2") - .withEndTimeUtc( - OffsetDateTime.parse("2018-05-17T09:06:45.5691611Z")) - .withStatus(Status.INITIATED) - .withStatusReason(StatusReason.USER_REQUESTED))))) - .withStartTimeUtc(OffsetDateTime.parse("2018-05-17T08:06:45.5691611Z")) - .withRequestor("barbara@contoso.com"))) + .withRequests(Arrays.asList(new JitNetworkAccessRequestInner() + .withVirtualMachines(Arrays.asList(new JitNetworkAccessRequestVirtualMachine().withId( + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1") + .withPorts(Arrays.asList( + new JitNetworkAccessRequestPort().withNumber(3389).withAllowedSourceAddressPrefix("192.127.0.2") + .withEndTimeUtc(OffsetDateTime.parse("2018-05-17T09:06:45.5691611Z")) + .withStatus(Status.INITIATED).withStatusReason(StatusReason.USER_REQUESTED))))) + .withStartTimeUtc(OffsetDateTime.parse("2018-05-17T08:06:45.5691611Z")) + .withRequestor("barbara@contoso.com"))) .create(); } } @@ -4282,20 +5122,23 @@ public final class JitNetworkAccessPoliciesCreateOrUpdateSamples { ### JitNetworkAccessPolicies_Delete ```java -/** Samples for JitNetworkAccessPolicies Delete. */ +/** + * Samples for JitNetworkAccessPolicies Delete. + */ public final class JitNetworkAccessPoliciesDeleteSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/DeleteJitNetworkAccessPolicy_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/ + * DeleteJitNetworkAccessPolicy_example.json */ /** * Sample code: Delete a JIT network access policy. - * + * * @param manager Entry point to SecurityManager. */ public static void deleteAJITNetworkAccessPolicy(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .jitNetworkAccessPolicies() - .deleteWithResponse("myRg1", "westeurope", "default", com.azure.core.util.Context.NONE); + manager.jitNetworkAccessPolicies().deleteWithResponse("myRg1", "westeurope", "default", + com.azure.core.util.Context.NONE); } } ``` @@ -4303,20 +5146,23 @@ public final class JitNetworkAccessPoliciesDeleteSamples { ### JitNetworkAccessPolicies_Get ```java -/** Samples for JitNetworkAccessPolicies Get. */ +/** + * Samples for JitNetworkAccessPolicies Get. + */ public final class JitNetworkAccessPoliciesGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPolicy_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/ + * GetJitNetworkAccessPolicy_example.json */ /** * Sample code: Get JIT network access policy. - * + * * @param manager Entry point to SecurityManager. */ public static void getJITNetworkAccessPolicy(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .jitNetworkAccessPolicies() - .getWithResponse("myRg1", "westeurope", "default", com.azure.core.util.Context.NONE); + manager.jitNetworkAccessPolicies().getWithResponse("myRg1", "westeurope", "default", + com.azure.core.util.Context.NONE); } } ``` @@ -4329,39 +5175,30 @@ import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateR import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateVirtualMachine; import java.util.Arrays; -/** Samples for JitNetworkAccessPolicies Initiate. */ +/** + * Samples for JitNetworkAccessPolicies Initiate. + */ public final class JitNetworkAccessPoliciesInitiateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/InitiateJitNetworkAccessPolicy_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/ + * InitiateJitNetworkAccessPolicy_example.json */ /** * Sample code: Initiate an action on a JIT network access policy. - * + * * @param manager Entry point to SecurityManager. */ - public static void initiateAnActionOnAJITNetworkAccessPolicy( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .jitNetworkAccessPolicies() - .initiateWithResponse( - "myRg1", - "westeurope", - "default", - new JitNetworkAccessPolicyInitiateRequest() - .withVirtualMachines( - Arrays - .asList( - new JitNetworkAccessPolicyInitiateVirtualMachine() - .withId( - "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1") - .withPorts( - Arrays - .asList( - new JitNetworkAccessPolicyInitiatePort() - .withNumber(3389) - .withAllowedSourceAddressPrefix("192.127.0.2"))))) - .withJustification("testing a new version of the product"), - com.azure.core.util.Context.NONE); + public static void + initiateAnActionOnAJITNetworkAccessPolicy(com.azure.resourcemanager.security.SecurityManager manager) { + manager.jitNetworkAccessPolicies().initiateWithResponse("myRg1", "westeurope", "default", + new JitNetworkAccessPolicyInitiateRequest() + .withVirtualMachines(Arrays.asList(new JitNetworkAccessPolicyInitiateVirtualMachine().withId( + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1") + .withPorts(Arrays.asList(new JitNetworkAccessPolicyInitiatePort().withNumber(3389) + .withAllowedSourceAddressPrefix("192.127.0.2"))))) + .withJustification("testing a new version of the product"), + com.azure.core.util.Context.NONE); } } ``` @@ -4369,18 +5206,22 @@ public final class JitNetworkAccessPoliciesInitiateSamples { ### JitNetworkAccessPolicies_List ```java -/** Samples for JitNetworkAccessPolicies List. */ +/** + * Samples for JitNetworkAccessPolicies List. + */ public final class JitNetworkAccessPoliciesListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesSubscription_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/ + * GetJitNetworkAccessPoliciesSubscription_example.json */ /** * Sample code: Get JIT network access policies on a subscription. - * + * * @param manager Entry point to SecurityManager. */ - public static void getJITNetworkAccessPoliciesOnASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void + getJITNetworkAccessPoliciesOnASubscription(com.azure.resourcemanager.security.SecurityManager manager) { manager.jitNetworkAccessPolicies().list(com.azure.core.util.Context.NONE); } } @@ -4389,14 +5230,18 @@ public final class JitNetworkAccessPoliciesListSamples { ### JitNetworkAccessPolicies_ListByRegion ```java -/** Samples for JitNetworkAccessPolicies ListByRegion. */ +/** + * Samples for JitNetworkAccessPolicies ListByRegion. + */ public final class JitNetworkAccessPoliciesListByRegionSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesSubscriptionLocation_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/ + * GetJitNetworkAccessPoliciesSubscriptionLocation_example.json */ /** * Sample code: Get JIT network access policies on a subscription from a security data location. - * + * * @param manager Entry point to SecurityManager. */ public static void getJITNetworkAccessPoliciesOnASubscriptionFromASecurityDataLocation( @@ -4409,18 +5254,22 @@ public final class JitNetworkAccessPoliciesListByRegionSamples { ### JitNetworkAccessPolicies_ListByResourceGroup ```java -/** Samples for JitNetworkAccessPolicies ListByResourceGroup. */ +/** + * Samples for JitNetworkAccessPolicies ListByResourceGroup. + */ public final class JitNetworkAccessPoliciesListByResourceGroupSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesResourceGroup_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/ + * GetJitNetworkAccessPoliciesResourceGroup_example.json */ /** * Sample code: Get JIT network access policies on a resource group. - * + * * @param manager Entry point to SecurityManager. */ - public static void getJITNetworkAccessPoliciesOnAResourceGroup( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void + getJITNetworkAccessPoliciesOnAResourceGroup(com.azure.resourcemanager.security.SecurityManager manager) { manager.jitNetworkAccessPolicies().listByResourceGroup("myRg1", com.azure.core.util.Context.NONE); } } @@ -4429,21 +5278,24 @@ public final class JitNetworkAccessPoliciesListByResourceGroupSamples { ### JitNetworkAccessPolicies_ListByResourceGroupAndRegion ```java -/** Samples for JitNetworkAccessPolicies ListByResourceGroupAndRegion. */ +/** + * Samples for JitNetworkAccessPolicies ListByResourceGroupAndRegion. + */ public final class JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesResourceGroupLocation_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/ + * GetJitNetworkAccessPoliciesResourceGroupLocation_example.json */ /** * Sample code: Get JIT network access policies on a resource group from a security data location. - * + * * @param manager Entry point to SecurityManager. */ public static void getJITNetworkAccessPoliciesOnAResourceGroupFromASecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .jitNetworkAccessPolicies() - .listByResourceGroupAndRegion("myRg1", "westeurope", com.azure.core.util.Context.NONE); + manager.jitNetworkAccessPolicies().listByResourceGroupAndRegion("myRg1", "westeurope", + com.azure.core.util.Context.NONE); } } ``` @@ -4451,14 +5303,18 @@ public final class JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples { ### Locations_Get ```java -/** Samples for Locations Get. */ +/** + * Samples for Locations Get. + */ public final class LocationsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Locations/GetLocation_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Locations/ + * GetLocation_example.json */ /** * Sample code: Get security data location. - * + * * @param manager Entry point to SecurityManager. */ public static void getSecurityDataLocation(com.azure.resourcemanager.security.SecurityManager manager) { @@ -4470,14 +5326,18 @@ public final class LocationsGetSamples { ### Locations_List ```java -/** Samples for Locations List. */ +/** + * Samples for Locations List. + */ public final class LocationsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Locations/GetLocations_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Locations/ + * GetLocations_example.json */ /** * Sample code: Get security data locations. - * + * * @param manager Entry point to SecurityManager. */ public static void getSecurityDataLocations(com.azure.resourcemanager.security.SecurityManager manager) { @@ -4489,14 +5349,18 @@ public final class LocationsListSamples { ### MdeOnboardings_Get ```java -/** Samples for MdeOnboardings Get. */ +/** + * Samples for MdeOnboardings Get. + */ public final class MdeOnboardingsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-10-01-preview/examples/MdeOnboardings/GetMdeOnboardings_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2021-10-01-preview/examples/MdeOnboardings/ + * GetMdeOnboardings_example.json */ /** * Sample code: The default configuration or data needed to onboard the machine to MDE. - * + * * @param manager Entry point to SecurityManager. */ public static void theDefaultConfigurationOrDataNeededToOnboardTheMachineToMDE( @@ -4509,14 +5373,18 @@ public final class MdeOnboardingsGetSamples { ### MdeOnboardings_List ```java -/** Samples for MdeOnboardings List. */ +/** + * Samples for MdeOnboardings List. + */ public final class MdeOnboardingsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-10-01-preview/examples/MdeOnboardings/ListMdeOnboardings_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2021-10-01-preview/examples/MdeOnboardings/ + * ListMdeOnboardings_example.json */ /** * Sample code: The configuration or data needed to onboard the machine to MDE. - * + * * @param manager Entry point to SecurityManager. */ public static void theConfigurationOrDataNeededToOnboardTheMachineToMDE( @@ -4526,73 +5394,132 @@ public final class MdeOnboardingsListSamples { } ``` +### Pricings_Delete + +```java +/** + * Samples for Pricings Delete. + */ +public final class PricingsDeleteSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ + * DeleteResourcePricing_example.json + */ + /** + * Sample code: Delete a pricing on resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteAPricingOnResource(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings().deleteByResourceGroupWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1", + "VirtualMachines", com.azure.core.util.Context.NONE); + } +} +``` + ### Pricings_Get ```java -/** Samples for Pricings Get. */ +/** + * Samples for Pricings Get. + */ public final class PricingsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/GetPricingByNameCloudPosture_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ + * GetResourcePricingByNameVirtualMachines_example.json + */ + /** + * Sample code: Get pricings on resource - VirtualMachines plan. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getPricingsOnResourceVirtualMachinesPlan(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings().getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1", + "VirtualMachines", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ + * GetPricingByNameCloudPosture_example.json */ /** * Sample code: Get pricings on subscription - CloudPosture plan. - * + * * @param manager Entry point to SecurityManager. */ - public static void getPricingsOnSubscriptionCloudPosturePlan( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.pricings().getWithResponse("CloudPosture", com.azure.core.util.Context.NONE); + public static void + getPricingsOnSubscriptionCloudPosturePlan(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings().getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "CloudPosture", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/GetPricingByNameDns_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ + * GetPricingByNameDns_example.json */ /** * Sample code: Get pricings on subscription - Dns plan. - * + * * @param manager Entry point to SecurityManager. */ public static void getPricingsOnSubscriptionDnsPlan(com.azure.resourcemanager.security.SecurityManager manager) { - manager.pricings().getWithResponse("Dns", com.azure.core.util.Context.NONE); + manager.pricings().getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "Dns", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/GetPricingByNameContainers_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ + * GetPricingByNameContainers_example.json */ /** * Sample code: Get pricings on subscription - Containers plan. - * + * * @param manager Entry point to SecurityManager. */ - public static void getPricingsOnSubscriptionContainersPlan( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.pricings().getWithResponse("Containers", com.azure.core.util.Context.NONE); + public static void + getPricingsOnSubscriptionContainersPlan(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings().getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "Containers", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/GetPricingByNameStorageAccounts_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ + * GetPricingByNameStorageAccounts_example.json */ /** * Sample code: Get pricings on subscription - StorageAccounts plan. - * + * * @param manager Entry point to SecurityManager. */ - public static void getPricingsOnSubscriptionStorageAccountsPlan( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.pricings().getWithResponse("StorageAccounts", com.azure.core.util.Context.NONE); + public static void + getPricingsOnSubscriptionStorageAccountsPlan(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings().getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "StorageAccounts", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/GetPricingByNameVirtualMachines_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ + * GetPricingByNameVirtualMachines_example.json */ /** * Sample code: Get pricings on subscription - VirtualMachines plan. - * + * * @param manager Entry point to SecurityManager. */ - public static void getPricingsOnSubscriptionVirtualMachinesPlan( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.pricings().getWithResponse("VirtualMachines", com.azure.core.util.Context.NONE); + public static void + getPricingsOnSubscriptionVirtualMachinesPlan(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings().getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "VirtualMachines", + com.azure.core.util.Context.NONE); } } ``` @@ -4600,18 +5527,55 @@ public final class PricingsGetSamples { ### Pricings_List ```java -/** Samples for Pricings List. */ +/** + * Samples for Pricings List. + */ public final class PricingsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/ListPricings_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ + * ListPricingsWithPlanFilter_example.json + */ + /** + * Sample code: Get pricings on subscription with plans filter. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getPricingsOnSubscriptionWithPlansFilter(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings().listWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "name in (VirtualMachines,KeyVaults)", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ + * ListPricings_example.json */ /** * Sample code: Get pricings on subscription. - * + * * @param manager Entry point to SecurityManager. */ public static void getPricingsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.pricings().listWithResponse(com.azure.core.util.Context.NONE); + manager.pricings().listWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ + * ListResourcePricings_example.json + */ + /** + * Sample code: Get pricings on resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void getPricingsOnResource(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings().listWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1", + null, com.azure.core.util.Context.NONE); } } ``` @@ -4620,43 +5584,78 @@ public final class PricingsListSamples { ```java import com.azure.resourcemanager.security.fluent.models.PricingInner; +import com.azure.resourcemanager.security.models.Enforce; import com.azure.resourcemanager.security.models.PricingTier; -/** Samples for Pricings Update. */ +/** + * Samples for Pricings Update. + */ public final class PricingsUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/PutPricingByNamePartialSuccess_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ + * PutPricingByName_example.json + */ + /** + * Sample code: Update pricing on subscription (example for CloudPosture plan). + * + * @param manager Entry point to SecurityManager. + */ + public static void updatePricingOnSubscriptionExampleForCloudPosturePlan( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings().updateWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "CloudPosture", + new PricingInner().withPricingTier(PricingTier.STANDARD), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ + * PutPricingByNamePartialSuccess_example.json + */ + /** + * Sample code: Update pricing on subscription (example for CloudPosture plan) - partial success. + * + * @param manager Entry point to SecurityManager. + */ + public static void updatePricingOnSubscriptionExampleForCloudPosturePlanPartialSuccess( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings().updateWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "CloudPosture", + new PricingInner().withPricingTier(PricingTier.STANDARD), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ + * PutPricingVMsByName_example.json */ /** - * Sample code: Update pricing on subscription - partial success. - * + * Sample code: Update pricing on subscription (example for VirtualMachines plan). + * * @param manager Entry point to SecurityManager. */ - public static void updatePricingOnSubscriptionPartialSuccess( + public static void updatePricingOnSubscriptionExampleForVirtualMachinesPlan( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .pricings() - .updateWithResponse( - "CloudPosture", - new PricingInner().withPricingTier(PricingTier.STANDARD), - com.azure.core.util.Context.NONE); + manager.pricings().updateWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "VirtualMachines", + new PricingInner().withPricingTier(PricingTier.STANDARD).withSubPlan("P2").withEnforce(Enforce.TRUE), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/PutPricingByName_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ + * PutResourcePricingByNameVirtualMachines_example.json */ /** - * Sample code: Update pricing on subscription. - * + * Sample code: Update pricing on resource (example for VirtualMachines plan). + * * @param manager Entry point to SecurityManager. */ - public static void updatePricingOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .pricings() - .updateWithResponse( - "CloudPosture", - new PricingInner().withPricingTier(PricingTier.STANDARD), - com.azure.core.util.Context.NONE); + public static void updatePricingOnResourceExampleForVirtualMachinesPlan( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings().updateWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1", + "virtualMachines", new PricingInner().withPricingTier(PricingTier.STANDARD).withSubPlan("P1"), + com.azure.core.util.Context.NONE); } } ``` @@ -4664,22 +5663,24 @@ public final class PricingsUpdateSamples { ### RegulatoryComplianceAssessments_Get ```java -/** Samples for RegulatoryComplianceAssessments Get. */ +/** + * Samples for RegulatoryComplianceAssessments Get. + */ public final class RegulatoryComplianceAssessmentsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceAssessment_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/ + * RegulatoryCompliance/getRegulatoryComplianceAssessment_example.json */ /** * Sample code: Get selected regulatory compliance assessment details and state. - * + * * @param manager Entry point to SecurityManager. */ public static void getSelectedRegulatoryComplianceAssessmentDetailsAndState( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .regulatoryComplianceAssessments() - .getWithResponse( - "PCI-DSS-3.2", "1.1", "968548cb-02b3-8cd2-11f8-0cf64ab1a347", com.azure.core.util.Context.NONE); + manager.regulatoryComplianceAssessments().getWithResponse("PCI-DSS-3.2", "1.1", + "968548cb-02b3-8cd2-11f8-0cf64ab1a347", com.azure.core.util.Context.NONE); } } ``` @@ -4687,14 +5688,18 @@ public final class RegulatoryComplianceAssessmentsGetSamples { ### RegulatoryComplianceAssessments_List ```java -/** Samples for RegulatoryComplianceAssessments List. */ +/** + * Samples for RegulatoryComplianceAssessments List. + */ public final class RegulatoryComplianceAssessmentsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceAssessmentList_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/ + * RegulatoryCompliance/getRegulatoryComplianceAssessmentList_example.json */ /** * Sample code: Get all assessments mapped to selected regulatory compliance control. - * + * * @param manager Entry point to SecurityManager. */ public static void getAllAssessmentsMappedToSelectedRegulatoryComplianceControl( @@ -4707,14 +5712,18 @@ public final class RegulatoryComplianceAssessmentsListSamples { ### RegulatoryComplianceControls_Get ```java -/** Samples for RegulatoryComplianceControls Get. */ +/** + * Samples for RegulatoryComplianceControls Get. + */ public final class RegulatoryComplianceControlsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceControl_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/ + * RegulatoryCompliance/getRegulatoryComplianceControl_example.json */ /** * Sample code: Get selected regulatory compliance control details and state. - * + * * @param manager Entry point to SecurityManager. */ public static void getSelectedRegulatoryComplianceControlDetailsAndState( @@ -4727,14 +5736,18 @@ public final class RegulatoryComplianceControlsGetSamples { ### RegulatoryComplianceControls_List ```java -/** Samples for RegulatoryComplianceControls List. */ +/** + * Samples for RegulatoryComplianceControls List. + */ public final class RegulatoryComplianceControlsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceControlList_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/ + * RegulatoryCompliance/getRegulatoryComplianceControlList_example.json */ /** * Sample code: Get all regulatory compliance controls details and state for selected standard. - * + * * @param manager Entry point to SecurityManager. */ public static void getAllRegulatoryComplianceControlsDetailsAndStateForSelectedStandard( @@ -4747,14 +5760,18 @@ public final class RegulatoryComplianceControlsListSamples { ### RegulatoryComplianceStandards_Get ```java -/** Samples for RegulatoryComplianceStandards Get. */ +/** + * Samples for RegulatoryComplianceStandards Get. + */ public final class RegulatoryComplianceStandardsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceStandard_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/ + * RegulatoryCompliance/getRegulatoryComplianceStandard_example.json */ /** * Sample code: Get selected regulatory compliance standard details and state. - * + * * @param manager Entry point to SecurityManager. */ public static void getSelectedRegulatoryComplianceStandardDetailsAndState( @@ -4767,14 +5784,18 @@ public final class RegulatoryComplianceStandardsGetSamples { ### RegulatoryComplianceStandards_List ```java -/** Samples for RegulatoryComplianceStandards List. */ +/** + * Samples for RegulatoryComplianceStandards List. + */ public final class RegulatoryComplianceStandardsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceStandardList_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/ + * RegulatoryCompliance/getRegulatoryComplianceStandardList_example.json */ /** * Sample code: Get all supported regulatory compliance standards details and state. - * + * * @param manager Entry point to SecurityManager. */ public static void getAllSupportedRegulatoryComplianceStandardsDetailsAndState( @@ -4784,17 +5805,77 @@ public final class RegulatoryComplianceStandardsListSamples { } ``` +### ResourceProvider_GetSensitivitySettings + +```java +/** + * Samples for ResourceProvider GetSensitivitySettings. + */ +public final class ResourceProviderGetSensitivitySettingsSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-02-15-preview/examples/ + * SensitivitySettings/GetSensitivitySettings_example.json + */ + /** + * Sample code: Get sensitivity settings. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSensitivitySettings(com.azure.resourcemanager.security.SecurityManager manager) { + manager.resourceProviders().getSensitivitySettingsWithResponse(com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceProvider_UpdateSensitivitySettings + +```java +import com.azure.resourcemanager.security.models.UpdateSensitivitySettingsRequest; +import java.util.Arrays; +import java.util.UUID; + +/** + * Samples for ResourceProvider UpdateSensitivitySettings. + */ +public final class ResourceProviderUpdateSensitivitySettingsSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-02-15-preview/examples/ + * SensitivitySettings/PutSensitivitySettings_example.json + */ + /** + * Sample code: Update sensitivity settings. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateSensitivitySettings(com.azure.resourcemanager.security.SecurityManager manager) { + manager.resourceProviders().updateSensitivitySettingsWithResponse( + new UpdateSensitivitySettingsRequest() + .withSensitiveInfoTypesIds(Arrays.asList(UUID.fromString("f2f8a7a1-28c0-404b-9ab4-30a0a7af18cb"), + UUID.fromString("b452f22b-f87d-4f48-8490-ecf0873325b5"), + UUID.fromString("d59ee8b6-2618-404b-a5e7-aa377cd67543"))) + .withSensitivityThresholdLabelOrder(2.0F).withSensitivityThresholdLabelId( + UUID.fromString("f2f8a7a1-28c0-404b-9ab4-30a0a7af18cb")), + com.azure.core.util.Context.NONE); + } +} +``` + ### SecureScoreControlDefinitions_List ```java -/** Samples for SecureScoreControlDefinitions List. */ +/** + * Samples for SecureScoreControlDefinitions List. + */ public final class SecureScoreControlDefinitionsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScoreControlDefinitions/ListSecureScoreControlDefinitions_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ + * secureScoreControlDefinitions/ListSecureScoreControlDefinitions_example.json */ /** * Sample code: List security controls definition. - * + * * @param manager Entry point to SecurityManager. */ public static void listSecurityControlsDefinition(com.azure.resourcemanager.security.SecurityManager manager) { @@ -4806,18 +5887,21 @@ public final class SecureScoreControlDefinitionsListSamples { ### SecureScoreControlDefinitions_ListBySubscription ```java -/** Samples for SecureScoreControlDefinitions ListBySubscription. */ +/** + * Samples for SecureScoreControlDefinitions ListBySubscription. + */ public final class SecureScoreControlDefinitionsListBySubscriptionSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScoreControlDefinitions/ListSecureScoreControlDefinitions_subscription_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ + * secureScoreControlDefinitions/ListSecureScoreControlDefinitions_subscription_example.json */ /** * Sample code: List security controls definition by subscription. - * + * * @param manager Entry point to SecurityManager. */ - public static void listSecurityControlsDefinitionBySubscription( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void + listSecurityControlsDefinitionBySubscription(com.azure.resourcemanager.security.SecurityManager manager) { manager.secureScoreControlDefinitions().listBySubscription(com.azure.core.util.Context.NONE); } } @@ -4826,14 +5910,19 @@ public final class SecureScoreControlDefinitionsListBySubscriptionSamples { ### SecureScoreControls_List ```java -/** Samples for SecureScoreControls List. */ + +/** + * Samples for SecureScoreControls List. + */ public final class SecureScoreControlsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScoreControls_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ + * ListSecureScoreControls_example.json */ /** * Sample code: List all secure scores controls. - * + * * @param manager Entry point to SecurityManager. */ public static void listAllSecureScoresControls(com.azure.resourcemanager.security.SecurityManager manager) { @@ -4847,30 +5936,35 @@ public final class SecureScoreControlsListSamples { ```java import com.azure.resourcemanager.security.models.ExpandControlsEnum; -/** Samples for SecureScoreControls ListBySecureScore. */ +/** + * Samples for SecureScoreControls ListBySecureScore. + */ public final class SecureScoreControlsListBySecureScoreSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScoreControlsForNameWithExpand_builtin_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ + * ListSecureScoreControlsForNameWithExpand_builtin_example.json */ /** * Sample code: Get security controls and their current score for the specified initiative with the expand * parameter. - * + * * @param manager Entry point to SecurityManager. */ public static void getSecurityControlsAndTheirCurrentScoreForTheSpecifiedInitiativeWithTheExpandParameter( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .secureScoreControls() - .listBySecureScore("ascScore", ExpandControlsEnum.DEFINITION, com.azure.core.util.Context.NONE); + manager.secureScoreControls().listBySecureScore("ascScore", ExpandControlsEnum.DEFINITION, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScoreControlsForName_builtin_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ + * ListSecureScoreControlsForName_builtin_example.json */ /** * Sample code: Get security controls and their current score for the specified initiative. - * + * * @param manager Entry point to SecurityManager. */ public static void getSecurityControlsAndTheirCurrentScoreForTheSpecifiedInitiative( @@ -4883,14 +5977,18 @@ public final class SecureScoreControlsListBySecureScoreSamples { ### SecureScores_Get ```java -/** Samples for SecureScores Get. */ +/** + * Samples for SecureScores Get. + */ public final class SecureScoresGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/GetSecureScoresSingle_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ + * GetSecureScoresSingle_example.json */ /** * Sample code: Get single secure score. - * + * * @param manager Entry point to SecurityManager. */ public static void getSingleSecureScore(com.azure.resourcemanager.security.SecurityManager manager) { @@ -4902,14 +6000,18 @@ public final class SecureScoresGetSamples { ### SecureScores_List ```java -/** Samples for SecureScores List. */ +/** + * Samples for SecureScores List. + */ public final class SecureScoresListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScores_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ + * ListSecureScores_example.json */ /** * Sample code: List secure scores. - * + * * @param manager Entry point to SecurityManager. */ public static void listSecureScores(com.azure.resourcemanager.security.SecurityManager manager) { @@ -4928,38 +6030,31 @@ import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; import java.io.IOException; import java.util.Arrays; -/** Samples for SecurityConnectorApplicationOperation CreateOrUpdate. */ +/** + * Samples for SecurityConnectorApplicationOperation CreateOrUpdate. + */ public final class SecurityConnectorApplicationOperationCreateOrUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/PutSecurityConnectorApplication_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/ + * PutSecurityConnectorApplication_example.json */ /** * Sample code: Create Application. - * + * * @param manager Entry point to SecurityManager. */ public static void createApplication(com.azure.resourcemanager.security.SecurityManager manager) throws IOException { - manager - .securityConnectorApplicationOperations() - .createOrUpdateWithResponse( - "gcpResourceGroup", - "gcpconnector", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - new ApplicationInner() - .withDisplayName("GCP Admin's application") - .withDescription("An application on critical GCP recommendations") - .withSourceResourceType(ApplicationSourceResourceType.ASSESSMENTS) - .withConditionSets( - Arrays - .asList( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"conditions\":[{\"operator\":\"contains\",\"property\":\"$.Id\",\"value\":\"-prod-\"}]}", - Object.class, - SerializerEncoding.JSON))), - com.azure.core.util.Context.NONE); + manager.securityConnectorApplicationOperations().createOrUpdateWithResponse("gcpResourceGroup", "gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + new ApplicationInner().withDisplayName("GCP Admin's application") + .withDescription("An application on critical GCP recommendations") + .withSourceResourceType(ApplicationSourceResourceType.ASSESSMENTS).withConditionSets( + Arrays.asList(SerializerFactory.createDefaultManagementSerializerAdapter().deserialize( + "{\"conditions\":[{\"operator\":\"contains\",\"property\":\"$.Id\",\"value\":\"-prod-\"}]}", + Object.class, SerializerEncoding.JSON))), + com.azure.core.util.Context.NONE); } } ``` @@ -4967,24 +6062,23 @@ public final class SecurityConnectorApplicationOperationCreateOrUpdateSamples { ### SecurityConnectorApplicationOperation_Delete ```java -/** Samples for SecurityConnectorApplicationOperation Delete. */ +/** + * Samples for SecurityConnectorApplicationOperation Delete. + */ public final class SecurityConnectorApplicationOperationDeleteSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/DeleteSecurityConnectorApplication_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/ + * DeleteSecurityConnectorApplication_example.json */ /** * Sample code: Delete security Application. - * + * * @param manager Entry point to SecurityManager. */ public static void deleteSecurityApplication(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .securityConnectorApplicationOperations() - .deleteWithResponse( - "gcpResourceGroup", - "gcpconnector", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - com.azure.core.util.Context.NONE); + manager.securityConnectorApplicationOperations().deleteWithResponse("gcpResourceGroup", "gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); } } ``` @@ -4992,25 +6086,24 @@ public final class SecurityConnectorApplicationOperationDeleteSamples { ### SecurityConnectorApplicationOperation_Get ```java -/** Samples for SecurityConnectorApplicationOperation Get. */ +/** + * Samples for SecurityConnectorApplicationOperation Get. + */ public final class SecurityConnectorApplicationOperationGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/GetSecurityConnectorApplication_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/ + * GetSecurityConnectorApplication_example.json */ /** * Sample code: Get security applications by specific applicationId. - * + * * @param manager Entry point to SecurityManager. */ - public static void getSecurityApplicationsBySpecificApplicationId( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .securityConnectorApplicationOperations() - .getWithResponse( - "gcpResourceGroup", - "gcpconnector", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - com.azure.core.util.Context.NONE); + public static void + getSecurityApplicationsBySpecificApplicationId(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityConnectorApplicationOperations().getWithResponse("gcpResourceGroup", "gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); } } ``` @@ -5018,21 +6111,24 @@ public final class SecurityConnectorApplicationOperationGetSamples { ### SecurityConnectorApplications_List ```java -/** Samples for SecurityConnectorApplications List. */ +/** + * Samples for SecurityConnectorApplications List. + */ public final class SecurityConnectorApplicationsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/ListBySecurityConnectorApplications_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/ + * ListBySecurityConnectorApplications_example.json */ /** * Sample code: List security applications by security connector level scope. - * + * * @param manager Entry point to SecurityManager. */ public static void listSecurityApplicationsBySecurityConnectorLevelScope( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .securityConnectorApplications() - .list("gcpResourceGroup", "gcpconnector", com.azure.core.util.Context.NONE); + manager.securityConnectorApplications().list("gcpResourceGroup", "gcpconnector", + com.azure.core.util.Context.NONE); } } ``` @@ -5048,36 +6144,31 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for SecurityConnectors CreateOrUpdate. */ +/** + * Samples for SecurityConnectors CreateOrUpdate. + */ public final class SecurityConnectorsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-03-01-preview/examples/SecurityConnectors/PutSecurityConnector_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-10-01-preview/examples/SecurityConnectors + * /PutSecurityConnector_example.json */ /** * Sample code: Create or update a security connector. - * + * * @param manager Entry point to SecurityManager. */ public static void createOrUpdateASecurityConnector(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .securityConnectors() - .define("exampleSecurityConnectorName") - .withRegion("Central US") - .withExistingResourceGroup("exampleResourceGroup") - .withTags(mapOf()) - .withHierarchyIdentifier("exampleHierarchyId") - .withEnvironmentName(CloudName.AWS) - .withOfferings( - Arrays - .asList( - new CspmMonitorAwsOffering() - .withNativeCloudConnection( - new CspmMonitorAwsOfferingNativeCloudConnection() - .withCloudRoleArn("arn:aws:iam::00000000:role/ASCMonitor")))) - .withEnvironmentData(new AwsEnvironmentData()) - .create(); + manager.securityConnectors().define("exampleSecurityConnectorName").withRegion("Central US") + .withExistingResourceGroup("exampleResourceGroup").withTags(mapOf()) + .withHierarchyIdentifier("exampleHierarchyId").withEnvironmentName(CloudName.AWS) + .withOfferings(Arrays.asList( + new CspmMonitorAwsOffering().withNativeCloudConnection(new CspmMonitorAwsOfferingNativeCloudConnection() + .withCloudRoleArn("arn:aws:iam::00000000:role/ASCMonitor")))) + .withEnvironmentData(new AwsEnvironmentData().withScanInterval(4L)).create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -5094,20 +6185,23 @@ public final class SecurityConnectorsCreateOrUpdateSamples { ### SecurityConnectors_Delete ```java -/** Samples for SecurityConnectors Delete. */ +/** + * Samples for SecurityConnectors Delete. + */ public final class SecurityConnectorsDeleteSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-03-01-preview/examples/SecurityConnectors/DeleteSecurityConnector_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-10-01-preview/examples/SecurityConnectors + * /DeleteSecurityConnector_example.json */ /** * Sample code: Delete a security connector. - * + * * @param manager Entry point to SecurityManager. */ public static void deleteASecurityConnector(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .securityConnectors() - .deleteByResourceGroupWithResponse("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + manager.securityConnectors().deleteByResourceGroupWithResponse("myRg", "mySecurityConnectorName", + com.azure.core.util.Context.NONE); } } ``` @@ -5115,21 +6209,23 @@ public final class SecurityConnectorsDeleteSamples { ### SecurityConnectors_GetByResourceGroup ```java -/** Samples for SecurityConnectors GetByResourceGroup. */ +/** + * Samples for SecurityConnectors GetByResourceGroup. + */ public final class SecurityConnectorsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-03-01-preview/examples/SecurityConnectors/GetSecurityConnectorSingleResource_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-10-01-preview/examples/SecurityConnectors + * /GetSecurityConnectorSingleResource_example.json */ /** * Sample code: Retrieve a security connector. - * + * * @param manager Entry point to SecurityManager. */ public static void retrieveASecurityConnector(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .securityConnectors() - .getByResourceGroupWithResponse( - "exampleResourceGroup", "exampleSecurityConnectorName", com.azure.core.util.Context.NONE); + manager.securityConnectors().getByResourceGroupWithResponse("exampleResourceGroup", + "exampleSecurityConnectorName", com.azure.core.util.Context.NONE); } } ``` @@ -5137,18 +6233,22 @@ public final class SecurityConnectorsGetByResourceGroupSamples { ### SecurityConnectors_List ```java -/** Samples for SecurityConnectors List. */ +/** + * Samples for SecurityConnectors List. + */ public final class SecurityConnectorsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-03-01-preview/examples/SecurityConnectors/GetSecurityConnectorsSubscription_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-10-01-preview/examples/SecurityConnectors + * /GetSecurityConnectorsSubscription_example.json */ /** * Sample code: List all security connectors of a specified subscription. - * + * * @param manager Entry point to SecurityManager. */ - public static void listAllSecurityConnectorsOfASpecifiedSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void + listAllSecurityConnectorsOfASpecifiedSubscription(com.azure.resourcemanager.security.SecurityManager manager) { manager.securityConnectors().list(com.azure.core.util.Context.NONE); } } @@ -5157,18 +6257,22 @@ public final class SecurityConnectorsListSamples { ### SecurityConnectors_ListByResourceGroup ```java -/** Samples for SecurityConnectors ListByResourceGroup. */ +/** + * Samples for SecurityConnectors ListByResourceGroup. + */ public final class SecurityConnectorsListByResourceGroupSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-03-01-preview/examples/SecurityConnectors/GetSecurityConnectorsResourceGroup_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-10-01-preview/examples/SecurityConnectors + * /GetSecurityConnectorsResourceGroup_example.json */ /** * Sample code: List all security connectors of a specified resource group. - * + * * @param manager Entry point to SecurityManager. */ - public static void listAllSecurityConnectorsOfASpecifiedResourceGroup( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void + listAllSecurityConnectorsOfASpecifiedResourceGroup(com.azure.resourcemanager.security.SecurityManager manager) { manager.securityConnectors().listByResourceGroup("exampleResourceGroup", com.azure.core.util.Context.NONE); } } @@ -5186,39 +6290,32 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for SecurityConnectors Update. */ +/** + * Samples for SecurityConnectors Update. + */ public final class SecurityConnectorsUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-03-01-preview/examples/SecurityConnectors/PatchSecurityConnector_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-10-01-preview/examples/SecurityConnectors + * /PatchSecurityConnector_example.json */ /** * Sample code: Update a security connector. - * + * * @param manager Entry point to SecurityManager. */ public static void updateASecurityConnector(com.azure.resourcemanager.security.SecurityManager manager) { - SecurityConnector resource = - manager - .securityConnectors() - .getByResourceGroupWithResponse( - "exampleResourceGroup", "exampleSecurityConnectorName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .withTags(mapOf()) - .withHierarchyIdentifier("exampleHierarchyId") + SecurityConnector resource = manager.securityConnectors().getByResourceGroupWithResponse("exampleResourceGroup", + "exampleSecurityConnectorName", com.azure.core.util.Context.NONE).getValue(); + resource.update().withTags(mapOf()).withHierarchyIdentifier("exampleHierarchyId") .withEnvironmentName(CloudName.AWS) - .withOfferings( - Arrays - .asList( - new CspmMonitorAwsOffering() - .withNativeCloudConnection( - new CspmMonitorAwsOfferingNativeCloudConnection() - .withCloudRoleArn("arn:aws:iam::00000000:role/ASCMonitor")))) - .withEnvironmentData(new AwsEnvironmentData()) - .apply(); + .withOfferings(Arrays.asList( + new CspmMonitorAwsOffering().withNativeCloudConnection(new CspmMonitorAwsOfferingNativeCloudConnection() + .withCloudRoleArn("arn:aws:iam::00000000:role/ASCMonitor")))) + .withEnvironmentData(new AwsEnvironmentData()).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -5235,37 +6332,38 @@ public final class SecurityConnectorsUpdateSamples { ### SecurityContacts_Create ```java +import com.azure.resourcemanager.security.models.MinimalRiskLevel; import com.azure.resourcemanager.security.models.MinimalSeverity; -import com.azure.resourcemanager.security.models.Roles; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesAlertNotifications; +import com.azure.resourcemanager.security.models.NotificationsSourceAlert; +import com.azure.resourcemanager.security.models.NotificationsSourceAttackPath; +import com.azure.resourcemanager.security.models.SecurityContactName; import com.azure.resourcemanager.security.models.SecurityContactPropertiesNotificationsByRole; +import com.azure.resourcemanager.security.models.SecurityContactRole; import com.azure.resourcemanager.security.models.State; import java.util.Arrays; -/** Samples for SecurityContacts Create. */ +/** + * Samples for SecurityContacts Create. + */ public final class SecurityContactsCreateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/SecurityContacts/CreateSecurityContact_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/SecurityContacts/ + * CreateSecurityContact_example.json */ /** * Sample code: Create security contact data. - * + * * @param manager Entry point to SecurityManager. */ public static void createSecurityContactData(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .securityContacts() - .define("default") - .withEmails("john@contoso.com;jane@contoso.com") - .withPhone("(214)275-4038") - .withAlertNotifications( - new SecurityContactPropertiesAlertNotifications() - .withState(State.fromString("On")) - .withMinimalSeverity(MinimalSeverity.LOW)) - .withNotificationsByRole( - new SecurityContactPropertiesNotificationsByRole() - .withState(State.fromString("On")) - .withRoles(Arrays.asList(Roles.OWNER))) + manager.securityContacts().define(SecurityContactName.DEFAULT).withEmails("john@contoso.com;jane@contoso.com") + .withPhone("(214)275-4038").withIsEnabled(true) + .withNotificationsSources( + Arrays.asList(new NotificationsSourceAttackPath().withMinimalRiskLevel(MinimalRiskLevel.CRITICAL), + new NotificationsSourceAlert().withMinimalSeverity(MinimalSeverity.MEDIUM))) + .withNotificationsByRole(new SecurityContactPropertiesNotificationsByRole() + .withState(State.fromString("On")).withRoles(Arrays.asList(SecurityContactRole.OWNER))) .create(); } } @@ -5274,18 +6372,24 @@ public final class SecurityContactsCreateSamples { ### SecurityContacts_Delete ```java -/** Samples for SecurityContacts Delete. */ +import com.azure.resourcemanager.security.models.SecurityContactName; + +/** + * Samples for SecurityContacts Delete. + */ public final class SecurityContactsDeleteSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/SecurityContacts/DeleteSecurityContact_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/SecurityContacts/ + * DeleteSecurityContact_example.json */ /** * Sample code: Deletes a security contact data. - * + * * @param manager Entry point to SecurityManager. */ public static void deletesASecurityContactData(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityContacts().deleteWithResponse("default", com.azure.core.util.Context.NONE); + manager.securityContacts().deleteWithResponse(SecurityContactName.DEFAULT, com.azure.core.util.Context.NONE); } } ``` @@ -5293,18 +6397,24 @@ public final class SecurityContactsDeleteSamples { ### SecurityContacts_Get ```java -/** Samples for SecurityContacts Get. */ +import com.azure.resourcemanager.security.models.SecurityContactName; + +/** + * Samples for SecurityContacts Get. + */ public final class SecurityContactsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/SecurityContacts/GetSecurityContact_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/SecurityContacts/ + * GetSecurityContact_example.json */ /** * Sample code: Get a security contact. - * + * * @param manager Entry point to SecurityManager. */ public static void getASecurityContact(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityContacts().getWithResponse("default", com.azure.core.util.Context.NONE); + manager.securityContacts().getWithResponse(SecurityContactName.DEFAULT, com.azure.core.util.Context.NONE); } } ``` @@ -5312,14 +6422,18 @@ public final class SecurityContactsGetSamples { ### SecurityContacts_List ```java -/** Samples for SecurityContacts List. */ +/** + * Samples for SecurityContacts List. + */ public final class SecurityContactsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/SecurityContacts/GetSecurityContactsSubscription_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/SecurityContacts/ + * GetSecurityContactsSubscription_example.json */ /** * Sample code: List security contact data. - * + * * @param manager Entry point to SecurityManager. */ public static void listSecurityContactData(com.azure.resourcemanager.security.SecurityManager manager) { @@ -5331,22 +6445,24 @@ public final class SecurityContactsListSamples { ### SecurityOperators_CreateOrUpdate ```java -/** Samples for SecurityOperators CreateOrUpdate. */ +/** + * Samples for SecurityOperators CreateOrUpdate. + */ public final class SecurityOperatorsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-01-01-preview/examples/SecurityOperators/PutSecurityOperatorByName_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-01-01-preview/examples/SecurityOperators/ + * PutSecurityOperatorByName_example.json */ /** * Sample code: Create a security operator on the given scope. - * + * * @param manager Entry point to SecurityManager. */ - public static void createASecurityOperatorOnTheGivenScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .securityOperators() - .createOrUpdateWithResponse( - "CloudPosture", "DefenderCSPMSecurityOperator", com.azure.core.util.Context.NONE); + public static void + createASecurityOperatorOnTheGivenScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityOperators().createOrUpdateWithResponse("CloudPosture", "DefenderCSPMSecurityOperator", + com.azure.core.util.Context.NONE); } } ``` @@ -5354,22 +6470,24 @@ public final class SecurityOperatorsCreateOrUpdateSamples { ### SecurityOperators_Delete ```java -/** Samples for SecurityOperators Delete. */ +/** + * Samples for SecurityOperators Delete. + */ public final class SecurityOperatorsDeleteSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-01-01-preview/examples/SecurityOperators/DeleteSecurityOperatorByName_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-01-01-preview/examples/SecurityOperators/ + * DeleteSecurityOperatorByName_example.json */ /** * Sample code: Delete SecurityOperator on subscription. - * + * * @param manager Entry point to SecurityManager. */ - public static void deleteSecurityOperatorOnSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .securityOperators() - .deleteByResourceGroupWithResponse( - "CloudPosture", "DefenderCSPMSecurityOperator", com.azure.core.util.Context.NONE); + public static void + deleteSecurityOperatorOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityOperators().deleteByResourceGroupWithResponse("CloudPosture", "DefenderCSPMSecurityOperator", + com.azure.core.util.Context.NONE); } } ``` @@ -5377,21 +6495,24 @@ public final class SecurityOperatorsDeleteSamples { ### SecurityOperators_Get ```java -/** Samples for SecurityOperators Get. */ +/** + * Samples for SecurityOperators Get. + */ public final class SecurityOperatorsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-01-01-preview/examples/SecurityOperators/GetSecurityOperatorByName_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-01-01-preview/examples/SecurityOperators/ + * GetSecurityOperatorByName_example.json */ /** * Sample code: Get a specific security operator by scope and securityOperatorName. - * + * * @param manager Entry point to SecurityManager. */ public static void getASpecificSecurityOperatorByScopeAndSecurityOperatorName( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .securityOperators() - .getWithResponse("CloudPosture", "DefenderCSPMSecurityOperator", com.azure.core.util.Context.NONE); + manager.securityOperators().getWithResponse("CloudPosture", "DefenderCSPMSecurityOperator", + com.azure.core.util.Context.NONE); } } ``` @@ -5399,14 +6520,18 @@ public final class SecurityOperatorsGetSamples { ### SecurityOperators_List ```java -/** Samples for SecurityOperators List. */ +/** + * Samples for SecurityOperators List. + */ public final class SecurityOperatorsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-01-01-preview/examples/SecurityOperators/ListSecurityOperators_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-01-01-preview/examples/SecurityOperators/ + * ListSecurityOperators_example.json */ /** * Sample code: List SecurityOperators. - * + * * @param manager Entry point to SecurityManager. */ public static void listSecurityOperators(com.azure.resourcemanager.security.SecurityManager manager) { @@ -5418,21 +6543,24 @@ public final class SecurityOperatorsListSamples { ### SecuritySolutions_Get ```java -/** Samples for SecuritySolutions Get. */ +/** + * Samples for SecuritySolutions Get. + */ public final class SecuritySolutionsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutions/GetSecuritySolutionsResourceGroupLocation_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutions/ + * GetSecuritySolutionsResourceGroupLocation_example.json */ /** * Sample code: Get a security solution from a security data location. - * + * * @param manager Entry point to SecurityManager. */ - public static void getASecuritySolutionFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .securitySolutions() - .getWithResponse("myRg2", "centralus", "paloalto7", com.azure.core.util.Context.NONE); + public static void + getASecuritySolutionFromASecurityDataLocation(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securitySolutions().getWithResponse("myRg2", "centralus", "paloalto7", + com.azure.core.util.Context.NONE); } } ``` @@ -5440,14 +6568,18 @@ public final class SecuritySolutionsGetSamples { ### SecuritySolutions_List ```java -/** Samples for SecuritySolutions List. */ +/** + * Samples for SecuritySolutions List. + */ public final class SecuritySolutionsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutions/GetSecuritySolutionsSubscription_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutions/ + * GetSecuritySolutionsSubscription_example.json */ /** * Sample code: Get security solutions. - * + * * @param manager Entry point to SecurityManager. */ public static void getSecuritySolutions(com.azure.resourcemanager.security.SecurityManager manager) { @@ -5459,14 +6591,17 @@ public final class SecuritySolutionsListSamples { ### SecuritySolutionsReferenceData_List ```java -/** Samples for SecuritySolutionsReferenceData List. */ +/** + * Samples for SecuritySolutionsReferenceData List. + */ public final class SecuritySolutionsReferenceDataListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutionsReferenceData/GetSecuritySolutionsReferenceDataSubscription_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ + * SecuritySolutionsReferenceData/GetSecuritySolutionsReferenceDataSubscription_example.json */ /** * Sample code: Get security solutions. - * + * * @param manager Entry point to SecurityManager. */ public static void getSecuritySolutions(com.azure.resourcemanager.security.SecurityManager manager) { @@ -5478,21 +6613,46 @@ public final class SecuritySolutionsReferenceDataListSamples { ### SecuritySolutionsReferenceData_ListByHomeRegion ```java -/** Samples for SecuritySolutionsReferenceData ListByHomeRegion. */ +/** + * Samples for SecuritySolutionsReferenceData ListByHomeRegion. + */ public final class SecuritySolutionsReferenceDataListByHomeRegionSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutionsReferenceData/GetSecuritySolutionsReferenceDataSubscriptionLocation_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ + * SecuritySolutionsReferenceData/GetSecuritySolutionsReferenceDataSubscriptionLocation_example.json */ /** * Sample code: Get security solutions from a security data location. - * + * * @param manager Entry point to SecurityManager. */ - public static void getSecuritySolutionsFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .securitySolutionsReferenceDatas() - .listByHomeRegionWithResponse("westcentralus", com.azure.core.util.Context.NONE); + public static void + getSecuritySolutionsFromASecurityDataLocation(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securitySolutionsReferenceDatas().listByHomeRegionWithResponse("westcentralus", + com.azure.core.util.Context.NONE); + } +} +``` + +### SensitivitySettings_List + +```java +/** + * Samples for SensitivitySettings List. + */ +public final class SensitivitySettingsListSamples { + /* + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-02-15-preview/examples/ + * SensitivitySettings/GetSensitivitySettingsList_example.json + */ + /** + * Sample code: Get sensitivity settings list. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSensitivitySettingsList(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sensitivitySettings().listWithResponse(com.azure.core.util.Context.NONE); } } ``` @@ -5500,24 +6660,25 @@ public final class SecuritySolutionsReferenceDataListByHomeRegionSamples { ### ServerVulnerabilityAssessment_CreateOrUpdate ```java -/** Samples for ServerVulnerabilityAssessment CreateOrUpdate. */ +/** + * Samples for ServerVulnerabilityAssessment CreateOrUpdate. + */ public final class ServerVulnerabilityAssessmentCreateOrUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ServerVulnerabilityAssessments/CreateServerVulnerabilityAssessments_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ + * ServerVulnerabilityAssessments/CreateServerVulnerabilityAssessments_example.json */ /** * Sample code: Create a server vulnerability assessments on a resource. Only 'default' resource is supported. Once * creating the resource, the server will be onboarded to vulnerability assessment by Microsoft.Security. - * + * * @param manager Entry point to SecurityManager. */ public static void createAServerVulnerabilityAssessmentsOnAResourceOnlyDefaultResourceIsSupportedOnceCreatingTheResourceTheServerWillBeOnboardedToVulnerabilityAssessmentByMicrosoftSecurity( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .serverVulnerabilityAssessments() - .createOrUpdateWithResponse( - "rg1", "Microsoft.Compute", "virtualMachines", "vm1", com.azure.core.util.Context.NONE); + manager.serverVulnerabilityAssessments().createOrUpdateWithResponse("rg1", "Microsoft.Compute", + "virtualMachines", "vm1", com.azure.core.util.Context.NONE); } } ``` @@ -5525,23 +6686,25 @@ public final class ServerVulnerabilityAssessmentCreateOrUpdateSamples { ### ServerVulnerabilityAssessment_Delete ```java -/** Samples for ServerVulnerabilityAssessment Delete. */ +/** + * Samples for ServerVulnerabilityAssessment Delete. + */ public final class ServerVulnerabilityAssessmentDeleteSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ServerVulnerabilityAssessments/DeleteServerVulnerabilityAssessments_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ + * ServerVulnerabilityAssessments/DeleteServerVulnerabilityAssessments_example.json */ /** * Sample code: Delete a server vulnerability assessments on a resource. Only 'default' resource is supported. Once * deleting, Microsoft.Security will not provide vulnerability assessment findings on the resource. - * + * * @param manager Entry point to SecurityManager. */ public static void deleteAServerVulnerabilityAssessmentsOnAResourceOnlyDefaultResourceIsSupportedOnceDeletingMicrosoftSecurityWillNotProvideVulnerabilityAssessmentFindingsOnTheResource( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .serverVulnerabilityAssessments() - .delete("rg1", "Microsoft.Compute", "virtualMachines", "vm1", com.azure.core.util.Context.NONE); + manager.serverVulnerabilityAssessments().delete("rg1", "Microsoft.Compute", "virtualMachines", "vm1", + com.azure.core.util.Context.NONE); } } ``` @@ -5549,23 +6712,25 @@ public final class ServerVulnerabilityAssessmentDeleteSamples { ### ServerVulnerabilityAssessment_Get ```java -/** Samples for ServerVulnerabilityAssessment Get. */ +/** + * Samples for ServerVulnerabilityAssessment Get. + */ public final class ServerVulnerabilityAssessmentGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ServerVulnerabilityAssessments/GetServerVulnerabilityAssessments_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ + * ServerVulnerabilityAssessments/GetServerVulnerabilityAssessments_example.json */ /** * Sample code: Get a server vulnerability assessments onboarding status on a resource. Currently Microsoft.Security * only supports the single 'default' resource. - * + * * @param manager Entry point to SecurityManager. */ public static void getAServerVulnerabilityAssessmentsOnboardingStatusOnAResourceCurrentlyMicrosoftSecurityOnlySupportsTheSingleDefaultResource( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .serverVulnerabilityAssessments() - .getWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", com.azure.core.util.Context.NONE); + manager.serverVulnerabilityAssessments().getWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", + com.azure.core.util.Context.NONE); } } ``` @@ -5573,24 +6738,131 @@ public final class ServerVulnerabilityAssessmentGetSamples { ### ServerVulnerabilityAssessment_ListByExtendedResource ```java -/** Samples for ServerVulnerabilityAssessment ListByExtendedResource. */ +/** + * Samples for ServerVulnerabilityAssessment ListByExtendedResource. + */ public final class ServerVulnerabilityAssessmentListByExtendedResourceSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ServerVulnerabilityAssessments/ListByExtendedResourceServerVulnerabilityAssessments_example.json + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ + * ServerVulnerabilityAssessments/ListByExtendedResourceServerVulnerabilityAssessments_example.json */ /** * Sample code: Get a list of server vulnerability assessments on a resource. Though this API returns a list, * Currently Microsoft.Security only supports a single default type of server vulnerability assessment. - * + * * @param manager Entry point to SecurityManager. */ public static void getAListOfServerVulnerabilityAssessmentsOnAResourceThoughThisAPIReturnsAListCurrentlyMicrosoftSecurityOnlySupportsASingleDefaultTypeOfServerVulnerabilityAssessment( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .serverVulnerabilityAssessments() - .listByExtendedResourceWithResponse( - "rg1", "Microsoft.Compute", "virtualMachines", "vm1", com.azure.core.util.Context.NONE); + manager.serverVulnerabilityAssessments().listByExtendedResourceWithResponse("rg1", "Microsoft.Compute", + "virtualMachines", "vm1", com.azure.core.util.Context.NONE); + } +} +``` + +### ServerVulnerabilityAssessmentsSettings_CreateOrUpdate + +```java +import com.azure.resourcemanager.security.models.AzureServersSetting; +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsAzureSettingSelectedProvider; +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKindName; + +/** + * Samples for ServerVulnerabilityAssessmentsSettings CreateOrUpdate. + */ +public final class ServerVulnerabilityAssessmentsSettingsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-05-01/examples/ + * ServerVulnerabilityAssessmentsSettings/PutServerVulnerabilityAssessmentsSetting_example.json + */ + /** + * Sample code: Set a server vulnerability assessments setting of the kind settingKind on the subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void setAServerVulnerabilityAssessmentsSettingOfTheKindSettingKindOnTheSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.serverVulnerabilityAssessmentsSettings().createOrUpdateWithResponse( + ServerVulnerabilityAssessmentsSettingKindName.AZURE_SERVERS_SETTING, new AzureServersSetting() + .withSelectedProvider(ServerVulnerabilityAssessmentsAzureSettingSelectedProvider.MDE_TVM), + com.azure.core.util.Context.NONE); + } +} +``` + +### ServerVulnerabilityAssessmentsSettings_Delete + +```java +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKindName; + +/** + * Samples for ServerVulnerabilityAssessmentsSettings Delete. + */ +public final class ServerVulnerabilityAssessmentsSettingsDeleteSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-05-01/examples/ + * ServerVulnerabilityAssessmentsSettings/DeleteServerVulnerabilityAssessmentsSetting_example.json + */ + /** + * Sample code: Delete the server vulnerability assessments setting of the kind settingKind from the subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteTheServerVulnerabilityAssessmentsSettingOfTheKindSettingKindFromTheSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.serverVulnerabilityAssessmentsSettings().deleteWithResponse( + ServerVulnerabilityAssessmentsSettingKindName.AZURE_SERVERS_SETTING, com.azure.core.util.Context.NONE); + } +} +``` + +### ServerVulnerabilityAssessmentsSettings_Get + +```java +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKindName; + +/** + * Samples for ServerVulnerabilityAssessmentsSettings Get. + */ +public final class ServerVulnerabilityAssessmentsSettingsGetSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-05-01/examples/ + * ServerVulnerabilityAssessmentsSettings/GetServerVulnerabilityAssessmentsSetting_example.json + */ + /** + * Sample code: Get the server vulnerability assessments setting of the kind settingKind that is set on the + * subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getTheServerVulnerabilityAssessmentsSettingOfTheKindSettingKindThatIsSetOnTheSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.serverVulnerabilityAssessmentsSettings().getWithResponse( + ServerVulnerabilityAssessmentsSettingKindName.AZURE_SERVERS_SETTING, com.azure.core.util.Context.NONE); + } +} +``` + +### ServerVulnerabilityAssessmentsSettings_List + +```java +/** + * Samples for ServerVulnerabilityAssessmentsSettings List. + */ +public final class ServerVulnerabilityAssessmentsSettingsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-05-01/examples/ + * ServerVulnerabilityAssessmentsSettings/ListServerVulnerabilityAssessmentsSettings_example.json + */ + /** + * Sample code: List the server vulnerability assessments settings set on the subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void listTheServerVulnerabilityAssessmentsSettingsSetOnTheSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.serverVulnerabilityAssessmentsSettings().list(com.azure.core.util.Context.NONE); } } ``` @@ -5598,20 +6870,24 @@ public final class ServerVulnerabilityAssessmentListByExtendedResourceSamples { ### Settings_Get ```java -import com.azure.resourcemanager.security.models.SettingName; +import com.azure.resourcemanager.security.models.SettingNameAutoGenerated; -/** Samples for Settings Get. */ +/** + * Samples for Settings Get. + */ public final class SettingsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSetting_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSetting_example + * .json */ /** * Sample code: Get a setting on subscription. - * + * * @param manager Entry point to SecurityManager. */ public static void getASettingOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.settings().getWithResponse(SettingName.WDATP, com.azure.core.util.Context.NONE); + manager.settings().getWithResponse(SettingNameAutoGenerated.WDATP, com.azure.core.util.Context.NONE); } } ``` @@ -5619,14 +6895,18 @@ public final class SettingsGetSamples { ### Settings_List ```java -/** Samples for Settings List. */ +/** + * Samples for Settings List. + */ public final class SettingsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSettings_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/ + * GetSettings_example.json */ /** * Sample code: Get settings of subscription. - * + * * @param manager Entry point to SecurityManager. */ public static void getSettingsOfSubscription(com.azure.resourcemanager.security.SecurityManager manager) { @@ -5639,23 +6919,25 @@ public final class SettingsListSamples { ```java import com.azure.resourcemanager.security.models.DataExportSettings; -import com.azure.resourcemanager.security.models.SettingName; +import com.azure.resourcemanager.security.models.SettingNameAutoGenerated; -/** Samples for Settings Update. */ +/** + * Samples for Settings Update. + */ public final class SettingsUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/UpdateSetting_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/ + * UpdateSetting_example.json */ /** * Sample code: Update a setting for subscription. - * + * * @param manager Entry point to SecurityManager. */ public static void updateASettingForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .settings() - .updateWithResponse( - SettingName.WDATP, new DataExportSettings().withEnabled(true), com.azure.core.util.Context.NONE); + manager.settings().updateWithResponse(SettingNameAutoGenerated.WDATP, + new DataExportSettings().withEnabled(true), com.azure.core.util.Context.NONE); } } ``` @@ -5663,27 +6945,24 @@ public final class SettingsUpdateSamples { ### SoftwareInventories_Get ```java -/** Samples for SoftwareInventories Get. */ +/** + * Samples for SoftwareInventories Get. + */ public final class SoftwareInventoriesGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-05-01-preview/examples/SoftwareInventories/GetSoftware_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2021-05-01-preview/examples/ + * SoftwareInventories/GetSoftware_example.json */ /** * Sample code: Gets a single software data of the virtual machine. - * + * * @param manager Entry point to SecurityManager. */ - public static void getsASingleSoftwareDataOfTheVirtualMachine( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .softwareInventories() - .getWithResponse( - "EITAN-TESTS", - "Microsoft.Compute", - "virtualMachines", - "Eitan-Test1", - "outlook_16.0.10371.20060", - com.azure.core.util.Context.NONE); + public static void + getsASingleSoftwareDataOfTheVirtualMachine(com.azure.resourcemanager.security.SecurityManager manager) { + manager.softwareInventories().getWithResponse("EITAN-TESTS", "Microsoft.Compute", "virtualMachines", + "Eitan-Test1", "outlook_16.0.10371.20060", com.azure.core.util.Context.NONE); } } ``` @@ -5691,14 +6970,18 @@ public final class SoftwareInventoriesGetSamples { ### SoftwareInventories_List ```java -/** Samples for SoftwareInventories List. */ +/** + * Samples for SoftwareInventories List. + */ public final class SoftwareInventoriesListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-05-01-preview/examples/SoftwareInventories/ListBySubscriptionSoftwareInventories_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2021-05-01-preview/examples/ + * SoftwareInventories/ListBySubscriptionSoftwareInventories_example.json */ /** * Sample code: Gets the software inventory of all virtual machines in the subscriptions. - * + * * @param manager Entry point to SecurityManager. */ public static void getsTheSoftwareInventoryOfAllVirtualMachinesInTheSubscriptions( @@ -5711,22 +6994,24 @@ public final class SoftwareInventoriesListSamples { ### SoftwareInventories_ListByExtendedResource ```java -/** Samples for SoftwareInventories ListByExtendedResource. */ +/** + * Samples for SoftwareInventories ListByExtendedResource. + */ public final class SoftwareInventoriesListByExtendedResourceSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-05-01-preview/examples/SoftwareInventories/ListByExtendedResourceSoftwareInventories_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2021-05-01-preview/examples/ + * SoftwareInventories/ListByExtendedResourceSoftwareInventories_example.json */ /** * Sample code: Gets the software inventory of the virtual machine. - * + * * @param manager Entry point to SecurityManager. */ - public static void getsTheSoftwareInventoryOfTheVirtualMachine( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .softwareInventories() - .listByExtendedResource( - "EITAN-TESTS", "Microsoft.Compute", "virtualMachines", "Eitan-Test1", com.azure.core.util.Context.NONE); + public static void + getsTheSoftwareInventoryOfTheVirtualMachine(com.azure.resourcemanager.security.SecurityManager manager) { + manager.softwareInventories().listByExtendedResource("EITAN-TESTS", "Microsoft.Compute", "virtualMachines", + "Eitan-Test1", com.azure.core.util.Context.NONE); } } ``` @@ -5739,52 +7024,47 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for SqlVulnerabilityAssessmentBaselineRules Add. */ +/** + * Samples for SqlVulnerabilityAssessmentBaselineRules Add. + */ public final class SqlVulnerabilityAssessmentBaselineRulesAddSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Add.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/ + * sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Add.json */ /** * Sample code: Create a baseline for all rules. - * + * * @param manager Entry point to SecurityManager. */ public static void createABaselineForAllRules(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .sqlVulnerabilityAssessmentBaselineRules() - .addWithResponse( - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - new RulesResultsInput() - .withLatestScan(false) - .withResults( - mapOf( - "VA1234", - Arrays.asList(Arrays.asList("userA", "SELECT"), Arrays.asList("userB", "SELECT")), - "VA5678", - Arrays.asList(Arrays.asList("Test", "0.0.0.0", "125.125.125.125")))), - com.azure.core.util.Context.NONE); + manager.sqlVulnerabilityAssessmentBaselineRules().addWithResponse("55555555-6666-7777-8888-999999999999", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + new RulesResultsInput().withLatestScan(false).withResults( + mapOf("VA1234", Arrays.asList(Arrays.asList("userA", "SELECT"), Arrays.asList("userB", "SELECT")), + "VA5678", Arrays.asList(Arrays.asList("Test", "0.0.0.0", "125.125.125.125")))), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_AddLatest.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/ + * sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_AddLatest.json */ /** * Sample code: Create a baseline for all rules using the latest scan results. - * + * * @param manager Entry point to SecurityManager. */ public static void createABaselineForAllRulesUsingTheLatestScanResults( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .sqlVulnerabilityAssessmentBaselineRules() - .addWithResponse( - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - new RulesResultsInput().withLatestScan(true).withResults(mapOf()), - com.azure.core.util.Context.NONE); + manager.sqlVulnerabilityAssessmentBaselineRules().addWithResponse("55555555-6666-7777-8888-999999999999", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + new RulesResultsInput().withLatestScan(true).withResults(mapOf()), com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -5803,47 +7083,44 @@ public final class SqlVulnerabilityAssessmentBaselineRulesAddSamples { ```java import java.util.Arrays; -/** Samples for SqlVulnerabilityAssessmentBaselineRules CreateOrUpdate. */ +/** + * Samples for SqlVulnerabilityAssessmentBaselineRules CreateOrUpdate. + */ public final class SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_PutLatest.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/ + * sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_PutLatest.json */ /** * Sample code: Create a baseline using the latest scan results. - * + * * @param manager Entry point to SecurityManager. */ - public static void createABaselineUsingTheLatestScanResults( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .sqlVulnerabilityAssessmentBaselineRules() - .define("VA1234") - .withExistingResourceId( - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master") - .withLatestScan(true) - .withResults(Arrays.asList()) - .withWorkspaceId("55555555-6666-7777-8888-999999999999") + public static void + createABaselineUsingTheLatestScanResults(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules().define("VA1234").withExistingResourceId( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master") + .withLatestScan(true).withResults(Arrays.asList()).withWorkspaceId("55555555-6666-7777-8888-999999999999") .create(); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Put.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/ + * sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Put.json */ /** * Sample code: Create a baseline. - * + * * @param manager Entry point to SecurityManager. */ public static void createABaseline(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .sqlVulnerabilityAssessmentBaselineRules() - .define("VA1234") - .withExistingResourceId( - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master") + manager.sqlVulnerabilityAssessmentBaselineRules().define("VA1234").withExistingResourceId( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master") .withLatestScan(false) .withResults(Arrays.asList(Arrays.asList("userA", "SELECT"), Arrays.asList("userB", "SELECT"))) - .withWorkspaceId("55555555-6666-7777-8888-999999999999") - .create(); + .withWorkspaceId("55555555-6666-7777-8888-999999999999").create(); } } ``` @@ -5851,24 +7128,25 @@ public final class SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples ### SqlVulnerabilityAssessmentBaselineRules_Delete ```java -/** Samples for SqlVulnerabilityAssessmentBaselineRules Delete. */ +/** + * Samples for SqlVulnerabilityAssessmentBaselineRules Delete. + */ public final class SqlVulnerabilityAssessmentBaselineRulesDeleteSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Delete.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/ + * sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Delete.json */ /** * Sample code: Delete the baseline. - * + * * @param manager Entry point to SecurityManager. */ public static void deleteTheBaseline(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .sqlVulnerabilityAssessmentBaselineRules() - .deleteWithResponse( - "VA1234", - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - com.azure.core.util.Context.NONE); + manager.sqlVulnerabilityAssessmentBaselineRules().deleteWithResponse("VA1234", + "55555555-6666-7777-8888-999999999999", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + com.azure.core.util.Context.NONE); } } ``` @@ -5876,24 +7154,25 @@ public final class SqlVulnerabilityAssessmentBaselineRulesDeleteSamples { ### SqlVulnerabilityAssessmentBaselineRules_Get ```java -/** Samples for SqlVulnerabilityAssessmentBaselineRules Get. */ +/** + * Samples for SqlVulnerabilityAssessmentBaselineRules Get. + */ public final class SqlVulnerabilityAssessmentBaselineRulesGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Get.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/ + * sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Get.json */ /** * Sample code: Get the baseline. - * + * * @param manager Entry point to SecurityManager. */ public static void getTheBaseline(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .sqlVulnerabilityAssessmentBaselineRules() - .getWithResponse( - "VA1234", - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - com.azure.core.util.Context.NONE); + manager.sqlVulnerabilityAssessmentBaselineRules().getWithResponse("VA1234", + "55555555-6666-7777-8888-999999999999", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + com.azure.core.util.Context.NONE); } } ``` @@ -5901,23 +7180,24 @@ public final class SqlVulnerabilityAssessmentBaselineRulesGetSamples { ### SqlVulnerabilityAssessmentBaselineRules_List ```java -/** Samples for SqlVulnerabilityAssessmentBaselineRules List. */ +/** + * Samples for SqlVulnerabilityAssessmentBaselineRules List. + */ public final class SqlVulnerabilityAssessmentBaselineRulesListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_List.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/ + * sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_List.json */ /** * Sample code: List baseline for all rules. - * + * * @param manager Entry point to SecurityManager. */ public static void listBaselineForAllRules(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .sqlVulnerabilityAssessmentBaselineRules() - .listWithResponse( - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - com.azure.core.util.Context.NONE); + manager.sqlVulnerabilityAssessmentBaselineRules().listWithResponse("55555555-6666-7777-8888-999999999999", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + com.azure.core.util.Context.NONE); } } ``` @@ -5925,44 +7205,42 @@ public final class SqlVulnerabilityAssessmentBaselineRulesListSamples { ### SqlVulnerabilityAssessmentScanResults_Get ```java -/** Samples for SqlVulnerabilityAssessmentScanResults Get. */ +/** + * Samples for SqlVulnerabilityAssessmentScanResults Get. + */ public final class SqlVulnerabilityAssessmentScanResultsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_Get.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/ + * sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_Get.json */ /** * Sample code: Get scan details of a scan record. - * + * * @param manager Entry point to SecurityManager. */ public static void getScanDetailsOfAScanRecord(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .sqlVulnerabilityAssessmentScanResults() - .getWithResponse( - "Scheduled-20200623", - "VA2063", - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - com.azure.core.util.Context.NONE); + manager.sqlVulnerabilityAssessmentScanResults().getWithResponse("Scheduled-20200623", "VA2063", + "55555555-6666-7777-8888-999999999999", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_GetLatest.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/ + * sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_GetLatest.json */ /** * Sample code: Get scan details of the latest scan record. - * + * * @param manager Entry point to SecurityManager. */ public static void getScanDetailsOfTheLatestScanRecord(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .sqlVulnerabilityAssessmentScanResults() - .getWithResponse( - "latest", - "VA2063", - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - com.azure.core.util.Context.NONE); + manager.sqlVulnerabilityAssessmentScanResults().getWithResponse("latest", "VA2063", + "55555555-6666-7777-8888-999999999999", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + com.azure.core.util.Context.NONE); } } ``` @@ -5970,42 +7248,42 @@ public final class SqlVulnerabilityAssessmentScanResultsGetSamples { ### SqlVulnerabilityAssessmentScanResults_List ```java -/** Samples for SqlVulnerabilityAssessmentScanResults List. */ +/** + * Samples for SqlVulnerabilityAssessmentScanResults List. + */ public final class SqlVulnerabilityAssessmentScanResultsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_ListLatest.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/ + * sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_ListLatest.json */ /** * Sample code: List scan results of the latest scan. - * + * * @param manager Entry point to SecurityManager. */ public static void listScanResultsOfTheLatestScan(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .sqlVulnerabilityAssessmentScanResults() - .listWithResponse( - "latest", - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - com.azure.core.util.Context.NONE); + manager.sqlVulnerabilityAssessmentScanResults().listWithResponse("latest", + "55555555-6666-7777-8888-999999999999", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_List.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/ + * sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_List.json */ /** * Sample code: List scan results. - * + * * @param manager Entry point to SecurityManager. */ public static void listScanResults(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .sqlVulnerabilityAssessmentScanResults() - .listWithResponse( - "Scheduled-20200623", - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - com.azure.core.util.Context.NONE); + manager.sqlVulnerabilityAssessmentScanResults().listWithResponse("Scheduled-20200623", + "55555555-6666-7777-8888-999999999999", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + com.azure.core.util.Context.NONE); } } ``` @@ -6013,42 +7291,41 @@ public final class SqlVulnerabilityAssessmentScanResultsListSamples { ### SqlVulnerabilityAssessmentScans_Get ```java -/** Samples for SqlVulnerabilityAssessmentScans Get. */ +/** + * Samples for SqlVulnerabilityAssessmentScans Get. + */ public final class SqlVulnerabilityAssessmentScansGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_Get.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/ + * sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_Get.json */ /** * Sample code: Get scan details of a scan record. - * + * * @param manager Entry point to SecurityManager. */ public static void getScanDetailsOfAScanRecord(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .sqlVulnerabilityAssessmentScans() - .getWithResponse( - "Scheduled-20200623", - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - com.azure.core.util.Context.NONE); + manager.sqlVulnerabilityAssessmentScans().getWithResponse("Scheduled-20200623", + "55555555-6666-7777-8888-999999999999", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_GetLatest.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/ + * sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_GetLatest.json */ /** * Sample code: Get scan details of the latest scan record. - * + * * @param manager Entry point to SecurityManager. */ public static void getScanDetailsOfTheLatestScanRecord(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .sqlVulnerabilityAssessmentScans() - .getWithResponse( - "latest", - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - com.azure.core.util.Context.NONE); + manager.sqlVulnerabilityAssessmentScans().getWithResponse("latest", "55555555-6666-7777-8888-999999999999", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + com.azure.core.util.Context.NONE); } } ``` @@ -6056,23 +7333,24 @@ public final class SqlVulnerabilityAssessmentScansGetSamples { ### SqlVulnerabilityAssessmentScans_List ```java -/** Samples for SqlVulnerabilityAssessmentScans List. */ +/** + * Samples for SqlVulnerabilityAssessmentScans List. + */ public final class SqlVulnerabilityAssessmentScansListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_List.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/ + * sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_List.json */ /** * Sample code: List scan details. - * + * * @param manager Entry point to SecurityManager. */ public static void listScanDetails(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .sqlVulnerabilityAssessmentScans() - .listWithResponse( - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - com.azure.core.util.Context.NONE); + manager.sqlVulnerabilityAssessmentScans().listWithResponse("55555555-6666-7777-8888-999999999999", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + com.azure.core.util.Context.NONE); } } ``` @@ -6080,25 +7358,26 @@ public final class SqlVulnerabilityAssessmentScansListSamples { ### SubAssessments_Get ```java -/** Samples for SubAssessments Get. */ +/** + * Samples for SubAssessments Get. + */ public final class SubAssessmentsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/GetSubAssessment_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/ + * GetSubAssessment_example.json */ /** * Sample code: Get security recommendation task from security data location. - * + * * @param manager Entry point to SecurityManager. */ public static void getSecurityRecommendationTaskFromSecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .subAssessments() - .getWithResponse( - "subscriptions/212f9889-769e-45ae-ab43-6da33674bd26/resourceGroups/DEMORG/providers/Microsoft.Compute/virtualMachines/vm2", - "1195afff-c881-495e-9bc5-1486211ae03f", - "95f7da9c-a2a4-1322-0758-fcd24ef09b85", - com.azure.core.util.Context.NONE); + manager.subAssessments().getWithResponse( + "subscriptions/212f9889-769e-45ae-ab43-6da33674bd26/resourceGroups/DEMORG/providers/Microsoft.Compute/virtualMachines/vm2", + "1195afff-c881-495e-9bc5-1486211ae03f", "95f7da9c-a2a4-1322-0758-fcd24ef09b85", + com.azure.core.util.Context.NONE); } } ``` @@ -6106,23 +7385,23 @@ public final class SubAssessmentsGetSamples { ### SubAssessments_List ```java -/** Samples for SubAssessments List. */ +/** + * Samples for SubAssessments List. + */ public final class SubAssessmentsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/ListSubAssessments_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/ + * ListSubAssessments_example.json */ /** * Sample code: List security sub-assessments. - * + * * @param manager Entry point to SecurityManager. */ public static void listSecuritySubAssessments(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .subAssessments() - .list( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", - "82e20e14-edc5-4373-bfc4-f13121257c37", - com.azure.core.util.Context.NONE); + manager.subAssessments().list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "82e20e14-edc5-4373-bfc4-f13121257c37", com.azure.core.util.Context.NONE); } } ``` @@ -6130,20 +7409,23 @@ public final class SubAssessmentsListSamples { ### SubAssessments_ListAll ```java -/** Samples for SubAssessments ListAll. */ +/** + * Samples for SubAssessments ListAll. + */ public final class SubAssessmentsListAllSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/ListSubscriptionSubAssessments_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/ + * ListSubscriptionSubAssessments_example.json */ /** * Sample code: List security sub-assessments. - * + * * @param manager Entry point to SecurityManager. */ public static void listSecuritySubAssessments(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .subAssessments() - .listAll("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); + manager.subAssessments().listAll("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + com.azure.core.util.Context.NONE); } } ``` @@ -6151,22 +7433,24 @@ public final class SubAssessmentsListAllSamples { ### Tasks_GetResourceGroupLevelTask ```java -/** Samples for Tasks GetResourceGroupLevelTask. */ +/** + * Samples for Tasks GetResourceGroupLevelTask. + */ public final class TasksGetResourceGroupLevelTaskSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTaskResourceGroupLocation_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/ + * GetTaskResourceGroupLocation_example.json */ /** * Sample code: Get security recommendation task in a resource group. - * + * * @param manager Entry point to SecurityManager. */ - public static void getSecurityRecommendationTaskInAResourceGroup( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .tasks() - .getResourceGroupLevelTaskWithResponse( - "myRg", "westeurope", "d55b4dc0-779c-c66c-33e5-d7bce24c4222", com.azure.core.util.Context.NONE); + public static void + getSecurityRecommendationTaskInAResourceGroup(com.azure.resourcemanager.security.SecurityManager manager) { + manager.tasks().getResourceGroupLevelTaskWithResponse("myRg", "westeurope", + "d55b4dc0-779c-c66c-33e5-d7bce24c4222", com.azure.core.util.Context.NONE); } } ``` @@ -6174,22 +7458,24 @@ public final class TasksGetResourceGroupLevelTaskSamples { ### Tasks_GetSubscriptionLevelTask ```java -/** Samples for Tasks GetSubscriptionLevelTask. */ +/** + * Samples for Tasks GetSubscriptionLevelTask. + */ public final class TasksGetSubscriptionLevelTaskSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTaskSubscriptionLocation_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/ + * GetTaskSubscriptionLocation_example.json */ /** * Sample code: Get security recommendation task from security data location. - * + * * @param manager Entry point to SecurityManager. */ public static void getSecurityRecommendationTaskFromSecurityDataLocation( com.azure.resourcemanager.security.SecurityManager manager) { - manager - .tasks() - .getSubscriptionLevelTaskWithResponse( - "westeurope", "62609ee7-d0a5-8616-9fe4-1df5cca7758d", com.azure.core.util.Context.NONE); + manager.tasks().getSubscriptionLevelTaskWithResponse("westeurope", "62609ee7-d0a5-8616-9fe4-1df5cca7758d", + com.azure.core.util.Context.NONE); } } ``` @@ -6197,14 +7483,18 @@ public final class TasksGetSubscriptionLevelTaskSamples { ### Tasks_List ```java -/** Samples for Tasks List. */ +/** + * Samples for Tasks List. + */ public final class TasksListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTasksSubscription_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/ + * GetTasksSubscription_example.json */ /** * Sample code: Get security recommendations tasks. - * + * * @param manager Entry point to SecurityManager. */ public static void getSecurityRecommendationsTasks(com.azure.resourcemanager.security.SecurityManager manager) { @@ -6216,14 +7506,18 @@ public final class TasksListSamples { ### Tasks_ListByHomeRegion ```java -/** Samples for Tasks ListByHomeRegion. */ +/** + * Samples for Tasks ListByHomeRegion. + */ public final class TasksListByHomeRegionSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTasksSubscriptionLocation_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/ + * GetTasksSubscriptionLocation_example.json */ /** * Sample code: Get security recommendations tasks from security data location. - * + * * @param manager Entry point to SecurityManager. */ public static void getSecurityRecommendationsTasksFromSecurityDataLocation( @@ -6236,18 +7530,22 @@ public final class TasksListByHomeRegionSamples { ### Tasks_ListByResourceGroup ```java -/** Samples for Tasks ListByResourceGroup. */ +/** + * Samples for Tasks ListByResourceGroup. + */ public final class TasksListByResourceGroupSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTasksResourceGroupLocation_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/ + * GetTasksResourceGroupLocation_example.json */ /** * Sample code: Get security recommendation tasks in a resource group. - * + * * @param manager Entry point to SecurityManager. */ - public static void getSecurityRecommendationTasksInAResourceGroup( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void + getSecurityRecommendationTasksInAResourceGroup(com.azure.resourcemanager.security.SecurityManager manager) { manager.tasks().listByResourceGroup("myRg", "westeurope", null, com.azure.core.util.Context.NONE); } } @@ -6258,26 +7556,24 @@ public final class TasksListByResourceGroupSamples { ```java import com.azure.resourcemanager.security.models.TaskUpdateActionType; -/** Samples for Tasks UpdateResourceGroupLevelTaskState. */ +/** + * Samples for Tasks UpdateResourceGroupLevelTaskState. + */ public final class TasksUpdateResourceGroupLevelTaskStateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/UpdateTaskResourceGroupLocation_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/ + * UpdateTaskResourceGroupLocation_example.json */ /** * Sample code: Change security recommendation task state. - * + * * @param manager Entry point to SecurityManager. */ - public static void changeSecurityRecommendationTaskState( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .tasks() - .updateResourceGroupLevelTaskStateWithResponse( - "myRg", - "westeurope", - "d55b4dc0-779c-c66c-33e5-d7bce24c4222", - TaskUpdateActionType.DISMISS, - com.azure.core.util.Context.NONE); + public static void + changeSecurityRecommendationTaskState(com.azure.resourcemanager.security.SecurityManager manager) { + manager.tasks().updateResourceGroupLevelTaskStateWithResponse("myRg", "westeurope", + "d55b4dc0-779c-c66c-33e5-d7bce24c4222", TaskUpdateActionType.DISMISS, com.azure.core.util.Context.NONE); } } ``` @@ -6287,25 +7583,24 @@ public final class TasksUpdateResourceGroupLevelTaskStateSamples { ```java import com.azure.resourcemanager.security.models.TaskUpdateActionType; -/** Samples for Tasks UpdateSubscriptionLevelTaskState. */ +/** + * Samples for Tasks UpdateSubscriptionLevelTaskState. + */ public final class TasksUpdateSubscriptionLevelTaskStateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/UpdateTaskSubscriptionLocation_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/ + * UpdateTaskSubscriptionLocation_example.json */ /** * Sample code: Change security recommendation task state. - * + * * @param manager Entry point to SecurityManager. */ - public static void changeSecurityRecommendationTaskState( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .tasks() - .updateSubscriptionLevelTaskStateWithResponse( - "westeurope", - "62609ee7-d0a5-8616-9fe4-1df5cca7758d", - TaskUpdateActionType.DISMISS, - com.azure.core.util.Context.NONE); + public static void + changeSecurityRecommendationTaskState(com.azure.resourcemanager.security.SecurityManager manager) { + manager.tasks().updateSubscriptionLevelTaskStateWithResponse("westeurope", + "62609ee7-d0a5-8616-9fe4-1df5cca7758d", TaskUpdateActionType.DISMISS, com.azure.core.util.Context.NONE); } } ``` @@ -6313,14 +7608,18 @@ public final class TasksUpdateSubscriptionLevelTaskStateSamples { ### Topology_Get ```java -/** Samples for Topology Get. */ +/** + * Samples for Topology Get. + */ public final class TopologyGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/GetTopology_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/ + * GetTopology_example.json */ /** * Sample code: Get topology. - * + * * @param manager Entry point to SecurityManager. */ public static void getTopology(com.azure.resourcemanager.security.SecurityManager manager) { @@ -6332,14 +7631,18 @@ public final class TopologyGetSamples { ### Topology_List ```java -/** Samples for Topology List. */ +/** + * Samples for Topology List. + */ public final class TopologyListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/GetTopologySubscription_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/ + * GetTopologySubscription_example.json */ /** * Sample code: Get topology on a subscription. - * + * * @param manager Entry point to SecurityManager. */ public static void getTopologyOnASubscription(com.azure.resourcemanager.security.SecurityManager manager) { @@ -6351,18 +7654,22 @@ public final class TopologyListSamples { ### Topology_ListByHomeRegion ```java -/** Samples for Topology ListByHomeRegion. */ +/** + * Samples for Topology ListByHomeRegion. + */ public final class TopologyListByHomeRegionSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/GetTopologySubscriptionLocation_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/ + * GetTopologySubscriptionLocation_example.json */ /** * Sample code: Get topology on a subscription from security data location. - * + * * @param manager Entry point to SecurityManager. */ - public static void getTopologyOnASubscriptionFromSecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void + getTopologyOnASubscriptionFromSecurityDataLocation(com.azure.resourcemanager.security.SecurityManager manager) { manager.topologies().listByHomeRegion("centralus", com.azure.core.util.Context.NONE); } } @@ -6371,25 +7678,25 @@ public final class TopologyListByHomeRegionSamples { ### WorkspaceSettings_Create ```java -/** Samples for WorkspaceSettings Create. */ +/** + * Samples for WorkspaceSettings Create. + */ public final class WorkspaceSettingsCreateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/CreateWorkspaceSetting_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/ + * CreateWorkspaceSetting_example.json */ /** * Sample code: Create a workspace setting data for subscription. - * + * * @param manager Entry point to SecurityManager. */ - public static void createAWorkspaceSettingDataForSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .workspaceSettings() - .define("default") - .withWorkspaceId( - "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace") - .withScope("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23") - .create(); + public static void + createAWorkspaceSettingDataForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.workspaceSettings().define("default").withWorkspaceId( + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace") + .withScope("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23").create(); } } ``` @@ -6397,18 +7704,22 @@ public final class WorkspaceSettingsCreateSamples { ### WorkspaceSettings_Delete ```java -/** Samples for WorkspaceSettings Delete. */ +/** + * Samples for WorkspaceSettings Delete. + */ public final class WorkspaceSettingsDeleteSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/DeleteWorkspaceSetting_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/ + * DeleteWorkspaceSetting_example.json */ /** * Sample code: Delete a workspace setting data for resource group. - * + * * @param manager Entry point to SecurityManager. */ - public static void deleteAWorkspaceSettingDataForResourceGroup( - com.azure.resourcemanager.security.SecurityManager manager) { + public static void + deleteAWorkspaceSettingDataForResourceGroup(com.azure.resourcemanager.security.SecurityManager manager) { manager.workspaceSettings().deleteWithResponse("default", com.azure.core.util.Context.NONE); } } @@ -6417,14 +7728,18 @@ public final class WorkspaceSettingsDeleteSamples { ### WorkspaceSettings_Get ```java -/** Samples for WorkspaceSettings Get. */ +/** + * Samples for WorkspaceSettings Get. + */ public final class WorkspaceSettingsGetSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/GetWorkspaceSetting_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/ + * GetWorkspaceSetting_example.json */ /** * Sample code: Get a workspace setting on subscription. - * + * * @param manager Entry point to SecurityManager. */ public static void getAWorkspaceSettingOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { @@ -6436,14 +7751,18 @@ public final class WorkspaceSettingsGetSamples { ### WorkspaceSettings_List ```java -/** Samples for WorkspaceSettings List. */ +/** + * Samples for WorkspaceSettings List. + */ public final class WorkspaceSettingsListSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/GetWorkspaceSettings_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/ + * GetWorkspaceSettings_example.json */ /** * Sample code: Get workspace settings on subscription. - * + * * @param manager Entry point to SecurityManager. */ public static void getWorkspaceSettingsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { @@ -6457,24 +7776,26 @@ public final class WorkspaceSettingsListSamples { ```java import com.azure.resourcemanager.security.models.WorkspaceSetting; -/** Samples for WorkspaceSettings Update. */ +/** + * Samples for WorkspaceSettings Update. + */ public final class WorkspaceSettingsUpdateSamples { /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/UpdateWorkspaceSetting_example.json + * x-ms-original-file: + * specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/ + * UpdateWorkspaceSetting_example.json */ /** * Sample code: Update a workspace setting data for subscription. - * + * * @param manager Entry point to SecurityManager. */ - public static void updateAWorkspaceSettingDataForSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - WorkspaceSetting resource = - manager.workspaceSettings().getWithResponse("default", com.azure.core.util.Context.NONE).getValue(); - resource - .update() - .withWorkspaceId( - "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace") + public static void + updateAWorkspaceSettingDataForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + WorkspaceSetting resource + = manager.workspaceSettings().getWithResponse("default", com.azure.core.util.Context.NONE).getValue(); + resource.update().withWorkspaceId( + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace") .apply(); } } diff --git a/sdk/security/azure-resourcemanager-security/pom.xml b/sdk/security/azure-resourcemanager-security/pom.xml index a17ad75df9f51..60126c77e3bc1 100644 --- a/sdk/security/azure-resourcemanager-security/pom.xml +++ b/sdk/security/azure-resourcemanager-security/pom.xml @@ -45,6 +45,7 @@ UTF-8 0 0 + true @@ -87,8 +88,6 @@ 4.11.0 test - - net.bytebuddy byte-buddy diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/SecurityManager.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/SecurityManager.java index 80fd7da717a70..de2f8a7627be7 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/SecurityManager.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/SecurityManager.java @@ -30,8 +30,6 @@ 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.ApiCollectionOffboardingsImpl; -import com.azure.resourcemanager.security.implementation.ApiCollectionOnboardingsImpl; import com.azure.resourcemanager.security.implementation.ApiCollectionsImpl; import com.azure.resourcemanager.security.implementation.ApplicationOperationsImpl; import com.azure.resourcemanager.security.implementation.ApplicationsImpl; @@ -39,20 +37,29 @@ import com.azure.resourcemanager.security.implementation.AssessmentsMetadatasImpl; 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.ConnectorsImpl; import com.azure.resourcemanager.security.implementation.CustomAssessmentAutomationsImpl; import com.azure.resourcemanager.security.implementation.CustomEntityStoreAssignmentsImpl; +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.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.HealthReportOperationsImpl; import com.azure.resourcemanager.security.implementation.HealthReportsImpl; import com.azure.resourcemanager.security.implementation.InformationProtectionPoliciesImpl; -import com.azure.resourcemanager.security.implementation.IngestionSettingsImpl; import com.azure.resourcemanager.security.implementation.IotSecuritySolutionAnalyticsImpl; import com.azure.resourcemanager.security.implementation.IotSecuritySolutionsAnalyticsAggregatedAlertsImpl; import com.azure.resourcemanager.security.implementation.IotSecuritySolutionsAnalyticsRecommendationsImpl; @@ -65,6 +72,7 @@ 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.ResourceProvidersImpl; import com.azure.resourcemanager.security.implementation.SecureScoreControlDefinitionsImpl; import com.azure.resourcemanager.security.implementation.SecureScoreControlsImpl; import com.azure.resourcemanager.security.implementation.SecureScoresImpl; @@ -76,7 +84,9 @@ 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.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.SoftwareInventoriesImpl; import com.azure.resourcemanager.security.implementation.SqlVulnerabilityAssessmentBaselineRulesImpl; @@ -92,8 +102,6 @@ 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.ApiCollectionOffboardings; -import com.azure.resourcemanager.security.models.ApiCollectionOnboardings; import com.azure.resourcemanager.security.models.ApiCollections; import com.azure.resourcemanager.security.models.ApplicationOperations; import com.azure.resourcemanager.security.models.Applications; @@ -101,20 +109,29 @@ import com.azure.resourcemanager.security.models.AssessmentsMetadatas; 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.Connectors; import com.azure.resourcemanager.security.models.CustomAssessmentAutomations; import com.azure.resourcemanager.security.models.CustomEntityStoreAssignments; +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.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.HealthReportOperations; import com.azure.resourcemanager.security.models.HealthReports; import com.azure.resourcemanager.security.models.InformationProtectionPolicies; -import com.azure.resourcemanager.security.models.IngestionSettings; import com.azure.resourcemanager.security.models.IotSecuritySolutionAnalytics; import com.azure.resourcemanager.security.models.IotSecuritySolutions; import com.azure.resourcemanager.security.models.IotSecuritySolutionsAnalyticsAggregatedAlerts; @@ -127,6 +144,7 @@ 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.ResourceProviders; import com.azure.resourcemanager.security.models.SecureScoreControlDefinitions; import com.azure.resourcemanager.security.models.SecureScoreControls; import com.azure.resourcemanager.security.models.SecureScores; @@ -137,7 +155,9 @@ 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.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.SoftwareInventories; import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentBaselineRules; @@ -154,147 +174,166 @@ import java.util.Objects; import java.util.stream.Collectors; -/** Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) resource provider. */ +/** + * Entry point to SecurityManager. + * API spec for Microsoft.Security (Azure Security Center) resource provider. + */ public final class SecurityManager { - private MdeOnboardings mdeOnboardings; + private Locations locations; - private CustomAssessmentAutomations customAssessmentAutomations; + private Operations operations; - private CustomEntityStoreAssignments customEntityStoreAssignments; + private Tasks tasks; - private ComplianceResults complianceResults; + private AutoProvisioningSettings autoProvisioningSettings; - private Pricings pricings; + private Compliances compliances; - private AdvancedThreatProtections advancedThreatProtections; + private InformationProtectionPolicies informationProtectionPolicies; - private DeviceSecurityGroups deviceSecurityGroups; + private WorkspaceSettings workspaceSettings; - private IotSecuritySolutions iotSecuritySolutions; + private AlertsSuppressionRules alertsSuppressionRules; - private IotSecuritySolutionAnalytics iotSecuritySolutionAnalytics; + private Automations automations; - private IotSecuritySolutionsAnalyticsAggregatedAlerts iotSecuritySolutionsAnalyticsAggregatedAlerts; + private RegulatoryComplianceStandards regulatoryComplianceStandards; - private IotSecuritySolutionsAnalyticsRecommendations iotSecuritySolutionsAnalyticsRecommendations; + private RegulatoryComplianceControls regulatoryComplianceControls; - private Locations locations; + private RegulatoryComplianceAssessments regulatoryComplianceAssessments; - private Operations operations; + private SubAssessments subAssessments; - private Tasks tasks; + private Connectors connectors; - private AutoProvisioningSettings autoProvisioningSettings; + private SecurityContacts securityContacts; - private Compliances compliances; + private SoftwareInventories softwareInventories; - private InformationProtectionPolicies informationProtectionPolicies; + private CustomAssessmentAutomations customAssessmentAutomations; - private SecurityContacts securityContacts; + private CustomEntityStoreAssignments customEntityStoreAssignments; - private WorkspaceSettings workspaceSettings; + private MdeOnboardings mdeOnboardings; - private RegulatoryComplianceStandards regulatoryComplianceStandards; + private GovernanceAssignments governanceAssignments; - private RegulatoryComplianceControls regulatoryComplianceControls; + private GovernanceRules governanceRules; - private RegulatoryComplianceAssessments regulatoryComplianceAssessments; + private Applications applications; - private SubAssessments subAssessments; + private ApplicationOperations applicationOperations; - private Automations automations; + private SecurityConnectorApplications securityConnectorApplications; - private AlertsSuppressionRules alertsSuppressionRules; + private SecurityConnectorApplicationOperations securityConnectorApplicationOperations; - private ServerVulnerabilityAssessments serverVulnerabilityAssessments; + private DefenderForStorages defenderForStorages; - private AssessmentsMetadatas assessmentsMetadatas; + private SecurityOperators securityOperators; - private Assessments assessments; + private SqlVulnerabilityAssessmentBaselineRules sqlVulnerabilityAssessmentBaselineRules; - private AdaptiveApplicationControls adaptiveApplicationControls; + private SqlVulnerabilityAssessmentScans sqlVulnerabilityAssessmentScans; - private AdaptiveNetworkHardenings adaptiveNetworkHardenings; + private SqlVulnerabilityAssessmentScanResults sqlVulnerabilityAssessmentScanResults; - private AllowedConnections allowedConnections; + private ResourceProviders resourceProviders; - private Topologies topologies; + private SensitivitySettings sensitivitySettings; - private JitNetworkAccessPolicies jitNetworkAccessPolicies; + private HealthReports healthReports; - private DiscoveredSecuritySolutions discoveredSecuritySolutions; + private AzureDevOpsOrgs azureDevOpsOrgs; - private SecuritySolutionsReferenceDatas securitySolutionsReferenceDatas; + private AzureDevOpsProjects azureDevOpsProjects; - private ExternalSecuritySolutions externalSecuritySolutions; + private AzureDevOpsRepos azureDevOpsRepos; - private SecureScores secureScores; + private DevOpsConfigurations devOpsConfigurations; - private SecureScoreControls secureScoreControls; + private GitHubOwners gitHubOwners; - private SecureScoreControlDefinitions secureScoreControlDefinitions; + private GitHubRepos gitHubRepos; - private SecuritySolutions securitySolutions; + private GitLabGroups gitLabGroups; - private Connectors connectors; + private GitLabSubgroups gitLabSubgroups; - private Alerts alerts; + private GitLabProjects gitLabProjects; - private Settings settings; + private DevOpsOperationResults devOpsOperationResults; - private IngestionSettings ingestionSettings; + private SecurityConnectors securityConnectors; - private SoftwareInventories softwareInventories; + private ComplianceResults complianceResults; - private GovernanceRules governanceRules; + private AdvancedThreatProtections advancedThreatProtections; - private GovernanceAssignments governanceAssignments; + private DeviceSecurityGroups deviceSecurityGroups; - private Applications applications; + private IotSecuritySolutionAnalytics iotSecuritySolutionAnalytics; - private ApplicationOperations applicationOperations; + private IotSecuritySolutionsAnalyticsAggregatedAlerts iotSecuritySolutionsAnalyticsAggregatedAlerts; - private SecurityConnectorApplications securityConnectorApplications; + private IotSecuritySolutionsAnalyticsRecommendations iotSecuritySolutionsAnalyticsRecommendations; - private SecurityConnectorApplicationOperations securityConnectorApplicationOperations; + private IotSecuritySolutions iotSecuritySolutions; - private ApiCollections apiCollections; + private AdaptiveNetworkHardenings adaptiveNetworkHardenings; - private ApiCollectionOnboardings apiCollectionOnboardings; + private AllowedConnections allowedConnections; - private ApiCollectionOffboardings apiCollectionOffboardings; + private AdaptiveApplicationControls adaptiveApplicationControls; - private HealthReports healthReports; + private DiscoveredSecuritySolutions discoveredSecuritySolutions; - private HealthReportOperations healthReportOperations; + private ExternalSecuritySolutions externalSecuritySolutions; - private SqlVulnerabilityAssessmentScans sqlVulnerabilityAssessmentScans; + private JitNetworkAccessPolicies jitNetworkAccessPolicies; - private SqlVulnerabilityAssessmentScanResults sqlVulnerabilityAssessmentScanResults; + private SecureScores secureScores; - private SqlVulnerabilityAssessmentBaselineRules sqlVulnerabilityAssessmentBaselineRules; + private SecureScoreControls secureScoreControls; - private SecurityConnectors securityConnectors; + private SecureScoreControlDefinitions secureScoreControlDefinitions; - private SecurityOperators securityOperators; + private SecuritySolutions securitySolutions; + + private SecuritySolutionsReferenceDatas securitySolutionsReferenceDatas; + + private ServerVulnerabilityAssessments serverVulnerabilityAssessments; + + private Topologies topologies; + + private AssessmentsMetadatas assessmentsMetadatas; + + private Assessments assessments; + + private Alerts alerts; + + private Settings settings; + + private ServerVulnerabilityAssessmentsSettings serverVulnerabilityAssessmentsSettings; + + private ApiCollections apiCollections; + + private Pricings pricings; 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(); + 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. @@ -307,7 +346,7 @@ public static SecurityManager authenticate(TokenCredential credential, AzureProf /** * 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. @@ -320,14 +359,16 @@ public static SecurityManager authenticate(HttpPipeline httpPipeline, AzureProfi /** * 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. */ + /** + * The Configurable allowing configurations to be set. + */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); @@ -399,8 +440,8 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { /** * Sets the retry options for the HTTP pipeline retry policy. - * - *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + *

+ * 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. @@ -417,8 +458,8 @@ public Configurable withRetryOptions(RetryOptions retryOptions) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = - Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { throw LOGGER .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); @@ -438,21 +479,12 @@ public SecurityManager authenticate(TokenCredential credential, AzureProfile pro Objects.requireNonNull(profile, "'profile' cannot be null."); StringBuilder userAgentBuilder = new StringBuilder(); - userAgentBuilder - .append("azsdk-java") - .append("-") - .append("com.azure.resourcemanager.security") - .append("/") - .append("1.0.0-beta.5"); + userAgentBuilder.append("azsdk-java").append("-").append("com.azure.resourcemanager.security").append("/") + .append("1.0.0-beta.6"); 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)"); + 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)"); } @@ -471,178 +503,25 @@ public SecurityManager authenticate(TokenCredential credential, AzureProfile pro 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())); + 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 ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); + 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(); + 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 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 CustomAssessmentAutomations. It manages CustomAssessmentAutomation. - * - * @return Resource collection API of CustomAssessmentAutomations. - */ - public CustomAssessmentAutomations customAssessmentAutomations() { - if (this.customAssessmentAutomations == null) { - this.customAssessmentAutomations = - new CustomAssessmentAutomationsImpl(clientObject.getCustomAssessmentAutomations(), this); - } - return customAssessmentAutomations; - } - - /** - * Gets the resource collection API of CustomEntityStoreAssignments. It manages CustomEntityStoreAssignment. - * - * @return Resource collection API of CustomEntityStoreAssignments. - */ - public CustomEntityStoreAssignments customEntityStoreAssignments() { - if (this.customEntityStoreAssignments == null) { - this.customEntityStoreAssignments = - new CustomEntityStoreAssignmentsImpl(clientObject.getCustomEntityStoreAssignments(), this); - } - return customEntityStoreAssignments; - } - - /** - * 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 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 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 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 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 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 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() { @@ -654,7 +533,7 @@ public Locations locations() { /** * Gets the resource collection API of Operations. - * + * * @return Resource collection API of Operations. */ public Operations operations() { @@ -666,7 +545,7 @@ public Operations operations() { /** * Gets the resource collection API of Tasks. - * + * * @return Resource collection API of Tasks. */ public Tasks tasks() { @@ -678,20 +557,20 @@ public Tasks tasks() { /** * 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); + 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() { @@ -703,32 +582,20 @@ public Compliances 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); + this.informationProtectionPolicies + = new InformationProtectionPoliciesImpl(clientObject.getInformationProtectionPolicies(), this); } return informationProtectionPolicies; } - /** - * 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 WorkspaceSettings. It manages WorkspaceSetting. - * + * * @return Resource collection API of WorkspaceSettings. */ public WorkspaceSettings workspaceSettings() { @@ -739,47 +606,72 @@ public WorkspaceSettings workspaceSettings() { } /** - * Gets the resource collection API of RegulatoryComplianceStandards. - * - * @return Resource collection API of RegulatoryComplianceStandards. - */ + * 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 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 RegulatoryComplianceStandards. + * + * @return Resource collection API of RegulatoryComplianceStandards. + */ public RegulatoryComplianceStandards regulatoryComplianceStandards() { if (this.regulatoryComplianceStandards == null) { - this.regulatoryComplianceStandards = - new RegulatoryComplianceStandardsImpl(clientObject.getRegulatoryComplianceStandards(), this); + 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); + 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); + this.regulatoryComplianceAssessments + = new RegulatoryComplianceAssessmentsImpl(clientObject.getRegulatoryComplianceAssessments(), this); } return regulatoryComplianceAssessments; } /** * Gets the resource collection API of SubAssessments. - * + * * @return Resource collection API of SubAssessments. */ public SubAssessments subAssessments() { @@ -790,484 +682,727 @@ public SubAssessments subAssessments() { } /** - * Gets the resource collection API of Automations. It manages Automation. - * - * @return Resource collection API of Automations. + * Gets the resource collection API of Connectors. It manages ConnectorSetting. + * + * @return Resource collection API of Connectors. */ - public Automations automations() { - if (this.automations == null) { - this.automations = new AutomationsImpl(clientObject.getAutomations(), this); + public Connectors connectors() { + if (this.connectors == null) { + this.connectors = new ConnectorsImpl(clientObject.getConnectors(), this); } - return automations; + return connectors; } /** - * Gets the resource collection API of AlertsSuppressionRules. - * - * @return Resource collection API of AlertsSuppressionRules. + * Gets the resource collection API of SecurityContacts. It manages SecurityContact. + * + * @return Resource collection API of SecurityContacts. */ - public AlertsSuppressionRules alertsSuppressionRules() { - if (this.alertsSuppressionRules == null) { - this.alertsSuppressionRules = - new AlertsSuppressionRulesImpl(clientObject.getAlertsSuppressionRules(), this); + public SecurityContacts securityContacts() { + if (this.securityContacts == null) { + this.securityContacts = new SecurityContactsImpl(clientObject.getSecurityContacts(), this); } - return alertsSuppressionRules; + return securityContacts; } /** - * Gets the resource collection API of ServerVulnerabilityAssessments. - * - * @return Resource collection API of ServerVulnerabilityAssessments. + * Gets the resource collection API of SoftwareInventories. + * + * @return Resource collection API of SoftwareInventories. */ - public ServerVulnerabilityAssessments serverVulnerabilityAssessments() { - if (this.serverVulnerabilityAssessments == null) { - this.serverVulnerabilityAssessments = - new ServerVulnerabilityAssessmentsImpl(clientObject.getServerVulnerabilityAssessments(), this); + public SoftwareInventories softwareInventories() { + if (this.softwareInventories == null) { + this.softwareInventories = new SoftwareInventoriesImpl(clientObject.getSoftwareInventories(), this); } - return serverVulnerabilityAssessments; + return softwareInventories; } /** - * Gets the resource collection API of AssessmentsMetadatas. It manages SecurityAssessmentMetadataResponse. - * - * @return Resource collection API of AssessmentsMetadatas. + * Gets the resource collection API of CustomAssessmentAutomations. It manages CustomAssessmentAutomation. + * + * @return Resource collection API of CustomAssessmentAutomations. */ - public AssessmentsMetadatas assessmentsMetadatas() { - if (this.assessmentsMetadatas == null) { - this.assessmentsMetadatas = new AssessmentsMetadatasImpl(clientObject.getAssessmentsMetadatas(), this); + public CustomAssessmentAutomations customAssessmentAutomations() { + if (this.customAssessmentAutomations == null) { + this.customAssessmentAutomations + = new CustomAssessmentAutomationsImpl(clientObject.getCustomAssessmentAutomations(), this); } - return assessmentsMetadatas; + return customAssessmentAutomations; } /** - * Gets the resource collection API of Assessments. It manages SecurityAssessmentResponse. - * - * @return Resource collection API of Assessments. + * Gets the resource collection API of CustomEntityStoreAssignments. It manages CustomEntityStoreAssignment. + * + * @return Resource collection API of CustomEntityStoreAssignments. */ - public Assessments assessments() { - if (this.assessments == null) { - this.assessments = new AssessmentsImpl(clientObject.getAssessments(), this); + public CustomEntityStoreAssignments customEntityStoreAssignments() { + if (this.customEntityStoreAssignments == null) { + this.customEntityStoreAssignments + = new CustomEntityStoreAssignmentsImpl(clientObject.getCustomEntityStoreAssignments(), this); } - return assessments; + return customEntityStoreAssignments; } /** - * Gets the resource collection API of AdaptiveApplicationControls. It manages AdaptiveApplicationControlGroup. - * - * @return Resource collection API of AdaptiveApplicationControls. + * Gets the resource collection API of MdeOnboardings. + * + * @return Resource collection API of MdeOnboardings. */ - public AdaptiveApplicationControls adaptiveApplicationControls() { - if (this.adaptiveApplicationControls == null) { - this.adaptiveApplicationControls = - new AdaptiveApplicationControlsImpl(clientObject.getAdaptiveApplicationControls(), this); + public MdeOnboardings mdeOnboardings() { + if (this.mdeOnboardings == null) { + this.mdeOnboardings = new MdeOnboardingsImpl(clientObject.getMdeOnboardings(), this); } - return adaptiveApplicationControls; + return mdeOnboardings; } /** - * Gets the resource collection API of AdaptiveNetworkHardenings. - * - * @return Resource collection API of AdaptiveNetworkHardenings. + * Gets the resource collection API of GovernanceAssignments. It manages GovernanceAssignment. + * + * @return Resource collection API of GovernanceAssignments. */ - public AdaptiveNetworkHardenings adaptiveNetworkHardenings() { - if (this.adaptiveNetworkHardenings == null) { - this.adaptiveNetworkHardenings = - new AdaptiveNetworkHardeningsImpl(clientObject.getAdaptiveNetworkHardenings(), this); + public GovernanceAssignments governanceAssignments() { + if (this.governanceAssignments == null) { + this.governanceAssignments = new GovernanceAssignmentsImpl(clientObject.getGovernanceAssignments(), this); } - return adaptiveNetworkHardenings; + return governanceAssignments; } /** - * Gets the resource collection API of AllowedConnections. - * - * @return Resource collection API of AllowedConnections. + * Gets the resource collection API of GovernanceRules. It manages GovernanceRule. + * + * @return Resource collection API of GovernanceRules. */ - public AllowedConnections allowedConnections() { - if (this.allowedConnections == null) { - this.allowedConnections = new AllowedConnectionsImpl(clientObject.getAllowedConnections(), this); + public GovernanceRules governanceRules() { + if (this.governanceRules == null) { + this.governanceRules = new GovernanceRulesImpl(clientObject.getGovernanceRules(), this); } - return allowedConnections; + return governanceRules; } /** - * Gets the resource collection API of Topologies. - * - * @return Resource collection API of Topologies. + * Gets the resource collection API of Applications. + * + * @return Resource collection API of Applications. */ - public Topologies topologies() { - if (this.topologies == null) { - this.topologies = new TopologiesImpl(clientObject.getTopologies(), this); + public Applications applications() { + if (this.applications == null) { + this.applications = new ApplicationsImpl(clientObject.getApplications(), this); } - return topologies; + return applications; } /** - * Gets the resource collection API of JitNetworkAccessPolicies. It manages JitNetworkAccessPolicy. - * - * @return Resource collection API of JitNetworkAccessPolicies. + * Gets the resource collection API of ApplicationOperations. It manages Application. + * + * @return Resource collection API of ApplicationOperations. */ - public JitNetworkAccessPolicies jitNetworkAccessPolicies() { - if (this.jitNetworkAccessPolicies == null) { - this.jitNetworkAccessPolicies = - new JitNetworkAccessPoliciesImpl(clientObject.getJitNetworkAccessPolicies(), this); + public ApplicationOperations applicationOperations() { + if (this.applicationOperations == null) { + this.applicationOperations = new ApplicationOperationsImpl(clientObject.getApplicationOperations(), this); } - return jitNetworkAccessPolicies; + return applicationOperations; } /** - * Gets the resource collection API of DiscoveredSecuritySolutions. - * - * @return Resource collection API of DiscoveredSecuritySolutions. + * Gets the resource collection API of SecurityConnectorApplications. + * + * @return Resource collection API of SecurityConnectorApplications. */ - public DiscoveredSecuritySolutions discoveredSecuritySolutions() { - if (this.discoveredSecuritySolutions == null) { - this.discoveredSecuritySolutions = - new DiscoveredSecuritySolutionsImpl(clientObject.getDiscoveredSecuritySolutions(), this); + public SecurityConnectorApplications securityConnectorApplications() { + if (this.securityConnectorApplications == null) { + this.securityConnectorApplications + = new SecurityConnectorApplicationsImpl(clientObject.getSecurityConnectorApplications(), this); } - return discoveredSecuritySolutions; + return securityConnectorApplications; } /** - * Gets the resource collection API of SecuritySolutionsReferenceDatas. - * - * @return Resource collection API of SecuritySolutionsReferenceDatas. + * Gets the resource collection API of SecurityConnectorApplicationOperations. + * + * @return Resource collection API of SecurityConnectorApplicationOperations. */ - public SecuritySolutionsReferenceDatas securitySolutionsReferenceDatas() { - if (this.securitySolutionsReferenceDatas == null) { - this.securitySolutionsReferenceDatas = - new SecuritySolutionsReferenceDatasImpl(clientObject.getSecuritySolutionsReferenceDatas(), this); + public SecurityConnectorApplicationOperations securityConnectorApplicationOperations() { + if (this.securityConnectorApplicationOperations == null) { + this.securityConnectorApplicationOperations = new SecurityConnectorApplicationOperationsImpl( + clientObject.getSecurityConnectorApplicationOperations(), this); } - return securitySolutionsReferenceDatas; + return securityConnectorApplicationOperations; } /** - * Gets the resource collection API of ExternalSecuritySolutions. - * - * @return Resource collection API of ExternalSecuritySolutions. + * Gets the resource collection API of DefenderForStorages. It manages DefenderForStorageSetting. + * + * @return Resource collection API of DefenderForStorages. */ - public ExternalSecuritySolutions externalSecuritySolutions() { - if (this.externalSecuritySolutions == null) { - this.externalSecuritySolutions = - new ExternalSecuritySolutionsImpl(clientObject.getExternalSecuritySolutions(), this); + public DefenderForStorages defenderForStorages() { + if (this.defenderForStorages == null) { + this.defenderForStorages = new DefenderForStoragesImpl(clientObject.getDefenderForStorages(), this); } - return externalSecuritySolutions; + return defenderForStorages; } /** - * Gets the resource collection API of SecureScores. - * - * @return Resource collection API of SecureScores. + * Gets the resource collection API of SecurityOperators. + * + * @return Resource collection API of SecurityOperators. */ - public SecureScores secureScores() { - if (this.secureScores == null) { - this.secureScores = new SecureScoresImpl(clientObject.getSecureScores(), this); + public SecurityOperators securityOperators() { + if (this.securityOperators == null) { + this.securityOperators = new SecurityOperatorsImpl(clientObject.getSecurityOperators(), this); } - return secureScores; + return securityOperators; } /** - * Gets the resource collection API of SecureScoreControls. - * - * @return Resource collection API of SecureScoreControls. + * Gets the resource collection API of SqlVulnerabilityAssessmentBaselineRules. It manages RuleResults. + * + * @return Resource collection API of SqlVulnerabilityAssessmentBaselineRules. */ - public SecureScoreControls secureScoreControls() { - if (this.secureScoreControls == null) { - this.secureScoreControls = new SecureScoreControlsImpl(clientObject.getSecureScoreControls(), this); + public SqlVulnerabilityAssessmentBaselineRules sqlVulnerabilityAssessmentBaselineRules() { + if (this.sqlVulnerabilityAssessmentBaselineRules == null) { + this.sqlVulnerabilityAssessmentBaselineRules = new SqlVulnerabilityAssessmentBaselineRulesImpl( + clientObject.getSqlVulnerabilityAssessmentBaselineRules(), this); } - return secureScoreControls; + return sqlVulnerabilityAssessmentBaselineRules; } /** - * Gets the resource collection API of SecureScoreControlDefinitions. - * - * @return Resource collection API of SecureScoreControlDefinitions. + * Gets the resource collection API of SqlVulnerabilityAssessmentScans. + * + * @return Resource collection API of SqlVulnerabilityAssessmentScans. */ - public SecureScoreControlDefinitions secureScoreControlDefinitions() { - if (this.secureScoreControlDefinitions == null) { - this.secureScoreControlDefinitions = - new SecureScoreControlDefinitionsImpl(clientObject.getSecureScoreControlDefinitions(), this); + public SqlVulnerabilityAssessmentScans sqlVulnerabilityAssessmentScans() { + if (this.sqlVulnerabilityAssessmentScans == null) { + this.sqlVulnerabilityAssessmentScans + = new SqlVulnerabilityAssessmentScansImpl(clientObject.getSqlVulnerabilityAssessmentScans(), this); } - return secureScoreControlDefinitions; + return sqlVulnerabilityAssessmentScans; } /** - * Gets the resource collection API of SecuritySolutions. - * - * @return Resource collection API of SecuritySolutions. + * Gets the resource collection API of SqlVulnerabilityAssessmentScanResults. + * + * @return Resource collection API of SqlVulnerabilityAssessmentScanResults. */ - public SecuritySolutions securitySolutions() { - if (this.securitySolutions == null) { - this.securitySolutions = new SecuritySolutionsImpl(clientObject.getSecuritySolutions(), this); + public SqlVulnerabilityAssessmentScanResults sqlVulnerabilityAssessmentScanResults() { + if (this.sqlVulnerabilityAssessmentScanResults == null) { + this.sqlVulnerabilityAssessmentScanResults = new SqlVulnerabilityAssessmentScanResultsImpl( + clientObject.getSqlVulnerabilityAssessmentScanResults(), this); } - return securitySolutions; + return sqlVulnerabilityAssessmentScanResults; } /** - * Gets the resource collection API of Connectors. It manages ConnectorSetting. - * - * @return Resource collection API of Connectors. + * Gets the resource collection API of ResourceProviders. + * + * @return Resource collection API of ResourceProviders. */ - public Connectors connectors() { - if (this.connectors == null) { - this.connectors = new ConnectorsImpl(clientObject.getConnectors(), this); + public ResourceProviders resourceProviders() { + if (this.resourceProviders == null) { + this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); } - return connectors; + return resourceProviders; } /** - * Gets the resource collection API of Alerts. - * - * @return Resource collection API of Alerts. + * Gets the resource collection API of SensitivitySettings. + * + * @return Resource collection API of SensitivitySettings. */ - public Alerts alerts() { - if (this.alerts == null) { - this.alerts = new AlertsImpl(clientObject.getAlerts(), this); + public SensitivitySettings sensitivitySettings() { + if (this.sensitivitySettings == null) { + this.sensitivitySettings = new SensitivitySettingsImpl(clientObject.getSensitivitySettings(), this); } - return alerts; + return sensitivitySettings; } /** - * Gets the resource collection API of Settings. - * - * @return Resource collection API of Settings. + * Gets the resource collection API of HealthReports. + * + * @return Resource collection API of HealthReports. */ - public Settings settings() { - if (this.settings == null) { - this.settings = new SettingsImpl(clientObject.getSettings(), this); + public HealthReports healthReports() { + if (this.healthReports == null) { + this.healthReports = new HealthReportsImpl(clientObject.getHealthReports(), this); } - return settings; + return healthReports; } /** - * Gets the resource collection API of IngestionSettings. It manages IngestionSetting. - * - * @return Resource collection API of IngestionSettings. + * Gets the resource collection API of AzureDevOpsOrgs. It manages AzureDevOpsOrg. + * + * @return Resource collection API of AzureDevOpsOrgs. */ - public IngestionSettings ingestionSettings() { - if (this.ingestionSettings == null) { - this.ingestionSettings = new IngestionSettingsImpl(clientObject.getIngestionSettings(), this); + public AzureDevOpsOrgs azureDevOpsOrgs() { + if (this.azureDevOpsOrgs == null) { + this.azureDevOpsOrgs = new AzureDevOpsOrgsImpl(clientObject.getAzureDevOpsOrgs(), this); } - return ingestionSettings; + return azureDevOpsOrgs; } /** - * Gets the resource collection API of SoftwareInventories. - * - * @return Resource collection API of SoftwareInventories. + * Gets the resource collection API of AzureDevOpsProjects. It manages AzureDevOpsProject. + * + * @return Resource collection API of AzureDevOpsProjects. */ - public SoftwareInventories softwareInventories() { - if (this.softwareInventories == null) { - this.softwareInventories = new SoftwareInventoriesImpl(clientObject.getSoftwareInventories(), this); + public AzureDevOpsProjects azureDevOpsProjects() { + if (this.azureDevOpsProjects == null) { + this.azureDevOpsProjects = new AzureDevOpsProjectsImpl(clientObject.getAzureDevOpsProjects(), this); } - return softwareInventories; + return azureDevOpsProjects; } /** - * Gets the resource collection API of GovernanceRules. It manages GovernanceRule. - * - * @return Resource collection API of GovernanceRules. + * Gets the resource collection API of AzureDevOpsRepos. It manages AzureDevOpsRepository. + * + * @return Resource collection API of AzureDevOpsRepos. */ - public GovernanceRules governanceRules() { - if (this.governanceRules == null) { - this.governanceRules = new GovernanceRulesImpl(clientObject.getGovernanceRules(), this); + public AzureDevOpsRepos azureDevOpsRepos() { + if (this.azureDevOpsRepos == null) { + this.azureDevOpsRepos = new AzureDevOpsReposImpl(clientObject.getAzureDevOpsRepos(), this); } - return governanceRules; + return azureDevOpsRepos; } /** - * Gets the resource collection API of GovernanceAssignments. It manages GovernanceAssignment. - * - * @return Resource collection API of GovernanceAssignments. + * Gets the resource collection API of DevOpsConfigurations. + * + * @return Resource collection API of DevOpsConfigurations. */ - public GovernanceAssignments governanceAssignments() { - if (this.governanceAssignments == null) { - this.governanceAssignments = new GovernanceAssignmentsImpl(clientObject.getGovernanceAssignments(), this); + public DevOpsConfigurations devOpsConfigurations() { + if (this.devOpsConfigurations == null) { + this.devOpsConfigurations = new DevOpsConfigurationsImpl(clientObject.getDevOpsConfigurations(), this); } - return governanceAssignments; + return devOpsConfigurations; } /** - * Gets the resource collection API of Applications. - * - * @return Resource collection API of Applications. + * Gets the resource collection API of GitHubOwners. + * + * @return Resource collection API of GitHubOwners. */ - public Applications applications() { - if (this.applications == null) { - this.applications = new ApplicationsImpl(clientObject.getApplications(), this); + public GitHubOwners gitHubOwners() { + if (this.gitHubOwners == null) { + this.gitHubOwners = new GitHubOwnersImpl(clientObject.getGitHubOwners(), this); } - return applications; + return gitHubOwners; } /** - * Gets the resource collection API of ApplicationOperations. It manages Application. - * - * @return Resource collection API of ApplicationOperations. + * Gets the resource collection API of GitHubRepos. + * + * @return Resource collection API of GitHubRepos. */ - public ApplicationOperations applicationOperations() { - if (this.applicationOperations == null) { - this.applicationOperations = new ApplicationOperationsImpl(clientObject.getApplicationOperations(), this); + public GitHubRepos gitHubRepos() { + if (this.gitHubRepos == null) { + this.gitHubRepos = new GitHubReposImpl(clientObject.getGitHubRepos(), this); } - return applicationOperations; + return gitHubRepos; } /** - * Gets the resource collection API of SecurityConnectorApplications. - * - * @return Resource collection API of SecurityConnectorApplications. + * Gets the resource collection API of GitLabGroups. + * + * @return Resource collection API of GitLabGroups. */ - public SecurityConnectorApplications securityConnectorApplications() { - if (this.securityConnectorApplications == null) { - this.securityConnectorApplications = - new SecurityConnectorApplicationsImpl(clientObject.getSecurityConnectorApplications(), this); + public GitLabGroups gitLabGroups() { + if (this.gitLabGroups == null) { + this.gitLabGroups = new GitLabGroupsImpl(clientObject.getGitLabGroups(), this); } - return securityConnectorApplications; + return gitLabGroups; } /** - * Gets the resource collection API of SecurityConnectorApplicationOperations. - * - * @return Resource collection API of SecurityConnectorApplicationOperations. + * Gets the resource collection API of GitLabSubgroups. + * + * @return Resource collection API of GitLabSubgroups. */ - public SecurityConnectorApplicationOperations securityConnectorApplicationOperations() { - if (this.securityConnectorApplicationOperations == null) { - this.securityConnectorApplicationOperations = - new SecurityConnectorApplicationOperationsImpl( - clientObject.getSecurityConnectorApplicationOperations(), this); + public GitLabSubgroups gitLabSubgroups() { + if (this.gitLabSubgroups == null) { + this.gitLabSubgroups = new GitLabSubgroupsImpl(clientObject.getGitLabSubgroups(), this); } - return securityConnectorApplicationOperations; + return gitLabSubgroups; } /** - * Gets the resource collection API of ApiCollections. - * - * @return Resource collection API of ApiCollections. + * Gets the resource collection API of GitLabProjects. + * + * @return Resource collection API of GitLabProjects. */ - public ApiCollections apiCollections() { - if (this.apiCollections == null) { - this.apiCollections = new ApiCollectionsImpl(clientObject.getApiCollections(), this); + public GitLabProjects gitLabProjects() { + if (this.gitLabProjects == null) { + this.gitLabProjects = new GitLabProjectsImpl(clientObject.getGitLabProjects(), this); } - return apiCollections; + return gitLabProjects; } /** - * Gets the resource collection API of ApiCollectionOnboardings. - * - * @return Resource collection API of ApiCollectionOnboardings. + * Gets the resource collection API of DevOpsOperationResults. + * + * @return Resource collection API of DevOpsOperationResults. */ - public ApiCollectionOnboardings apiCollectionOnboardings() { - if (this.apiCollectionOnboardings == null) { - this.apiCollectionOnboardings = - new ApiCollectionOnboardingsImpl(clientObject.getApiCollectionOnboardings(), this); + public DevOpsOperationResults devOpsOperationResults() { + if (this.devOpsOperationResults == null) { + this.devOpsOperationResults + = new DevOpsOperationResultsImpl(clientObject.getDevOpsOperationResults(), this); } - return apiCollectionOnboardings; + return devOpsOperationResults; } /** - * Gets the resource collection API of ApiCollectionOffboardings. - * - * @return Resource collection API of ApiCollectionOffboardings. + * Gets the resource collection API of SecurityConnectors. It manages SecurityConnector. + * + * @return Resource collection API of SecurityConnectors. */ - public ApiCollectionOffboardings apiCollectionOffboardings() { - if (this.apiCollectionOffboardings == null) { - this.apiCollectionOffboardings = - new ApiCollectionOffboardingsImpl(clientObject.getApiCollectionOffboardings(), this); + public SecurityConnectors securityConnectors() { + if (this.securityConnectors == null) { + this.securityConnectors = new SecurityConnectorsImpl(clientObject.getSecurityConnectors(), this); } - return apiCollectionOffboardings; + return securityConnectors; } /** - * Gets the resource collection API of HealthReports. - * - * @return Resource collection API of HealthReports. + * Gets the resource collection API of ComplianceResults. + * + * @return Resource collection API of ComplianceResults. */ - public HealthReports healthReports() { - if (this.healthReports == null) { - this.healthReports = new HealthReportsImpl(clientObject.getHealthReports(), this); + public ComplianceResults complianceResults() { + if (this.complianceResults == null) { + this.complianceResults = new ComplianceResultsImpl(clientObject.getComplianceResults(), this); } - return healthReports; + return complianceResults; } /** - * Gets the resource collection API of HealthReportOperations. - * - * @return Resource collection API of HealthReportOperations. + * Gets the resource collection API of AdvancedThreatProtections. It manages AdvancedThreatProtectionSetting. + * + * @return Resource collection API of AdvancedThreatProtections. */ - public HealthReportOperations healthReportOperations() { - if (this.healthReportOperations == null) { - this.healthReportOperations = - new HealthReportOperationsImpl(clientObject.getHealthReportOperations(), this); + public AdvancedThreatProtections advancedThreatProtections() { + if (this.advancedThreatProtections == null) { + this.advancedThreatProtections + = new AdvancedThreatProtectionsImpl(clientObject.getAdvancedThreatProtections(), this); } - return healthReportOperations; + return advancedThreatProtections; } /** - * Gets the resource collection API of SqlVulnerabilityAssessmentScans. - * - * @return Resource collection API of SqlVulnerabilityAssessmentScans. + * Gets the resource collection API of DeviceSecurityGroups. It manages DeviceSecurityGroup. + * + * @return Resource collection API of DeviceSecurityGroups. */ - public SqlVulnerabilityAssessmentScans sqlVulnerabilityAssessmentScans() { - if (this.sqlVulnerabilityAssessmentScans == null) { - this.sqlVulnerabilityAssessmentScans = - new SqlVulnerabilityAssessmentScansImpl(clientObject.getSqlVulnerabilityAssessmentScans(), this); + public DeviceSecurityGroups deviceSecurityGroups() { + if (this.deviceSecurityGroups == null) { + this.deviceSecurityGroups = new DeviceSecurityGroupsImpl(clientObject.getDeviceSecurityGroups(), this); } - return sqlVulnerabilityAssessmentScans; + return deviceSecurityGroups; } /** - * Gets the resource collection API of SqlVulnerabilityAssessmentScanResults. - * - * @return Resource collection API of SqlVulnerabilityAssessmentScanResults. + * Gets the resource collection API of IotSecuritySolutionAnalytics. + * + * @return Resource collection API of IotSecuritySolutionAnalytics. */ - public SqlVulnerabilityAssessmentScanResults sqlVulnerabilityAssessmentScanResults() { - if (this.sqlVulnerabilityAssessmentScanResults == null) { - this.sqlVulnerabilityAssessmentScanResults = - new SqlVulnerabilityAssessmentScanResultsImpl( - clientObject.getSqlVulnerabilityAssessmentScanResults(), this); + public IotSecuritySolutionAnalytics iotSecuritySolutionAnalytics() { + if (this.iotSecuritySolutionAnalytics == null) { + this.iotSecuritySolutionAnalytics + = new IotSecuritySolutionAnalyticsImpl(clientObject.getIotSecuritySolutionAnalytics(), this); } - return sqlVulnerabilityAssessmentScanResults; + return iotSecuritySolutionAnalytics; } /** - * Gets the resource collection API of SqlVulnerabilityAssessmentBaselineRules. It manages RuleResults. - * - * @return Resource collection API of SqlVulnerabilityAssessmentBaselineRules. + * Gets the resource collection API of IotSecuritySolutionsAnalyticsAggregatedAlerts. + * + * @return Resource collection API of IotSecuritySolutionsAnalyticsAggregatedAlerts. */ - public SqlVulnerabilityAssessmentBaselineRules sqlVulnerabilityAssessmentBaselineRules() { - if (this.sqlVulnerabilityAssessmentBaselineRules == null) { - this.sqlVulnerabilityAssessmentBaselineRules = - new SqlVulnerabilityAssessmentBaselineRulesImpl( - clientObject.getSqlVulnerabilityAssessmentBaselineRules(), this); + public IotSecuritySolutionsAnalyticsAggregatedAlerts iotSecuritySolutionsAnalyticsAggregatedAlerts() { + if (this.iotSecuritySolutionsAnalyticsAggregatedAlerts == null) { + this.iotSecuritySolutionsAnalyticsAggregatedAlerts = new IotSecuritySolutionsAnalyticsAggregatedAlertsImpl( + clientObject.getIotSecuritySolutionsAnalyticsAggregatedAlerts(), this); } - return sqlVulnerabilityAssessmentBaselineRules; + return iotSecuritySolutionsAnalyticsAggregatedAlerts; } /** - * Gets the resource collection API of SecurityConnectors. It manages SecurityConnector. - * - * @return Resource collection API of SecurityConnectors. + * Gets the resource collection API of IotSecuritySolutionsAnalyticsRecommendations. + * + * @return Resource collection API of IotSecuritySolutionsAnalyticsRecommendations. */ - public SecurityConnectors securityConnectors() { - if (this.securityConnectors == null) { - this.securityConnectors = new SecurityConnectorsImpl(clientObject.getSecurityConnectors(), this); + public IotSecuritySolutionsAnalyticsRecommendations iotSecuritySolutionsAnalyticsRecommendations() { + if (this.iotSecuritySolutionsAnalyticsRecommendations == null) { + this.iotSecuritySolutionsAnalyticsRecommendations = new IotSecuritySolutionsAnalyticsRecommendationsImpl( + clientObject.getIotSecuritySolutionsAnalyticsRecommendations(), this); } - return securityConnectors; + return iotSecuritySolutionsAnalyticsRecommendations; } /** - * Gets the resource collection API of SecurityOperators. - * - * @return Resource collection API of SecurityOperators. + * Gets the resource collection API of IotSecuritySolutions. It manages IoTSecuritySolutionModel. + * + * @return Resource collection API of IotSecuritySolutions. */ - public SecurityOperators securityOperators() { - if (this.securityOperators == null) { - this.securityOperators = new SecurityOperatorsImpl(clientObject.getSecurityOperators(), this); + public IotSecuritySolutions iotSecuritySolutions() { + if (this.iotSecuritySolutions == null) { + this.iotSecuritySolutions = new IotSecuritySolutionsImpl(clientObject.getIotSecuritySolutions(), this); } - return securityOperators; + return iotSecuritySolutions; + } + + /** + * Gets the resource collection API of AdaptiveNetworkHardenings. + * + * @return Resource collection API of AdaptiveNetworkHardenings. + */ + public AdaptiveNetworkHardenings adaptiveNetworkHardenings() { + if (this.adaptiveNetworkHardenings == null) { + this.adaptiveNetworkHardenings + = new AdaptiveNetworkHardeningsImpl(clientObject.getAdaptiveNetworkHardenings(), this); + } + return adaptiveNetworkHardenings; + } + + /** + * 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 AdaptiveApplicationControls. It manages AdaptiveApplicationControlGroup. + * + * @return Resource collection API of AdaptiveApplicationControls. + */ + public AdaptiveApplicationControls adaptiveApplicationControls() { + if (this.adaptiveApplicationControls == null) { + this.adaptiveApplicationControls + = new AdaptiveApplicationControlsImpl(clientObject.getAdaptiveApplicationControls(), this); + } + return adaptiveApplicationControls; + } + + /** + * 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 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 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 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 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 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 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 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 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 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 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 Pricings. + * + * @return Resource collection API of Pricings. + */ + public Pricings pricings() { + if (this.pricings == null) { + this.pricings = new PricingsImpl(clientObject.getPricings(), this); + } + return pricings; } /** - * @return Wrapped service client SecurityCenter providing direct access to the underlying auto-generated API - * implementation, based on Azure REST API. + * 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/AdaptiveApplicationControlsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AdaptiveApplicationControlsClient.java index 26e579af6d381..413920bdc12c1 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AdaptiveApplicationControlsClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AdaptiveApplicationControlsClient.java @@ -11,11 +11,13 @@ import com.azure.resourcemanager.security.fluent.models.AdaptiveApplicationControlGroupInner; import com.azure.resourcemanager.security.fluent.models.AdaptiveApplicationControlGroupsInner; -/** An instance of this class provides access to all the operations defined in AdaptiveApplicationControlsClient. */ +/** + * An instance of this class provides access to all the operations defined in AdaptiveApplicationControlsClient. + */ public interface AdaptiveApplicationControlsClient { /** * Gets a list of application control machine groups for the subscription. - * + * * @param includePathRecommendations Include the policy rules. * @param summary Return output in a summarized form. * @param context The context to associate with this operation. @@ -25,12 +27,12 @@ public interface AdaptiveApplicationControlsClient { * @return a list of application control machine groups for the subscription along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse( - Boolean includePathRecommendations, Boolean summary, Context context); + Response listWithResponse(Boolean includePathRecommendations, + Boolean summary, Context context); /** * Gets a list of application control machine groups 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 application control machine groups for the subscription. @@ -40,9 +42,9 @@ Response listWithResponse( /** * Gets an application control VM/server group. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param groupName Name of an application control machine group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -51,14 +53,14 @@ Response listWithResponse( * @return an application control VM/server group along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String ascLocation, String groupName, Context context); + Response getWithResponse(String ascLocation, String groupName, + Context context); /** * Gets an application control VM/server group. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param groupName Name of an application control machine group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -70,9 +72,9 @@ Response getWithResponse( /** * Update an application control machine group. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param groupName Name of an application control machine group. * @param body The body parameter. * @param context The context to associate with this operation. @@ -82,14 +84,14 @@ Response getWithResponse( * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response putWithResponse( - String ascLocation, String groupName, AdaptiveApplicationControlGroupInner body, Context context); + Response putWithResponse(String ascLocation, String groupName, + AdaptiveApplicationControlGroupInner body, Context context); /** * Update an application control machine group. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param groupName Name of an application control machine group. * @param body The body parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -98,14 +100,14 @@ Response putWithResponse( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - AdaptiveApplicationControlGroupInner put( - String ascLocation, String groupName, AdaptiveApplicationControlGroupInner body); + AdaptiveApplicationControlGroupInner put(String ascLocation, String groupName, + AdaptiveApplicationControlGroupInner body); /** * Delete an application control machine group. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param groupName Name of an application control machine group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -118,9 +120,9 @@ AdaptiveApplicationControlGroupInner put( /** * Delete an application control machine group. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param groupName Name of an application control machine group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AdaptiveNetworkHardeningsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AdaptiveNetworkHardeningsClient.java index 9a39539b447e7..a9d60aff4c1cc 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AdaptiveNetworkHardeningsClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AdaptiveNetworkHardeningsClient.java @@ -14,13 +14,15 @@ import com.azure.resourcemanager.security.fluent.models.AdaptiveNetworkHardeningInner; import com.azure.resourcemanager.security.models.AdaptiveNetworkHardeningEnforceRequest; -/** An instance of this class provides access to all the operations defined in AdaptiveNetworkHardeningsClient. */ +/** + * An instance of this class provides access to all the operations defined in AdaptiveNetworkHardeningsClient. + */ public interface AdaptiveNetworkHardeningsClient { /** * Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -28,17 +30,17 @@ public interface AdaptiveNetworkHardeningsClient { * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of Adaptive Network Hardenings resources in scope of an extended resource as paginated response - * with {@link PagedIterable}. + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName); + PagedIterable listByExtendedResource(String resourceGroupName, + String resourceNamespace, String resourceType, String resourceName); /** * Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -47,17 +49,17 @@ PagedIterable listByExtendedResource( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of Adaptive Network Hardenings resources in scope of an extended resource as paginated response - * with {@link PagedIterable}. + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context); + PagedIterable listByExtendedResource(String resourceGroupName, + String resourceNamespace, String resourceType, String resourceName, Context context); /** * Gets a single Adaptive Network Hardening resource. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -69,19 +71,14 @@ PagedIterable listByExtendedResource( * @return a single Adaptive Network Hardening resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - Context context); + Response getWithResponse(String resourceGroupName, String resourceNamespace, + String resourceType, String resourceName, String adaptiveNetworkHardeningResourceName, Context context); /** * Gets a single Adaptive Network Hardening resource. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -92,18 +89,14 @@ Response getWithResponse( * @return a single Adaptive Network Hardening resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - AdaptiveNetworkHardeningInner get( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName); + AdaptiveNetworkHardeningInner get(String resourceGroupName, String resourceNamespace, String resourceType, + String resourceName, String adaptiveNetworkHardeningResourceName); /** * Enforces the given rules on the NSG(s) listed in the request. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -115,19 +108,15 @@ AdaptiveNetworkHardeningInner get( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginEnforce( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, + SyncPoller, Void> beginEnforce(String resourceGroupName, String resourceNamespace, + String resourceType, String resourceName, String adaptiveNetworkHardeningResourceName, AdaptiveNetworkHardeningEnforceRequest body); /** * Enforces the given rules on the NSG(s) listed in the request. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -140,20 +129,15 @@ SyncPoller, Void> beginEnforce( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginEnforce( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body, - Context context); + SyncPoller, Void> beginEnforce(String resourceGroupName, String resourceNamespace, + String resourceType, String resourceName, String adaptiveNetworkHardeningResourceName, + AdaptiveNetworkHardeningEnforceRequest body, Context context); /** * Enforces the given rules on the NSG(s) listed in the request. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -164,19 +148,14 @@ SyncPoller, Void> beginEnforce( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void enforce( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body); + void enforce(String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, + String adaptiveNetworkHardeningResourceName, AdaptiveNetworkHardeningEnforceRequest body); /** * Enforces the given rules on the NSG(s) listed in the request. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -188,12 +167,6 @@ void enforce( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void enforce( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body, - Context context); + void enforce(String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, + String adaptiveNetworkHardeningResourceName, AdaptiveNetworkHardeningEnforceRequest body, Context context); } 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 index df0146bcab8f7..923759f73f94d 100644 --- 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 @@ -10,11 +10,13 @@ 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. */ +/** + * 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 identifier of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -27,7 +29,7 @@ public interface AdvancedThreatProtectionsClient { /** * Gets the Advanced Threat Protection settings for the specified resource. - * + * * @param resourceId The 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. @@ -39,7 +41,7 @@ public interface AdvancedThreatProtectionsClient { /** * Creates or updates the Advanced Threat Protection settings on a specified resource. - * + * * @param resourceId The identifier of the resource. * @param advancedThreatProtectionSetting Advanced Threat Protection Settings. * @param context The context to associate with this operation. @@ -49,12 +51,12 @@ public interface AdvancedThreatProtectionsClient { * @return the Advanced Threat Protection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceId, AdvancedThreatProtectionSettingInner advancedThreatProtectionSetting, Context context); + Response createWithResponse(String resourceId, + AdvancedThreatProtectionSettingInner advancedThreatProtectionSetting, Context context); /** * Creates or updates the Advanced Threat Protection settings on a specified resource. - * + * * @param resourceId The identifier of the resource. * @param advancedThreatProtectionSetting Advanced Threat Protection Settings. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -63,6 +65,6 @@ Response createWithResponse( * @return the Advanced Threat Protection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - AdvancedThreatProtectionSettingInner create( - String resourceId, AdvancedThreatProtectionSettingInner advancedThreatProtectionSetting); + 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 index 6a8b01d63a827..198c8dcd1e902 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AlertsClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AlertsClient.java @@ -14,11 +14,13 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in AlertsClient. + */ public interface AlertsClient { /** * 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}. @@ -28,7 +30,7 @@ public interface AlertsClient { /** * 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. @@ -40,9 +42,9 @@ public interface AlertsClient { /** * List all the alerts that are associated with the resource group. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -53,9 +55,9 @@ public interface AlertsClient { /** * List all the alerts that are associated with the resource group. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -67,9 +69,9 @@ public interface AlertsClient { /** * 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. + * 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. @@ -80,9 +82,9 @@ public interface AlertsClient { /** * 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. + * 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. @@ -94,11 +96,11 @@ public interface AlertsClient { /** * 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. + * locations. * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -109,11 +111,11 @@ public interface AlertsClient { /** * 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. + * locations. * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -121,14 +123,14 @@ public interface AlertsClient { * @return list of security alerts as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listResourceGroupLevelByRegion( - String ascLocation, String resourceGroupName, Context context); + PagedIterable listResourceGroupLevelByRegion(String ascLocation, String resourceGroupName, + 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. + * 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. @@ -141,9 +143,9 @@ PagedIterable listResourceGroupLevelByRegion( /** * 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. + * 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. @@ -155,30 +157,30 @@ PagedIterable listResourceGroupLevelByRegion( /** * Get an alert that is associated a resource group or a resource in a resource group. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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}. + * @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); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -190,9 +192,9 @@ Response getResourceGroupLevelWithResponse( /** * Update the alert's state. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -201,14 +203,14 @@ Response getResourceGroupLevelWithResponse( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateSubscriptionLevelStateToDismissWithResponse( - String ascLocation, String alertName, Context context); + 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. + * 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. @@ -219,9 +221,9 @@ Response updateSubscriptionLevelStateToDismissWithResponse( /** * Update the alert's state. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -230,14 +232,14 @@ Response updateSubscriptionLevelStateToDismissWithResponse( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateSubscriptionLevelStateToResolveWithResponse( - String ascLocation, String alertName, Context context); + 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. + * 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. @@ -248,9 +250,9 @@ Response updateSubscriptionLevelStateToResolveWithResponse( /** * Update the alert's state. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -259,14 +261,14 @@ Response updateSubscriptionLevelStateToResolveWithResponse( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateSubscriptionLevelStateToActivateWithResponse( - String ascLocation, String alertName, Context context); + 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. + * 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. @@ -277,9 +279,9 @@ Response updateSubscriptionLevelStateToActivateWithResponse( /** * Update the alert's state. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -288,14 +290,14 @@ Response updateSubscriptionLevelStateToActivateWithResponse( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateSubscriptionLevelStateToInProgressWithResponse( - String ascLocation, String alertName, Context context); + 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. + * 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. @@ -306,11 +308,11 @@ Response updateSubscriptionLevelStateToInProgressWithResponse( /** * Update the alert's state. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -319,16 +321,16 @@ Response updateSubscriptionLevelStateToInProgressWithResponse( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateResourceGroupLevelStateToResolveWithResponse( - String resourceGroupName, String ascLocation, String alertName, Context context); + Response updateResourceGroupLevelStateToResolveWithResponse(String resourceGroupName, String ascLocation, + String alertName, Context context); /** * Update the alert's state. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -339,11 +341,11 @@ Response updateResourceGroupLevelStateToResolveWithResponse( /** * Update the alert's state. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -352,16 +354,16 @@ Response updateResourceGroupLevelStateToResolveWithResponse( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateResourceGroupLevelStateToDismissWithResponse( - String resourceGroupName, String ascLocation, String alertName, Context context); + Response updateResourceGroupLevelStateToDismissWithResponse(String resourceGroupName, String ascLocation, + String alertName, Context context); /** * Update the alert's state. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -372,11 +374,11 @@ Response updateResourceGroupLevelStateToDismissWithResponse( /** * Update the alert's state. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -385,16 +387,16 @@ Response updateResourceGroupLevelStateToDismissWithResponse( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateResourceGroupLevelStateToActivateWithResponse( - String resourceGroupName, String ascLocation, String alertName, Context context); + Response updateResourceGroupLevelStateToActivateWithResponse(String resourceGroupName, String ascLocation, + String alertName, Context context); /** * Update the alert's state. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -405,11 +407,11 @@ Response updateResourceGroupLevelStateToActivateWithResponse( /** * Update the alert's state. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -418,16 +420,16 @@ Response updateResourceGroupLevelStateToActivateWithResponse( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateResourceGroupLevelStateToInProgressWithResponse( - String resourceGroupName, String ascLocation, String alertName, Context context); + Response updateResourceGroupLevelStateToInProgressWithResponse(String resourceGroupName, String ascLocation, + String alertName, Context context); /** * Update the alert's state. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -438,9 +440,9 @@ Response updateResourceGroupLevelStateToInProgressWithResponse( /** * Simulate security alerts. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param alertSimulatorRequestBody Alert Simulator Request Properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -448,14 +450,14 @@ Response updateResourceGroupLevelStateToInProgressWithResponse( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginSimulate( - String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody); + 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. + * locations. * @param alertSimulatorRequestBody Alert Simulator Request Properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -464,14 +466,14 @@ SyncPoller, Void> beginSimulate( * @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); + 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. + * locations. * @param alertSimulatorRequestBody Alert Simulator Request Properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -482,9 +484,9 @@ SyncPoller, Void> beginSimulate( /** * Simulate security alerts. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param alertSimulatorRequestBody Alert Simulator Request Properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. 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 index 64f7db01f3cee..4536de8753de4 100644 --- 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 @@ -11,11 +11,13 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in AlertsSuppressionRulesClient. + */ public interface AlertsSuppressionRulesClient { /** * 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}. @@ -25,7 +27,7 @@ public interface AlertsSuppressionRulesClient { /** * 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. @@ -38,21 +40,21 @@ 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}. + * @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. @@ -64,7 +66,7 @@ public interface AlertsSuppressionRulesClient { /** * 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. @@ -74,12 +76,12 @@ public interface AlertsSuppressionRulesClient { * @return describes the suppression rule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String alertsSuppressionRuleName, AlertsSuppressionRuleInner alertsSuppressionRule, Context context); + 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. @@ -88,12 +90,12 @@ Response updateWithResponse( * @return describes the suppression rule. */ @ServiceMethod(returns = ReturnType.SINGLE) - AlertsSuppressionRuleInner update( - String alertsSuppressionRuleName, AlertsSuppressionRuleInner alertsSuppressionRule); + 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. @@ -106,7 +108,7 @@ AlertsSuppressionRuleInner update( /** * 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. 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 index 021776947464f..2f0fa1c92398f 100644 --- 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 @@ -12,57 +12,59 @@ 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. */ +/** + * 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. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if 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}. + * @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}. + * @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); /** * 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. + * 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}. + * 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. + * 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}. + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByHomeRegion(String ascLocation, Context context); @@ -70,37 +72,37 @@ 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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}. + * type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String ascLocation, ConnectionType connectionType, Context context); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. + * type. */ @ServiceMethod(returns = ReturnType.SINGLE) AllowedConnectionsResourceInner get(String resourceGroupName, String ascLocation, ConnectionType connectionType); diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApiCollectionOffboardingsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApiCollectionOffboardingsClient.java deleted file mode 100644 index 01617030ae54e..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApiCollectionOffboardingsClient.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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; - -/** An instance of this class provides access to all the operations defined in ApiCollectionOffboardingsClient. */ -public interface ApiCollectionOffboardingsClient { - /** - * Offboard an Azure API Management API from Defender for APIs - * - *

Offboard an Azure API Management API from 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 apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API 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 serviceName, String apiCollectionId, Context context); - - /** - * Offboard an Azure API Management API from Defender for APIs - * - *

Offboard an Azure API Management API from 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 apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API 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 serviceName, String apiCollectionId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApiCollectionOnboardingsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApiCollectionOnboardingsClient.java deleted file mode 100644 index 2dd341d3c7e1f..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApiCollectionOnboardingsClient.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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.ApiCollectionResponseInner; - -/** An instance of this class provides access to all the operations defined in ApiCollectionOnboardingsClient. */ -public interface ApiCollectionOnboardingsClient { - /** - * Onboard an Azure API Management API to Defender for APIs - * - *

Onboard an Azure API Management API to 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 apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API 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 an API collection as represented by Defender for APIs along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, String serviceName, String apiCollectionId, Context context); - - /** - * Onboard an Azure API Management API to Defender for APIs - * - *

Onboard an Azure API Management API to 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 apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API 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 an API collection as represented by Defender for APIs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApiCollectionResponseInner create(String resourceGroupName, String serviceName, String apiCollectionId); -} 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 index 6eded28ea9734..be7da87c723d1 100644 --- 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 @@ -8,85 +8,268 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.ApiCollectionResponseInner; +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. */ +/** + * An instance of this class provides access to all the operations defined in ApiCollectionsClient. + */ public interface ApiCollectionsClient { /** - * Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs - * - *

Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API - * Management API is onboarded to 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. - * + * 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 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 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 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 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); + + /** + * 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 Azure API Management APIs that have been onboarded to Defender for APIs as paginated response - * with {@link PagedIterable}. + * @return 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 list(String resourceGroupName, String serviceName); + PagedIterable listByAzureApiManagementService(String resourceGroupName, String serviceName); /** - * Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs - * - *

Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API - * Management API is onboarded to 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. - * + * 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 Azure API Management APIs that have been onboarded to Defender for APIs as paginated response - * with {@link PagedIterable}. + * @return 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 list(String resourceGroupName, String serviceName, Context context); + PagedIterable listByAzureApiManagementService(String resourceGroupName, String serviceName, + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 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 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); /** - * Gets an Azure API Management API if it has been onboarded to Defender for APIs - * - *

Gets an Azure API Management API if it has been onboarded to Defender for APIs. If an Azure API Management API - * is onboarded to 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. - * + * 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 apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. + * @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 Azure API Management API if it has been onboarded to Defender for APIs along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String serviceName, String apiCollectionId, Context context); + Response offboardAzureApiManagementApiWithResponse(String resourceGroupName, String serviceName, String apiId, + Context context); /** - * Gets an Azure API Management API if it has been onboarded to Defender for APIs - * - *

Gets an Azure API Management API if it has been onboarded to Defender for APIs. If an Azure API Management API - * is onboarded to 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. - * + * 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 apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. + * @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 Azure API Management API if it has been onboarded to Defender for APIs. */ @ServiceMethod(returns = ReturnType.SINGLE) - ApiCollectionResponseInner get(String resourceGroupName, String serviceName, String apiCollectionId); + void offboardAzureApiManagementApi(String resourceGroupName, String serviceName, String apiId); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApplicationOperationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApplicationOperationsClient.java index 1454ded262341..19482d743f368 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApplicationOperationsClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApplicationOperationsClient.java @@ -10,11 +10,13 @@ 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 ApplicationOperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in ApplicationOperationsClient. + */ public interface ApplicationOperationsClient { /** * 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. @@ -27,7 +29,7 @@ public interface ApplicationOperationsClient { /** * 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. @@ -39,7 +41,7 @@ public interface ApplicationOperationsClient { /** * 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. @@ -49,12 +51,12 @@ public interface ApplicationOperationsClient { * @return security Application over a given scope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String applicationId, ApplicationInner application, Context context); + 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. @@ -67,7 +69,7 @@ Response createOrUpdateWithResponse( /** * 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. @@ -80,7 +82,7 @@ Response createOrUpdateWithResponse( /** * 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. 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 index 1f8851380eb88..a35f403f9bd84 100644 --- 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 @@ -10,28 +10,30 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in ApplicationsClient. + */ public interface ApplicationsClient { /** * 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}. + * @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}. + * @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 index ea903c0cc61a4..5c702d11ef8b2 100644 --- 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 @@ -13,40 +13,42 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in AssessmentsClient. + */ public interface AssessmentsClient { /** * Get security assessments on all your scanned resources inside a scope. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @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 Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @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); /** * Get a security assessment on your scanned resource. - * + * * @param resourceId The identifier of the resource. * @param assessmentName The Assessment Key - Unique key for the assessment type. * @param expand OData expand. Optional. @@ -57,12 +59,12 @@ public interface AssessmentsClient { * @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); + Response getWithResponse(String resourceId, String assessmentName, + ExpandEnum expand, Context context); /** * Get a security assessment on your scanned resource. - * + * * @param resourceId The identifier of the resource. * @param assessmentName The Assessment Key - Unique key for the assessment type. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -76,7 +78,7 @@ Response getWithResponse( /** * 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 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. @@ -87,13 +89,13 @@ Response getWithResponse( * @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); + 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 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. @@ -103,13 +105,13 @@ Response createOrUpdateWithResponse( * @return security assessment on a resource - response format. */ @ServiceMethod(returns = ReturnType.SINGLE) - SecurityAssessmentResponseInner createOrUpdate( - String resourceId, String assessmentName, SecurityAssessment assessment); + 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 identifier of the resource. * @param assessmentName The Assessment Key - Unique key for the assessment type. * @param context The context to associate with this operation. @@ -124,7 +126,7 @@ SecurityAssessmentResponseInner createOrUpdate( /** * 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 identifier of the resource. * @param assessmentName The Assessment Key - Unique key for the assessment type. * @throws IllegalArgumentException thrown if parameters fail the validation. 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 index d2d08e0c5684f..112d254fa3fba 100644 --- 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 @@ -11,11 +11,13 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in AssessmentsMetadatasClient. + */ public interface AssessmentsMetadatasClient { /** * 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}. @@ -25,7 +27,7 @@ public interface AssessmentsMetadatasClient { /** * 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. @@ -37,7 +39,7 @@ public interface AssessmentsMetadatasClient { /** * 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. @@ -50,7 +52,7 @@ public interface AssessmentsMetadatasClient { /** * 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. @@ -62,31 +64,31 @@ public interface AssessmentsMetadatasClient { /** * 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}. + * @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}. + * @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 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. @@ -95,12 +97,12 @@ public interface AssessmentsMetadatasClient { * @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); + 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. @@ -112,7 +114,7 @@ Response getInSubscriptionWithResponse( /** * 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. @@ -122,12 +124,12 @@ Response getInSubscriptionWithResponse( * @return security assessment metadata response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createInSubscriptionWithResponse( - String assessmentMetadataName, SecurityAssessmentMetadataResponseInner assessmentMetadata, Context context); + 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. @@ -136,13 +138,13 @@ Response createInSubscriptionWithRespon * @return security assessment metadata response. */ @ServiceMethod(returns = ReturnType.SINGLE) - SecurityAssessmentMetadataResponseInner createInSubscription( - String assessmentMetadataName, SecurityAssessmentMetadataResponseInner assessmentMetadata); + 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. @@ -156,7 +158,7 @@ SecurityAssessmentMetadataResponseInner createInSubscription( /** * 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. 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 index 7d93098d7d099..385c41b9a00c2 100644 --- 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 @@ -11,11 +11,13 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in AutoProvisioningSettingsClient. + */ public interface AutoProvisioningSettingsClient { /** * 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}. @@ -25,7 +27,7 @@ public interface AutoProvisioningSettingsClient { /** * 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. @@ -37,7 +39,7 @@ 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. @@ -50,7 +52,7 @@ public interface AutoProvisioningSettingsClient { /** * 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. @@ -62,7 +64,7 @@ public interface AutoProvisioningSettingsClient { /** * 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. @@ -72,12 +74,12 @@ public interface AutoProvisioningSettingsClient { * @return auto provisioning setting along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String settingName, AutoProvisioningSettingInner setting, Context context); + 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. 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 index cfbcb6c5613d9..7d18996b5d265 100644 --- 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 @@ -11,13 +11,16 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in AutomationsClient. + */ public interface AutomationsClient { /** * 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}. @@ -28,7 +31,7 @@ public interface AutomationsClient { /** * 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. @@ -41,9 +44,9 @@ public interface AutomationsClient { /** * 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -55,9 +58,9 @@ public interface AutomationsClient { /** * 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -69,9 +72,9 @@ public interface AutomationsClient { /** * Retrieves information about the model of a security automation. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param automationName The security automation name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -80,14 +83,14 @@ public interface AutomationsClient { * @return the security automation resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String automationName, Context context); + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -100,9 +103,9 @@ Response getByResourceGroupWithResponse( /** * 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param automationName The security automation name. * @param automation The security automation resource. * @param context The context to associate with this operation. @@ -112,15 +115,15 @@ Response getByResourceGroupWithResponse( * @return the security automation resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String automationName, AutomationInner automation, Context context); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param automationName The security automation name. * @param automation The security automation resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -131,11 +134,43 @@ Response createOrUpdateWithResponse( @ServiceMethod(returns = ReturnType.SINGLE) AutomationInner createOrUpdate(String resourceGroupName, String automationName, AutomationInner automation); + /** + * Updates a security automation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 within the user's subscription. 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param automationName The security automation name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -148,9 +183,9 @@ Response createOrUpdateWithResponse( /** * Deletes a security automation. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -162,9 +197,9 @@ Response createOrUpdateWithResponse( /** * 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param automationName The security automation name. * @param automation The security automation resource. * @param context The context to associate with this operation. @@ -174,15 +209,15 @@ Response createOrUpdateWithResponse( * @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); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param automationName The security automation name. * @param automation The security automation resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -191,6 +226,6 @@ Response validateWithResponse( * @return the security automation model state property bag. */ @ServiceMethod(returns = ReturnType.SINGLE) - AutomationValidationStatusInner validate( - String resourceGroupName, String automationName, AutomationInner automation); + 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 new file mode 100644 index 0000000000000..566832c05a501 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsOrgsClient.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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 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); + + /** + * 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 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 Azure DevOps organization 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 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 Azure DevOps organization 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 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 Azure DevOps organization name. + * @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 Azure DevOps organization name. + * @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 Azure DevOps organization name. + * @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 Azure DevOps organization name. + * @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 Azure DevOps organization name. + * @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 Azure DevOps organization name. + * @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 Azure DevOps organization name. + * @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 Azure DevOps organization name. + * @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); +} 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 new file mode 100644 index 0000000000000..8f0c62b567356 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsProjectsClient.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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 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 Azure DevOps organization 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, 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 Azure DevOps organization 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, String orgName, + 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 Azure DevOps organization name. + * @param projectName The project 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 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 Azure DevOps organization name. + * @param projectName The project 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 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 Azure DevOps organization name. + * @param projectName The project name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @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); +} 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 new file mode 100644 index 0000000000000..0c8ef8061ae1e --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsReposClient.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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 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 Azure DevOps organization name. + * @param projectName The project 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, + 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 Azure DevOps organization name. + * @param projectName The project 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, + String orgName, String projectName, 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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository 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 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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository 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 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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @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); +} 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 index 834cf0990b35a..2f3bb8e37c727 100644 --- 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 @@ -11,13 +11,15 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in ComplianceResultsClient. + */ public interface ComplianceResultsClient { /** * Security compliance results in the subscription. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -28,9 +30,9 @@ public interface ComplianceResultsClient { /** * Security compliance results in the subscription. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -42,7 +44,7 @@ public interface ComplianceResultsClient { /** * Security Compliance Result. - * + * * @param resourceId The identifier of the resource. * @param complianceResultName name of the desired assessment compliance result. * @param context The context to associate with this operation. @@ -56,7 +58,7 @@ public interface ComplianceResultsClient { /** * Security Compliance Result. - * + * * @param resourceId The identifier of the resource. * @param complianceResultName name of the desired assessment compliance result. * @throws IllegalArgumentException thrown if parameters fail the validation. 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 index 7914ab6d42930..a592b826901c0 100644 --- 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 @@ -11,13 +11,15 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in CompliancesClient. + */ public interface CompliancesClient { /** * The Compliance scores of the specific management group. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -28,9 +30,9 @@ public interface CompliancesClient { /** * The Compliance scores of the specific management group. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -42,9 +44,9 @@ public interface CompliancesClient { /** * Details of a specific Compliance. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param complianceName name of the Compliance. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -57,9 +59,9 @@ public interface CompliancesClient { /** * Details of a specific Compliance. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @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. diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ConnectorsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ConnectorsClient.java index fc3073c4ec5a4..7f2e366138284 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ConnectorsClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ConnectorsClient.java @@ -11,35 +11,37 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.security.fluent.models.ConnectorSettingInner; -/** An instance of this class provides access to all the operations defined in ConnectorsClient. */ +/** + * An instance of this class provides access to all the operations defined in ConnectorsClient. + */ public interface ConnectorsClient { /** * Cloud accounts connectors 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 for a subscription, list of all cloud account connectors and their settings as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** * Cloud accounts connectors 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 for a subscription, list of all cloud account connectors and their settings as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); /** * Details of a specific cloud account connector. - * + * * @param connectorName Name of the cloud account connector. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -52,7 +54,7 @@ public interface ConnectorsClient { /** * Details of a specific cloud account connector. - * + * * @param connectorName Name of the cloud account connector. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -65,7 +67,7 @@ public interface ConnectorsClient { /** * Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either * account credentials or role-based authentication. For GCP, use account organization credentials. - * + * * @param connectorName Name of the cloud account connector. * @param connectorSetting Settings for the cloud account connector. * @param context The context to associate with this operation. @@ -75,13 +77,13 @@ public interface ConnectorsClient { * @return the connector setting along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String connectorName, ConnectorSettingInner connectorSetting, Context context); + Response createOrUpdateWithResponse(String connectorName, + ConnectorSettingInner connectorSetting, Context context); /** * Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either * account credentials or role-based authentication. For GCP, use account organization credentials. - * + * * @param connectorName Name of the cloud account connector. * @param connectorSetting Settings for the cloud account connector. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -94,7 +96,7 @@ Response createOrUpdateWithResponse( /** * Delete a cloud account connector from a subscription. - * + * * @param connectorName Name of the cloud account connector. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -107,7 +109,7 @@ Response createOrUpdateWithResponse( /** * Delete a cloud account connector from a subscription. - * + * * @param connectorName Name of the cloud account connector. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomAssessmentAutomationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomAssessmentAutomationsClient.java index cdd6a0b7a94f7..d274216083560 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomAssessmentAutomationsClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomAssessmentAutomationsClient.java @@ -12,34 +12,36 @@ import com.azure.resourcemanager.security.fluent.models.CustomAssessmentAutomationInner; import com.azure.resourcemanager.security.models.CustomAssessmentAutomationRequest; -/** An instance of this class provides access to all the operations defined in CustomAssessmentAutomationsClient. */ +/** + * An instance of this class provides access to all the operations defined in CustomAssessmentAutomationsClient. + */ public interface CustomAssessmentAutomationsClient { /** * Gets a custom assessment automation - * - *

Gets a single custom assessment automation by name for the provided subscription and resource group. - * + * + * Gets a single custom assessment automation by name for the provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customAssessmentAutomationName Name of the Custom Assessment Automation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single custom assessment automation by name for the provided subscription and resource group along with - * {@link Response}. + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String customAssessmentAutomationName, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, + String customAssessmentAutomationName, Context context); /** * Gets a custom assessment automation - * - *

Gets a single custom assessment automation by name for the provided subscription and resource group. - * + * + * Gets a single custom assessment automation by name for the provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customAssessmentAutomationName Name of the Custom Assessment Automation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -51,12 +53,12 @@ Response getByResourceGroupWithResponse( /** * Creates a custom assessment automation - * - *

Creates or updates a custom assessment automation for the provided subscription. Please note that providing an + * + * Creates or updates a custom assessment automation for the provided subscription. Please note that providing an * existing custom assessment automation will replace the existing record. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customAssessmentAutomationName Name of the Custom Assessment Automation. * @param customAssessmentAutomationBody Custom Assessment Automation body. * @param context The context to associate with this operation. @@ -66,20 +68,18 @@ Response getByResourceGroupWithResponse( * @return custom Assessment Automation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, - String customAssessmentAutomationName, - CustomAssessmentAutomationRequest customAssessmentAutomationBody, + Response createWithResponse(String resourceGroupName, + String customAssessmentAutomationName, CustomAssessmentAutomationRequest customAssessmentAutomationBody, Context context); /** * Creates a custom assessment automation - * - *

Creates or updates a custom assessment automation for the provided subscription. Please note that providing an + * + * Creates or updates a custom assessment automation for the provided subscription. Please note that providing an * existing custom assessment automation will replace the existing record. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customAssessmentAutomationName Name of the Custom Assessment Automation. * @param customAssessmentAutomationBody Custom Assessment Automation body. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -88,18 +88,16 @@ Response createWithResponse( * @return custom Assessment Automation. */ @ServiceMethod(returns = ReturnType.SINGLE) - CustomAssessmentAutomationInner create( - String resourceGroupName, - String customAssessmentAutomationName, + CustomAssessmentAutomationInner create(String resourceGroupName, String customAssessmentAutomationName, CustomAssessmentAutomationRequest customAssessmentAutomationBody); /** * Deletes a custom assessment automation - * - *

Deletes a custom assessment automation by name for a provided subscription. - * + * + * Deletes a custom assessment automation by name for a provided subscription. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customAssessmentAutomationName Name of the Custom Assessment Automation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -112,11 +110,11 @@ CustomAssessmentAutomationInner create( /** * Deletes a custom assessment automation - * - *

Deletes a custom assessment automation by name for a provided subscription. - * + * + * Deletes a custom assessment automation by name for a provided subscription. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customAssessmentAutomationName Name of the Custom Assessment Automation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -127,11 +125,11 @@ CustomAssessmentAutomationInner create( /** * List custom assessment automations in a subscription and a resource group - * - *

List custom assessment automations by provided subscription and resource group. - * + * + * List custom assessment automations by provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -142,11 +140,11 @@ CustomAssessmentAutomationInner create( /** * List custom assessment automations in a subscription and a resource group - * - *

List custom assessment automations by provided subscription and resource group. - * + * + * List custom assessment automations by provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -158,9 +156,9 @@ CustomAssessmentAutomationInner create( /** * List custom assessment automations in a subscription - * - *

List custom assessment automations by provided subscription. - * + * + * List custom assessment automations by provided 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 Custom Assessment Automations as paginated response with {@link PagedIterable}. @@ -170,9 +168,9 @@ CustomAssessmentAutomationInner create( /** * List custom assessment automations in a subscription - * - *

List custom assessment automations by provided subscription. - * + * + * List custom assessment automations by provided 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. diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomEntityStoreAssignmentsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomEntityStoreAssignmentsClient.java index 5f7d062043ade..74a13bec8c99f 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomEntityStoreAssignmentsClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomEntityStoreAssignmentsClient.java @@ -12,34 +12,36 @@ import com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentInner; import com.azure.resourcemanager.security.models.CustomEntityStoreAssignmentRequest; -/** An instance of this class provides access to all the operations defined in CustomEntityStoreAssignmentsClient. */ +/** + * An instance of this class provides access to all the operations defined in CustomEntityStoreAssignmentsClient. + */ public interface CustomEntityStoreAssignmentsClient { /** * Gets a custom entity store assignment - * - *

Gets a single custom entity store assignment by name for the provided subscription and resource group. - * + * + * Gets a single custom entity store assignment by name for the provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is 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 single custom entity store assignment by name for the provided subscription and resource group along - * with {@link Response}. + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String customEntityStoreAssignmentName, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, + String customEntityStoreAssignmentName, Context context); /** * Gets a custom entity store assignment - * - *

Gets a single custom entity store assignment by name for the provided subscription and resource group. - * + * + * Gets a single custom entity store assignment by name for the provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -47,16 +49,16 @@ Response getByResourceGroupWithResponse( * @return a single custom entity store assignment by name for the provided subscription and resource group. */ @ServiceMethod(returns = ReturnType.SINGLE) - CustomEntityStoreAssignmentInner getByResourceGroup( - String resourceGroupName, String customEntityStoreAssignmentName); + CustomEntityStoreAssignmentInner getByResourceGroup(String resourceGroupName, + String customEntityStoreAssignmentName); /** * Creates a custom entity store assignment - * - *

Creates a custom entity store assignment for the provided subscription, if not already exists. - * + * + * Creates a custom entity store assignment for the provided subscription, if not already exists. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. * @param customEntityStoreAssignmentRequestBody Custom entity store assignment body. * @param context The context to associate with this operation. @@ -66,19 +68,17 @@ CustomEntityStoreAssignmentInner getByResourceGroup( * @return custom entity store assignment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, + Response createWithResponse(String resourceGroupName, String customEntityStoreAssignmentName, - CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody, - Context context); + CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody, Context context); /** * Creates a custom entity store assignment - * - *

Creates a custom entity store assignment for the provided subscription, if not already exists. - * + * + * Creates a custom entity store assignment for the provided subscription, if not already exists. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. * @param customEntityStoreAssignmentRequestBody Custom entity store assignment body. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -87,18 +87,16 @@ Response createWithResponse( * @return custom entity store assignment. */ @ServiceMethod(returns = ReturnType.SINGLE) - CustomEntityStoreAssignmentInner create( - String resourceGroupName, - String customEntityStoreAssignmentName, + CustomEntityStoreAssignmentInner create(String resourceGroupName, String customEntityStoreAssignmentName, CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody); /** * Deleted a custom entity store assignment - * - *

Delete a custom entity store assignment by name for a provided subscription. - * + * + * Delete a custom entity store assignment by name for a provided subscription. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -107,16 +105,16 @@ CustomEntityStoreAssignmentInner create( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String customEntityStoreAssignmentName, Context context); + Response deleteWithResponse(String resourceGroupName, String customEntityStoreAssignmentName, + Context context); /** * Deleted a custom entity store assignment - * - *

Delete a custom entity store assignment by name for a provided subscription. - * + * + * Delete a custom entity store assignment by name for a provided subscription. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -127,11 +125,11 @@ Response deleteWithResponse( /** * List custom entity store assignments in a subscription and a resource group - * - *

List custom entity store assignments by a provided subscription and resource group. - * + * + * List custom entity store assignments by a provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -142,11 +140,11 @@ Response deleteWithResponse( /** * List custom entity store assignments in a subscription and a resource group - * - *

List custom entity store assignments by a provided subscription and resource group. - * + * + * List custom entity store assignments by a provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -158,9 +156,9 @@ Response deleteWithResponse( /** * List custom entity store assignments in a subscription - * - *

List custom entity store assignments by provided subscription. - * + * + * List custom entity store assignments by provided 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 custom entity store assignments as paginated response with {@link PagedIterable}. @@ -170,9 +168,9 @@ Response deleteWithResponse( /** * List custom entity store assignments in a subscription - * - *

List custom entity store assignments by provided subscription. - * + * + * List custom entity store assignments by provided 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. 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 new file mode 100644 index 0000000000000..a703e8d5114d0 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DefenderForStoragesClient.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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.DefenderForStorageSettingInner; +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 identifier of the resource. + * @param settingName 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 identifier of the resource. + * @param settingName 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 identifier of the resource. + * @param settingName 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 identifier of the resource. + * @param settingName 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); +} 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 new file mode 100644 index 0000000000000..072a55b3132f0 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsConfigurationsClient.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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 { + /** + * 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); + + /** + * 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); +} 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 new file mode 100644 index 0000000000000..104278955f2d8 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsOperationResultsClient.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 operation result 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 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 operation result 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 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 index e03cd1b990c0e..72dab9a527ea8 100644 --- 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 @@ -11,11 +11,13 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in DeviceSecurityGroupsClient. + */ public interface DeviceSecurityGroupsClient { /** * Use this method get the list of device security groups for the specified IoT Hub resource. - * + * * @param resourceId The 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. @@ -27,7 +29,7 @@ public interface DeviceSecurityGroupsClient { /** * Use this method get the list of device security groups for the specified IoT Hub resource. - * + * * @param resourceId The identifier of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -40,10 +42,10 @@ public interface DeviceSecurityGroupsClient { /** * Use this method to get the device security group for the specified IoT Hub resource. - * + * * @param resourceId The 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. + * 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. @@ -51,15 +53,15 @@ public interface DeviceSecurityGroupsClient { * @return the device security group resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceId, String deviceSecurityGroupName, Context context); + 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 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. + * 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. @@ -70,10 +72,10 @@ Response getWithResponse( /** * Use this method to creates or updates the device security group on a specified IoT Hub resource. - * + * * @param resourceId The 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. + * 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. @@ -82,18 +84,15 @@ Response getWithResponse( * @return the device security group resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceId, - String deviceSecurityGroupName, - DeviceSecurityGroupInner deviceSecurityGroup, - Context context); + 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 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. + * 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. @@ -101,15 +100,15 @@ Response createOrUpdateWithResponse( * @return the device security group resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeviceSecurityGroupInner createOrUpdate( - String resourceId, String deviceSecurityGroupName, DeviceSecurityGroupInner deviceSecurityGroup); + DeviceSecurityGroupInner createOrUpdate(String resourceId, String deviceSecurityGroupName, + DeviceSecurityGroupInner deviceSecurityGroup); /** * User this method to deletes the device security group. - * + * * @param resourceId The 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. + * 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. @@ -121,10 +120,10 @@ DeviceSecurityGroupInner createOrUpdate( /** * User this method to deletes the device security group. - * + * * @param resourceId The 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. + * 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. 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 index 692eeaf708ccb..47c4eb45a523d 100644 --- 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 @@ -11,68 +11,70 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in DiscoveredSecuritySolutionsClient. + */ public interface DiscoveredSecuritySolutionsClient { /** * 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}. + * @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}. + * @return a list of discovered Security Solutions for the subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context 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. + * 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}. + * {@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. + * 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}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByHomeRegion(String ascLocation, Context context); /** * Gets a specific discovered Security Solution. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -81,16 +83,16 @@ public interface DiscoveredSecuritySolutionsClient { * @return a specific discovered Security Solution along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String ascLocation, String discoveredSecuritySolutionName, Context context); + Response getWithResponse(String resourceGroupName, String ascLocation, + String discoveredSecuritySolutionName, Context context); /** * Gets a specific discovered Security Solution. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -98,6 +100,6 @@ Response getWithResponse( * @return a specific discovered Security Solution. */ @ServiceMethod(returns = ReturnType.SINGLE) - DiscoveredSecuritySolutionInner get( - String resourceGroupName, String ascLocation, String discoveredSecuritySolutionName); + DiscoveredSecuritySolutionInner get(String resourceGroupName, String ascLocation, + String discoveredSecuritySolutionName); } 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 index ace625003ab69..1acdd16924f0a 100644 --- 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 @@ -11,68 +11,70 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in ExternalSecuritySolutionsClient. + */ public interface ExternalSecuritySolutionsClient { /** * 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}. + * @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}. + * @return a list of external security solutions for the subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context 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. + * 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}. + * @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. + * 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}. + * @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 specific external Security Solution. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -81,16 +83,16 @@ public interface ExternalSecuritySolutionsClient { * @return a specific external Security Solution along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String ascLocation, String externalSecuritySolutionsName, Context context); + Response getWithResponse(String resourceGroupName, String ascLocation, + String externalSecuritySolutionsName, Context context); /** * Gets a specific external Security Solution. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -98,6 +100,6 @@ Response getWithResponse( * @return a specific external Security Solution. */ @ServiceMethod(returns = ReturnType.SINGLE) - ExternalSecuritySolutionInner get( - String resourceGroupName, String ascLocation, String externalSecuritySolutionsName); + ExternalSecuritySolutionInner get(String resourceGroupName, String ascLocation, + String externalSecuritySolutionsName); } 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 new file mode 100644 index 0000000000000..7a4c2cb6a4a40 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubOwnersClient.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 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); + + /** + * 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 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 GitHub owner 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 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 GitHub owner 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 gitHub Owner resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GitHubOwnerInner get(String resourceGroupName, String securityConnectorName, String ownerName); +} 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 new file mode 100644 index 0000000000000..fc4eb380b972a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubReposClient.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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 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 GitHub owner 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, 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 GitHub owner 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, String ownerName, + 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 GitHub owner name. + * @param repoName The repository 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 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 GitHub owner name. + * @param repoName The repository 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 gitHub Repository resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GitHubRepositoryInner get(String resourceGroupName, String securityConnectorName, String ownerName, + String repoName); +} 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 new file mode 100644 index 0000000000000..a20ab3e0215d0 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabGroupsClient.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 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); + + /** + * 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 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 GitLab group fully-qualified 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 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 GitLab group fully-qualified 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 gitLab Group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GitLabGroupInner get(String resourceGroupName, String securityConnectorName, String groupFQName); +} 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 new file mode 100644 index 0000000000000..9faf6c688bccf --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabProjectsClient.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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 { + /** + * 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 GitLab group fully-qualified 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 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 GitLab group fully-qualified 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 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); + + /** + * 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 GitLab group fully-qualified name. + * @param projectName The project 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 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 GitLab group fully-qualified name. + * @param projectName The project 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 gitLab Project resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GitLabProjectInner get(String resourceGroupName, String securityConnectorName, String groupFQName, + String projectName); +} 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 new file mode 100644 index 0000000000000..ffcc005c753ba --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabSubgroupsClient.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 GitLab group fully-qualified 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 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 GitLab group fully-qualified 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 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 index ab8458ddf09cb..bb00ad61eea32 100644 --- 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 @@ -11,47 +11,49 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in GovernanceAssignmentsClient. + */ public interface GovernanceAssignmentsClient { /** * Get governance assignments on all of your resources inside a scope. - * + * * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param assessmentName The Assessment Key - A 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 governance assignments on all of your resources inside a scope as paginated response with {@link - * PagedIterable}. + * @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 assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param assessmentName The Assessment Key - A 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 governance assignments on all of your resources inside a scope as paginated response with {@link - * PagedIterable}. + * @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); /** * Get a specific governanceAssignment for the requested scope by AssignmentKey. - * + * * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param assessmentName The Assessment Key - A unique key for the assessment type. * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @param context The context to associate with this operation. @@ -61,15 +63,15 @@ public interface GovernanceAssignmentsClient { * @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); + 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 assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param assessmentName The Assessment Key - A unique key for the assessment type. * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -82,10 +84,10 @@ Response getWithResponse( /** * Creates or updates a governance assignment on the given subscription. - * + * * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param assessmentName The Assessment Key - A unique key for the assessment type. * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @param governanceAssignment Governance assignment over a subscription scope. @@ -96,19 +98,15 @@ Response getWithResponse( * @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); + 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 assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param assessmentName The Assessment Key - A unique key for the assessment type. * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @param governanceAssignment Governance assignment over a subscription scope. @@ -118,15 +116,15 @@ Response createOrUpdateWithResponse( * @return governance assignment over a given scope. */ @ServiceMethod(returns = ReturnType.SINGLE) - GovernanceAssignmentInner createOrUpdate( - String scope, String assessmentName, String assignmentKey, GovernanceAssignmentInner governanceAssignment); + GovernanceAssignmentInner createOrUpdate(String scope, String assessmentName, String assignmentKey, + GovernanceAssignmentInner governanceAssignment); /** * Delete a GovernanceAssignment over a given scope. - * + * * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param assessmentName The Assessment Key - A unique key for the assessment type. * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @param context The context to associate with this operation. @@ -140,10 +138,10 @@ GovernanceAssignmentInner createOrUpdate( /** * Delete a GovernanceAssignment over a given scope. - * + * * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param assessmentName The Assessment Key - A unique key for the assessment type. * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. 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 index d6f4ace6458cf..a75e3e9290b69 100644 --- 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 @@ -16,15 +16,17 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in GovernanceRulesClient. + */ public interface GovernanceRulesClient { /** * Get a list of all relevant governance rules over a scope. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -35,11 +37,11 @@ public interface GovernanceRulesClient { /** * Get a list of all relevant governance rules over a scope. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -51,11 +53,11 @@ public interface GovernanceRulesClient { /** * Get a specific governance rule for the requested scope by ruleId. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -68,11 +70,11 @@ public interface GovernanceRulesClient { /** * Get a specific governance rule for the requested scope by ruleId. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -84,11 +86,11 @@ public interface GovernanceRulesClient { /** * Creates or updates a governance rule over a given scope. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -98,16 +100,16 @@ public interface GovernanceRulesClient { * @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); + Response createOrUpdateWithResponse(String scope, String ruleId, + GovernanceRuleInner governanceRule, Context context); /** * Creates or updates a governance rule over a given scope. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -120,11 +122,11 @@ Response createOrUpdateWithResponse( /** * Delete a Governance rule over a given scope. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -136,11 +138,11 @@ Response createOrUpdateWithResponse( /** * Delete a Governance rule over a given scope. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -153,11 +155,11 @@ Response createOrUpdateWithResponse( /** * Delete a Governance rule over a given scope. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -168,11 +170,11 @@ Response createOrUpdateWithResponse( /** * Delete a Governance rule over a given scope. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -184,11 +186,11 @@ Response createOrUpdateWithResponse( /** * Execute a governance rule. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -200,11 +202,11 @@ Response createOrUpdateWithResponse( /** * Execute a governance rule. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -214,16 +216,16 @@ Response createOrUpdateWithResponse( * @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); + SyncPoller, Void> beginExecute(String scope, String ruleId, + ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context); /** * Execute a governance rule. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -234,11 +236,11 @@ SyncPoller, Void> beginExecute( /** * Execute a governance rule. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -251,11 +253,11 @@ SyncPoller, Void> beginExecute( /** * Get governance rules long run operation result for the requested scope by ruleId and operationId. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). * @param operationId The governance rule long running operation unique key. * @param context The context to associate with this operation. @@ -265,16 +267,16 @@ SyncPoller, Void> beginExecute( * @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); + 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 rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). * @param operationId The governance rule long running operation unique key. * @throws IllegalArgumentException thrown if parameters fail the validation. 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 index 57ee9785cfd2f..2db32bbb22aa4 100644 --- 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 @@ -7,16 +7,19 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in HealthReportsClient. + */ public interface HealthReportsClient { /** * 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 scope at which the operation is performed. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -30,7 +33,7 @@ public interface HealthReportsClient { * 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 scope at which the operation is performed. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -40,4 +43,31 @@ public interface HealthReportsClient { */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String scope, Context context); + + /** + * Get health report of resource. + * + * @param resourceId The identifier of the resource. + * @param healthReportName The health report Key - Unique key for the health report 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 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 identifier of the resource. + * @param healthReportName The health report Key - Unique key for the health report 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 health report of resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HealthReportInner get(String resourceId, String healthReportName); } 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 index a43e048fb2faf..4004e84aa1033 100644 --- 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 @@ -12,13 +12,15 @@ 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. */ +/** + * 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 Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @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. @@ -27,14 +29,14 @@ public interface InformationProtectionPoliciesClient { * @return information protection policy along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String scope, InformationProtectionPolicyName informationProtectionPolicyName, Context context); + Response getWithResponse(String scope, + InformationProtectionPolicyName informationProtectionPolicyName, Context context); /** * Details of the information protection policy. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @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. @@ -46,9 +48,9 @@ Response getWithResponse( /** * Details of the information protection policy. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param informationProtectionPolicyName Name of the information protection policy. * @param informationProtectionPolicy Information protection policy. * @param context The context to associate with this operation. @@ -58,17 +60,15 @@ Response getWithResponse( * @return information protection policy along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String scope, + Response createOrUpdateWithResponse(String scope, InformationProtectionPolicyName informationProtectionPolicyName, - InformationProtectionPolicyInner informationProtectionPolicy, - Context context); + InformationProtectionPolicyInner informationProtectionPolicy, Context context); /** * Details of the information protection policy. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param informationProtectionPolicyName Name of the information protection policy. * @param informationProtectionPolicy Information protection policy. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -77,16 +77,15 @@ Response createOrUpdateWithResponse( * @return information protection policy. */ @ServiceMethod(returns = ReturnType.SINGLE) - InformationProtectionPolicyInner createOrUpdate( - String scope, + InformationProtectionPolicyInner createOrUpdate(String scope, InformationProtectionPolicyName informationProtectionPolicyName, InformationProtectionPolicyInner informationProtectionPolicy); /** * Information protection policies of a specific management group. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -97,9 +96,9 @@ InformationProtectionPolicyInner createOrUpdate( /** * Information protection policies of a specific management group. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IngestionSettingsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IngestionSettingsClient.java deleted file mode 100644 index c0765e68586c8..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IngestionSettingsClient.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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.ConnectionStringsInner; -import com.azure.resourcemanager.security.fluent.models.IngestionSettingInner; -import com.azure.resourcemanager.security.fluent.models.IngestionSettingTokenInner; - -/** An instance of this class provides access to all the operations defined in IngestionSettingsClient. */ -public interface IngestionSettingsClient { - /** - * Settings for ingesting security data and logs to correlate with resources 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 ingestion settings as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Settings for ingesting security data and logs to correlate with resources 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 ingestion settings as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion 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 how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String ingestionSettingName, Context context); - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion 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 how to correlate scan data and logs with resources associated with the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IngestionSettingInner get(String ingestionSettingName); - - /** - * Create setting for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param ingestionSetting Ingestion 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 how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String ingestionSettingName, IngestionSettingInner ingestionSetting, Context context); - - /** - * Create setting for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param ingestionSetting Ingestion 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 how to correlate scan data and logs with resources associated with the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IngestionSettingInner create(String ingestionSettingName, IngestionSettingInner ingestionSetting); - - /** - * Deletes the ingestion settings for this subscription. - * - * @param ingestionSettingName Name of the ingestion 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 ingestionSettingName, Context context); - - /** - * Deletes the ingestion settings for this subscription. - * - * @param ingestionSettingName Name of the ingestion 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 ingestionSettingName); - - /** - * Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - * - * @param ingestionSettingName Name of the ingestion 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 how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listTokensWithResponse(String ingestionSettingName, Context context); - - /** - * Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - * - * @param ingestionSettingName Name of the ingestion 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 how to correlate scan data and logs with resources associated with the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IngestionSettingTokenInner listTokens(String ingestionSettingName); - - /** - * Connection strings for ingesting security scan logs and data. - * - * @param ingestionSettingName Name of the ingestion 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 connection string for ingesting security data and logs along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listConnectionStringsWithResponse(String ingestionSettingName, Context context); - - /** - * Connection strings for ingesting security scan logs and data. - * - * @param ingestionSettingName Name of the ingestion 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 connection string for ingesting security data and logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectionStringsInner listConnectionStrings(String ingestionSettingName); -} 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 index 25a019f2f016c..9805485a48cf1 100644 --- 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 @@ -11,13 +11,15 @@ 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. */ +/** + * 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 in an array. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -26,14 +28,14 @@ public interface IotSecuritySolutionAnalyticsClient { * @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); + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -45,9 +47,9 @@ Response listWithResponse( /** * Use this method to get IoT Security Analytics metrics. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -56,14 +58,14 @@ Response listWithResponse( * @return security analytics of your IoT Security solution along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String solutionName, Context context); + 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 within the user's subscription. The name is case - * insensitive. + * 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. 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 index 1ea68d2ece5c7..6f022394b02a1 100644 --- 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 @@ -18,9 +18,9 @@ public interface IotSecuritySolutionsAnalyticsAggregatedAlertsClient { /** * Use this method to get the aggregated alert list of yours IoT Security solution. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -32,9 +32,9 @@ public interface IotSecuritySolutionsAnalyticsAggregatedAlertsClient { /** * Use this method to get the aggregated alert list of yours IoT Security solution. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -44,15 +44,15 @@ public interface IotSecuritySolutionsAnalyticsAggregatedAlertsClient { * @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); + PagedIterable list(String resourceGroupName, String solutionName, Integer top, + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -62,15 +62,15 @@ PagedIterable list( * @return security Solution Aggregated Alert information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String solutionName, String aggregatedAlertName, Context context); + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -83,9 +83,9 @@ Response getWithResponse( /** * Use this method to dismiss an aggregated IoT Security Solution Alert. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -95,14 +95,14 @@ Response getWithResponse( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response dismissWithResponse( - String resourceGroupName, String solutionName, String aggregatedAlertName, Context context); + 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 within the user's subscription. The name is case - * insensitive. + * 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. 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 index 1e534a2b033ea..19cd3bba06d4b 100644 --- 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 @@ -19,9 +19,9 @@ 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -31,15 +31,15 @@ public interface IotSecuritySolutionsAnalyticsRecommendationsClient { * @return ioT Security solution recommendation information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String solutionName, String aggregatedRecommendationName, Context context); + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -48,39 +48,39 @@ Response getWithResponse( * @return ioT Security solution recommendation information. */ @ServiceMethod(returns = ReturnType.SINGLE) - IoTSecurityAggregatedRecommendationInner get( - String resourceGroupName, String solutionName, String aggregatedRecommendationName); + 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 within the user's subscription. The name is case - * insensitive. + * 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}. + * @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 within the user's subscription. The name is case - * insensitive. + * 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}. + * @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); + 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 index 140ffd6f2f623..cdeb1394af308 100644 --- 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 @@ -12,11 +12,13 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in IotSecuritySolutionsClient. + */ public interface IotSecuritySolutionsClient { /** * 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}. @@ -26,7 +28,7 @@ public interface IotSecuritySolutionsClient { /** * 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. @@ -39,9 +41,9 @@ public interface IotSecuritySolutionsClient { /** * Use this method to get the list IoT Security solutions organized by resource group. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -52,9 +54,9 @@ public interface IotSecuritySolutionsClient { /** * Use this method to get the list IoT Security solutions organized by resource group. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -63,14 +65,14 @@ public interface IotSecuritySolutionsClient { * @return list of IoT Security solutions as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup( - String resourceGroupName, String filter, Context context); + PagedIterable listByResourceGroup(String resourceGroupName, String filter, + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -79,14 +81,14 @@ PagedIterable listByResourceGroup( * @return ioT Security solution configuration and resource information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String solutionName, Context context); + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -98,9 +100,9 @@ Response getByResourceGroupWithResponse( /** * Use this method to create or update yours IoT Security solution. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -110,17 +112,14 @@ Response getByResourceGroupWithResponse( * @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); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param solutionName The name of the IoT Security solution. * @param iotSecuritySolutionData The security solution data. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -129,15 +128,15 @@ Response createOrUpdateWithResponse( * @return ioT Security solution configuration and resource information. */ @ServiceMethod(returns = ReturnType.SINGLE) - IoTSecuritySolutionModelInner createOrUpdate( - String resourceGroupName, String solutionName, IoTSecuritySolutionModelInner iotSecuritySolutionData); + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -147,18 +146,15 @@ IoTSecuritySolutionModelInner createOrUpdate( * @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); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param solutionName The name of the IoT Security solution. * @param updateIotSecuritySolutionData The security solution data. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -167,14 +163,14 @@ Response updateWithResponse( * @return ioT Security solution configuration and resource information. */ @ServiceMethod(returns = ReturnType.SINGLE) - IoTSecuritySolutionModelInner update( - String resourceGroupName, String solutionName, UpdateIotSecuritySolutionData updateIotSecuritySolutionData); + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -187,9 +183,9 @@ IoTSecuritySolutionModelInner update( /** * Use this method to delete yours IoT Security solution. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. 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 index 3170b606a0ed5..9dc4892f7ed93 100644 --- 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 @@ -13,11 +13,13 @@ 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. */ +/** + * 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. - * + * * @throws com.azure.core.management.exception.ManagementException 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}. @@ -27,7 +29,7 @@ public interface JitNetworkAccessPoliciesClient { /** * 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. @@ -39,9 +41,9 @@ public interface JitNetworkAccessPoliciesClient { /** * 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. + * 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. @@ -52,9 +54,9 @@ public interface JitNetworkAccessPoliciesClient { /** * 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. + * 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. @@ -66,9 +68,9 @@ 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -79,9 +81,9 @@ 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -93,27 +95,27 @@ 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -121,16 +123,16 @@ PagedIterable listByResourceGroupAndRegion( * @return the paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroupAndRegion( - String resourceGroupName, String ascLocation, Context context); + PagedIterable listByResourceGroupAndRegion(String resourceGroupName, + String ascLocation, Context context); /** * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -139,16 +141,16 @@ PagedIterable listByResourceGroupAndRegion( * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName, Context context); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -160,11 +162,11 @@ Response getWithResponse( /** * Create a policy for protecting resources using Just-in-Time access control. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -174,20 +176,16 @@ Response getWithResponse( * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String ascLocation, - String jitNetworkAccessPolicyName, - JitNetworkAccessPolicyInner body, - Context context); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -196,19 +194,16 @@ Response createOrUpdateWithResponse( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - JitNetworkAccessPolicyInner createOrUpdate( - String resourceGroupName, - String ascLocation, - String jitNetworkAccessPolicyName, - JitNetworkAccessPolicyInner body); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -217,16 +212,16 @@ JitNetworkAccessPolicyInner createOrUpdate( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName, Context context); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -237,11 +232,11 @@ Response deleteWithResponse( /** * Initiate a JIT access from a specific Just-in-Time policy configuration. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -251,20 +246,16 @@ Response deleteWithResponse( * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response initiateWithResponse( - String resourceGroupName, - String ascLocation, - String jitNetworkAccessPolicyName, - JitNetworkAccessPolicyInitiateRequest body, - Context context); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -273,9 +264,6 @@ Response initiateWithResponse( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - JitNetworkAccessRequestInner initiate( - String resourceGroupName, - String ascLocation, - String jitNetworkAccessPolicyName, - JitNetworkAccessPolicyInitiateRequest body); + JitNetworkAccessRequestInner initiate(String resourceGroupName, String ascLocation, + String jitNetworkAccessPolicyName, JitNetworkAccessPolicyInitiateRequest body); } 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 index 9215df9982263..3addbc8dafd4c 100644 --- 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 @@ -11,13 +11,15 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in LocationsClient. + */ public interface LocationsClient { /** * 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}. @@ -29,7 +31,7 @@ public interface LocationsClient { * 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. @@ -41,9 +43,9 @@ 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. + * 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. @@ -55,9 +57,9 @@ 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. + * 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. 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 index f1a31c9a245a4..1326b7d829a95 100644 --- 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 @@ -11,11 +11,13 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in MdeOnboardingsClient. + */ public interface MdeOnboardingsClient { /** * 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. @@ -27,7 +29,7 @@ public interface MdeOnboardingsClient { /** * 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. @@ -37,20 +39,20 @@ 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}. + * @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. 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 index 06e04115fd4b2..4c7cab5d704e4 100644 --- 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 @@ -10,28 +10,30 @@ 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. */ +/** + * 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 list of possible operations for Microsoft.Security resource provider as paginated response with {@link - * PagedIterable}. + * @return list of possible operations for Microsoft.Security 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 list of possible operations for Microsoft.Security resource provider as paginated response with {@link - * PagedIterable}. + * @return list of possible operations for Microsoft.Security 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 index fefcef79c849f..5c660d85ed983 100644 --- 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 @@ -11,81 +11,155 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in PricingsClient. + */ public interface PricingsClient { /** - * Lists Microsoft Defender for Cloud pricing configurations in the subscription. - * + * 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 scope id of the pricing. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or a specific resource (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}) + * - Supported resources are (VirtualMachines). + * @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 pricing configurations response along with {@link Response}. + * @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 listWithResponse(Context context); + Response getWithResponse(String scopeId, String pricingName, Context context); /** - * Lists Microsoft Defender for Cloud pricing configurations in the subscription. - * + * 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 scope id of the pricing. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or a specific resource (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}) + * - Supported resources are (VirtualMachines). + * @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 pricing configurations response. + * @return the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a + * subscription id). */ @ServiceMethod(returns = ReturnType.SINGLE) - PricingListInner list(); + PricingInner get(String scopeId, String pricingName); /** - * Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * + * 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 scope id of the pricing. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or a specific resource (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}) + * - Supported resources are (VirtualMachines). * @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 a provided Microsoft Defender for Cloud pricing configuration in the subscription along with {@link - * Response}. + * @return microsoft Defender for Cloud is provided in two pricing tiers: free and standard along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String pricingName, Context context); + Response updateWithResponse(String scopeId, String pricingName, PricingInner pricing, + Context context); /** - * Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * + * 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 scope id of the pricing. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or a specific resource (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}) + * - Supported resources are (VirtualMachines). * @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 a provided Microsoft Defender for Cloud pricing configuration in the subscription. + * @return microsoft Defender for Cloud is provided in two pricing tiers: free and standard. */ @ServiceMethod(returns = ReturnType.SINGLE) - PricingInner get(String pricingName); + PricingInner update(String scopeId, String pricingName, PricingInner pricing); /** - * Updates a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * + * Deletes a provided Microsoft Defender for Cloud pricing configuration in a specific resource. Valid only for + * resource scope (Supported resources are: 'VirtualMachines, VMSS and ARC MachinesS'). + * + * @param scopeId The identifier of the resource, (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}). * @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}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String pricingName, PricingInner pricing, Context context); + Response deleteWithResponse(String scopeId, String pricingName, Context context); /** - * Updates a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * + * Deletes a provided Microsoft Defender for Cloud pricing configuration in a specific resource. Valid only for + * resource scope (Supported resources are: 'VirtualMachines, VMSS and ARC MachinesS'). + * + * @param scopeId The identifier of the resource, (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}). * @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 pricingName, PricingInner pricing); + 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 scope id of the pricing. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or a specific resource (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}) + * - Supported resources are (VirtualMachines). + * @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 scope id of the pricing. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or a specific resource (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}) + * - Supported resources are (VirtualMachines). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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/RegulatoryComplianceAssessmentsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceAssessmentsClient.java index fb3daa044da5a..36f7fb66f1aee 100644 --- 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 @@ -11,11 +11,13 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in RegulatoryComplianceAssessmentsClient. + */ public interface RegulatoryComplianceAssessmentsClient { /** * 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. @@ -24,12 +26,12 @@ public interface RegulatoryComplianceAssessmentsClient { * @return list of regulatory compliance assessment response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName); + 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. @@ -40,15 +42,12 @@ PagedIterable list( * @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); + PagedIterable list(String regulatoryComplianceStandardName, + String regulatoryComplianceControlName, String filter, 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. @@ -59,15 +58,12 @@ PagedIterable list( * @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); + 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. @@ -77,8 +73,6 @@ Response getWithResponse( * @return regulatory compliance assessment details and state. */ @ServiceMethod(returns = ReturnType.SINGLE) - RegulatoryComplianceAssessmentInner get( - String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, - String regulatoryComplianceAssessmentName); + RegulatoryComplianceAssessmentInner get(String regulatoryComplianceStandardName, + String regulatoryComplianceControlName, String regulatoryComplianceAssessmentName); } 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 index d7f732d0cdb62..d5da21d079244 100644 --- 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 @@ -11,11 +11,13 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in RegulatoryComplianceControlsClient. + */ public interface RegulatoryComplianceControlsClient { /** * 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. @@ -27,7 +29,7 @@ public interface RegulatoryComplianceControlsClient { /** * 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. @@ -37,12 +39,12 @@ public interface RegulatoryComplianceControlsClient { * @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); + PagedIterable list(String regulatoryComplianceStandardName, String filter, + 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. * @param context The context to associate with this operation. @@ -52,12 +54,12 @@ PagedIterable list( * @return regulatory compliance control details and state along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName, Context context); + 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. @@ -66,6 +68,6 @@ Response getWithResponse( * @return regulatory compliance control details and state. */ @ServiceMethod(returns = ReturnType.SINGLE) - RegulatoryComplianceControlInner get( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName); + RegulatoryComplianceControlInner get(String regulatoryComplianceStandardName, + String regulatoryComplianceControlName); } 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 index 8bb55a3a903c3..598e1cdedbd42 100644 --- 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 @@ -11,11 +11,13 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in RegulatoryComplianceStandardsClient. + */ public interface RegulatoryComplianceStandardsClient { /** * 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}. @@ -25,7 +27,7 @@ public interface RegulatoryComplianceStandardsClient { /** * 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. @@ -38,7 +40,7 @@ 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. @@ -47,12 +49,12 @@ public interface RegulatoryComplianceStandardsClient { * @return regulatory compliance standard details and state along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String regulatoryComplianceStandardName, Context context); + 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. diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ResourceProvidersClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ResourceProvidersClient.java new file mode 100644 index 0000000000000..ee02cca57a35a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ResourceProvidersClient.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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.GetSensitivitySettingsResponseInner; +import com.azure.resourcemanager.security.models.UpdateSensitivitySettingsRequest; + +/** + * An instance of this class provides access to all the operations defined in ResourceProvidersClient. + */ +public interface ResourceProvidersClient { + /** + * Updates 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 + updateSensitivitySettingsWithResponse(UpdateSensitivitySettingsRequest sensitivitySettings, Context context); + + /** + * Updates 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 updateSensitivitySettings(UpdateSensitivitySettingsRequest sensitivitySettings); + + /** + * 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 getSensitivitySettingsWithResponse(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 getSensitivitySettings(); +} 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 index 8b27a45f14e14..3997565dc2f1b 100644 --- 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 @@ -10,11 +10,13 @@ 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. */ +/** + * 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}. @@ -24,7 +26,7 @@ public interface SecureScoreControlDefinitionsClient { /** * 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. @@ -36,7 +38,7 @@ public interface SecureScoreControlDefinitionsClient { /** * 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}. @@ -46,7 +48,7 @@ public interface SecureScoreControlDefinitionsClient { /** * 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. 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 index 43be2302b12d4..feb333230160a 100644 --- 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 @@ -11,42 +11,44 @@ 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. */ +/** + * 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. + * 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}. + * @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. + * 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}. + * @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); + 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}. @@ -56,7 +58,7 @@ PagedIterable listBySecureScore( /** * 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. 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 index 777ef62405f00..6ae5d40458ad5 100644 --- 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 @@ -11,11 +11,13 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in SecureScoresClient. + */ public interface SecureScoresClient { /** * 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}. @@ -25,7 +27,7 @@ public interface SecureScoresClient { /** * 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. @@ -38,15 +40,15 @@ 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. + * 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}. + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String secureScoreName, Context context); @@ -54,9 +56,9 @@ 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. + * 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. diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityCenter.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityCenter.java index 3632a9b918151..e559f60d43ec3 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityCenter.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityCenter.java @@ -7,460 +7,532 @@ import com.azure.core.http.HttpPipeline; import java.time.Duration; -/** The interface for SecurityCenter class. */ +/** + * The interface for SecurityCenter class. + */ public interface SecurityCenter { /** * Gets Azure subscription ID. - * + * * @return the subscriptionId value. */ String getSubscriptionId(); /** * Gets server parameter. - * + * * @return the endpoint value. */ String getEndpoint(); /** * 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 MdeOnboardingsClient object to access its operations. - * - * @return the MdeOnboardingsClient object. + * Gets the LocationsClient object to access its operations. + * + * @return the LocationsClient object. */ - MdeOnboardingsClient getMdeOnboardings(); + LocationsClient getLocations(); /** - * Gets the CustomAssessmentAutomationsClient object to access its operations. - * - * @return the CustomAssessmentAutomationsClient object. + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. */ - CustomAssessmentAutomationsClient getCustomAssessmentAutomations(); + OperationsClient getOperations(); /** - * Gets the CustomEntityStoreAssignmentsClient object to access its operations. - * - * @return the CustomEntityStoreAssignmentsClient object. + * Gets the TasksClient object to access its operations. + * + * @return the TasksClient object. */ - CustomEntityStoreAssignmentsClient getCustomEntityStoreAssignments(); + TasksClient getTasks(); /** - * Gets the ComplianceResultsClient object to access its operations. - * - * @return the ComplianceResultsClient object. + * Gets the AutoProvisioningSettingsClient object to access its operations. + * + * @return the AutoProvisioningSettingsClient object. */ - ComplianceResultsClient getComplianceResults(); + AutoProvisioningSettingsClient getAutoProvisioningSettings(); /** - * Gets the PricingsClient object to access its operations. - * - * @return the PricingsClient object. + * Gets the CompliancesClient object to access its operations. + * + * @return the CompliancesClient object. */ - PricingsClient getPricings(); + CompliancesClient getCompliances(); /** - * Gets the AdvancedThreatProtectionsClient object to access its operations. - * - * @return the AdvancedThreatProtectionsClient object. + * Gets the InformationProtectionPoliciesClient object to access its operations. + * + * @return the InformationProtectionPoliciesClient object. */ - AdvancedThreatProtectionsClient getAdvancedThreatProtections(); + InformationProtectionPoliciesClient getInformationProtectionPolicies(); /** - * Gets the DeviceSecurityGroupsClient object to access its operations. - * - * @return the DeviceSecurityGroupsClient object. + * Gets the WorkspaceSettingsClient object to access its operations. + * + * @return the WorkspaceSettingsClient object. */ - DeviceSecurityGroupsClient getDeviceSecurityGroups(); + WorkspaceSettingsClient getWorkspaceSettings(); /** - * Gets the IotSecuritySolutionsClient object to access its operations. - * - * @return the IotSecuritySolutionsClient object. + * Gets the AlertsSuppressionRulesClient object to access its operations. + * + * @return the AlertsSuppressionRulesClient object. */ - IotSecuritySolutionsClient getIotSecuritySolutions(); + AlertsSuppressionRulesClient getAlertsSuppressionRules(); /** - * Gets the IotSecuritySolutionAnalyticsClient object to access its operations. - * - * @return the IotSecuritySolutionAnalyticsClient object. + * Gets the AutomationsClient object to access its operations. + * + * @return the AutomationsClient object. */ - IotSecuritySolutionAnalyticsClient getIotSecuritySolutionAnalytics(); + AutomationsClient getAutomations(); /** - * Gets the IotSecuritySolutionsAnalyticsAggregatedAlertsClient object to access its operations. - * - * @return the IotSecuritySolutionsAnalyticsAggregatedAlertsClient object. + * Gets the RegulatoryComplianceStandardsClient object to access its operations. + * + * @return the RegulatoryComplianceStandardsClient object. */ - IotSecuritySolutionsAnalyticsAggregatedAlertsClient getIotSecuritySolutionsAnalyticsAggregatedAlerts(); + RegulatoryComplianceStandardsClient getRegulatoryComplianceStandards(); /** - * Gets the IotSecuritySolutionsAnalyticsRecommendationsClient object to access its operations. - * - * @return the IotSecuritySolutionsAnalyticsRecommendationsClient object. + * Gets the RegulatoryComplianceControlsClient object to access its operations. + * + * @return the RegulatoryComplianceControlsClient object. */ - IotSecuritySolutionsAnalyticsRecommendationsClient getIotSecuritySolutionsAnalyticsRecommendations(); + RegulatoryComplianceControlsClient getRegulatoryComplianceControls(); /** - * Gets the LocationsClient object to access its operations. - * - * @return the LocationsClient object. + * Gets the RegulatoryComplianceAssessmentsClient object to access its operations. + * + * @return the RegulatoryComplianceAssessmentsClient object. */ - LocationsClient getLocations(); + RegulatoryComplianceAssessmentsClient getRegulatoryComplianceAssessments(); /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. + * Gets the SubAssessmentsClient object to access its operations. + * + * @return the SubAssessmentsClient object. */ - OperationsClient getOperations(); + SubAssessmentsClient getSubAssessments(); /** - * Gets the TasksClient object to access its operations. - * - * @return the TasksClient object. + * Gets the ConnectorsClient object to access its operations. + * + * @return the ConnectorsClient object. */ - TasksClient getTasks(); + ConnectorsClient getConnectors(); /** - * Gets the AutoProvisioningSettingsClient object to access its operations. - * - * @return the AutoProvisioningSettingsClient object. + * Gets the SecurityContactsClient object to access its operations. + * + * @return the SecurityContactsClient object. */ - AutoProvisioningSettingsClient getAutoProvisioningSettings(); + SecurityContactsClient getSecurityContacts(); /** - * Gets the CompliancesClient object to access its operations. - * - * @return the CompliancesClient object. + * Gets the SoftwareInventoriesClient object to access its operations. + * + * @return the SoftwareInventoriesClient object. */ - CompliancesClient getCompliances(); + SoftwareInventoriesClient getSoftwareInventories(); /** - * Gets the InformationProtectionPoliciesClient object to access its operations. - * - * @return the InformationProtectionPoliciesClient object. + * Gets the CustomAssessmentAutomationsClient object to access its operations. + * + * @return the CustomAssessmentAutomationsClient object. */ - InformationProtectionPoliciesClient getInformationProtectionPolicies(); + CustomAssessmentAutomationsClient getCustomAssessmentAutomations(); /** - * Gets the SecurityContactsClient object to access its operations. - * - * @return the SecurityContactsClient object. + * Gets the CustomEntityStoreAssignmentsClient object to access its operations. + * + * @return the CustomEntityStoreAssignmentsClient object. */ - SecurityContactsClient getSecurityContacts(); + CustomEntityStoreAssignmentsClient getCustomEntityStoreAssignments(); /** - * Gets the WorkspaceSettingsClient object to access its operations. - * - * @return the WorkspaceSettingsClient object. + * Gets the MdeOnboardingsClient object to access its operations. + * + * @return the MdeOnboardingsClient object. */ - WorkspaceSettingsClient getWorkspaceSettings(); + MdeOnboardingsClient getMdeOnboardings(); /** - * Gets the RegulatoryComplianceStandardsClient object to access its operations. - * - * @return the RegulatoryComplianceStandardsClient object. + * Gets the GovernanceAssignmentsClient object to access its operations. + * + * @return the GovernanceAssignmentsClient object. */ - RegulatoryComplianceStandardsClient getRegulatoryComplianceStandards(); + GovernanceAssignmentsClient getGovernanceAssignments(); /** - * Gets the RegulatoryComplianceControlsClient object to access its operations. - * - * @return the RegulatoryComplianceControlsClient object. + * Gets the GovernanceRulesClient object to access its operations. + * + * @return the GovernanceRulesClient object. */ - RegulatoryComplianceControlsClient getRegulatoryComplianceControls(); + GovernanceRulesClient getGovernanceRules(); /** - * Gets the RegulatoryComplianceAssessmentsClient object to access its operations. - * - * @return the RegulatoryComplianceAssessmentsClient object. + * Gets the ApplicationsClient object to access its operations. + * + * @return the ApplicationsClient object. */ - RegulatoryComplianceAssessmentsClient getRegulatoryComplianceAssessments(); + ApplicationsClient getApplications(); /** - * Gets the SubAssessmentsClient object to access its operations. - * - * @return the SubAssessmentsClient object. + * Gets the ApplicationOperationsClient object to access its operations. + * + * @return the ApplicationOperationsClient object. */ - SubAssessmentsClient getSubAssessments(); + ApplicationOperationsClient getApplicationOperations(); /** - * Gets the AutomationsClient object to access its operations. - * - * @return the AutomationsClient object. + * Gets the SecurityConnectorApplicationsClient object to access its operations. + * + * @return the SecurityConnectorApplicationsClient object. */ - AutomationsClient getAutomations(); + SecurityConnectorApplicationsClient getSecurityConnectorApplications(); /** - * Gets the AlertsSuppressionRulesClient object to access its operations. - * - * @return the AlertsSuppressionRulesClient object. + * Gets the SecurityConnectorApplicationOperationsClient object to access its operations. + * + * @return the SecurityConnectorApplicationOperationsClient object. */ - AlertsSuppressionRulesClient getAlertsSuppressionRules(); + SecurityConnectorApplicationOperationsClient getSecurityConnectorApplicationOperations(); /** - * Gets the ServerVulnerabilityAssessmentsClient object to access its operations. - * - * @return the ServerVulnerabilityAssessmentsClient object. + * Gets the DefenderForStoragesClient object to access its operations. + * + * @return the DefenderForStoragesClient object. */ - ServerVulnerabilityAssessmentsClient getServerVulnerabilityAssessments(); + DefenderForStoragesClient getDefenderForStorages(); /** - * Gets the AssessmentsMetadatasClient object to access its operations. - * - * @return the AssessmentsMetadatasClient object. + * Gets the SecurityOperatorsClient object to access its operations. + * + * @return the SecurityOperatorsClient object. */ - AssessmentsMetadatasClient getAssessmentsMetadatas(); + SecurityOperatorsClient getSecurityOperators(); /** - * Gets the AssessmentsClient object to access its operations. - * - * @return the AssessmentsClient object. + * Gets the SqlVulnerabilityAssessmentBaselineRulesClient object to access its operations. + * + * @return the SqlVulnerabilityAssessmentBaselineRulesClient object. */ - AssessmentsClient getAssessments(); + SqlVulnerabilityAssessmentBaselineRulesClient getSqlVulnerabilityAssessmentBaselineRules(); /** - * Gets the AdaptiveApplicationControlsClient object to access its operations. - * - * @return the AdaptiveApplicationControlsClient object. + * Gets the SqlVulnerabilityAssessmentScansClient object to access its operations. + * + * @return the SqlVulnerabilityAssessmentScansClient object. */ - AdaptiveApplicationControlsClient getAdaptiveApplicationControls(); + SqlVulnerabilityAssessmentScansClient getSqlVulnerabilityAssessmentScans(); /** - * Gets the AdaptiveNetworkHardeningsClient object to access its operations. - * - * @return the AdaptiveNetworkHardeningsClient object. + * Gets the SqlVulnerabilityAssessmentScanResultsClient object to access its operations. + * + * @return the SqlVulnerabilityAssessmentScanResultsClient object. */ - AdaptiveNetworkHardeningsClient getAdaptiveNetworkHardenings(); + SqlVulnerabilityAssessmentScanResultsClient getSqlVulnerabilityAssessmentScanResults(); /** - * Gets the AllowedConnectionsClient object to access its operations. - * - * @return the AllowedConnectionsClient object. + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. */ - AllowedConnectionsClient getAllowedConnections(); + ResourceProvidersClient getResourceProviders(); /** - * Gets the TopologiesClient object to access its operations. - * - * @return the TopologiesClient object. + * Gets the SensitivitySettingsClient object to access its operations. + * + * @return the SensitivitySettingsClient object. */ - TopologiesClient getTopologies(); + SensitivitySettingsClient getSensitivitySettings(); /** - * Gets the JitNetworkAccessPoliciesClient object to access its operations. - * - * @return the JitNetworkAccessPoliciesClient object. + * Gets the HealthReportsClient object to access its operations. + * + * @return the HealthReportsClient object. */ - JitNetworkAccessPoliciesClient getJitNetworkAccessPolicies(); + HealthReportsClient getHealthReports(); /** - * Gets the DiscoveredSecuritySolutionsClient object to access its operations. - * - * @return the DiscoveredSecuritySolutionsClient object. + * Gets the AzureDevOpsOrgsClient object to access its operations. + * + * @return the AzureDevOpsOrgsClient object. */ - DiscoveredSecuritySolutionsClient getDiscoveredSecuritySolutions(); + AzureDevOpsOrgsClient getAzureDevOpsOrgs(); /** - * Gets the SecuritySolutionsReferenceDatasClient object to access its operations. - * - * @return the SecuritySolutionsReferenceDatasClient object. + * Gets the AzureDevOpsProjectsClient object to access its operations. + * + * @return the AzureDevOpsProjectsClient object. */ - SecuritySolutionsReferenceDatasClient getSecuritySolutionsReferenceDatas(); + AzureDevOpsProjectsClient getAzureDevOpsProjects(); /** - * Gets the ExternalSecuritySolutionsClient object to access its operations. - * - * @return the ExternalSecuritySolutionsClient object. + * Gets the AzureDevOpsReposClient object to access its operations. + * + * @return the AzureDevOpsReposClient object. */ - ExternalSecuritySolutionsClient getExternalSecuritySolutions(); + AzureDevOpsReposClient getAzureDevOpsRepos(); /** - * Gets the SecureScoresClient object to access its operations. - * - * @return the SecureScoresClient object. + * Gets the DevOpsConfigurationsClient object to access its operations. + * + * @return the DevOpsConfigurationsClient object. */ - SecureScoresClient getSecureScores(); + DevOpsConfigurationsClient getDevOpsConfigurations(); /** - * Gets the SecureScoreControlsClient object to access its operations. - * - * @return the SecureScoreControlsClient object. + * Gets the GitHubOwnersClient object to access its operations. + * + * @return the GitHubOwnersClient object. */ - SecureScoreControlsClient getSecureScoreControls(); + GitHubOwnersClient getGitHubOwners(); /** - * Gets the SecureScoreControlDefinitionsClient object to access its operations. - * - * @return the SecureScoreControlDefinitionsClient object. + * Gets the GitHubReposClient object to access its operations. + * + * @return the GitHubReposClient object. */ - SecureScoreControlDefinitionsClient getSecureScoreControlDefinitions(); + GitHubReposClient getGitHubRepos(); /** - * Gets the SecuritySolutionsClient object to access its operations. - * - * @return the SecuritySolutionsClient object. + * Gets the GitLabGroupsClient object to access its operations. + * + * @return the GitLabGroupsClient object. */ - SecuritySolutionsClient getSecuritySolutions(); + GitLabGroupsClient getGitLabGroups(); /** - * Gets the ConnectorsClient object to access its operations. - * - * @return the ConnectorsClient object. + * Gets the GitLabSubgroupsClient object to access its operations. + * + * @return the GitLabSubgroupsClient object. */ - ConnectorsClient getConnectors(); + GitLabSubgroupsClient getGitLabSubgroups(); /** - * Gets the AlertsClient object to access its operations. - * - * @return the AlertsClient object. + * Gets the GitLabProjectsClient object to access its operations. + * + * @return the GitLabProjectsClient object. */ - AlertsClient getAlerts(); + GitLabProjectsClient getGitLabProjects(); /** - * Gets the SettingsClient object to access its operations. - * - * @return the SettingsClient object. + * Gets the DevOpsOperationResultsClient object to access its operations. + * + * @return the DevOpsOperationResultsClient object. */ - SettingsClient getSettings(); + DevOpsOperationResultsClient getDevOpsOperationResults(); /** - * Gets the IngestionSettingsClient object to access its operations. - * - * @return the IngestionSettingsClient object. + * Gets the SecurityConnectorsClient object to access its operations. + * + * @return the SecurityConnectorsClient object. */ - IngestionSettingsClient getIngestionSettings(); + SecurityConnectorsClient getSecurityConnectors(); /** - * Gets the SoftwareInventoriesClient object to access its operations. - * - * @return the SoftwareInventoriesClient object. + * Gets the ComplianceResultsClient object to access its operations. + * + * @return the ComplianceResultsClient object. */ - SoftwareInventoriesClient getSoftwareInventories(); + ComplianceResultsClient getComplianceResults(); /** - * Gets the GovernanceRulesClient object to access its operations. - * - * @return the GovernanceRulesClient object. + * Gets the AdvancedThreatProtectionsClient object to access its operations. + * + * @return the AdvancedThreatProtectionsClient object. */ - GovernanceRulesClient getGovernanceRules(); + AdvancedThreatProtectionsClient getAdvancedThreatProtections(); /** - * Gets the GovernanceAssignmentsClient object to access its operations. - * - * @return the GovernanceAssignmentsClient object. + * Gets the DeviceSecurityGroupsClient object to access its operations. + * + * @return the DeviceSecurityGroupsClient object. */ - GovernanceAssignmentsClient getGovernanceAssignments(); + DeviceSecurityGroupsClient getDeviceSecurityGroups(); /** - * Gets the ApplicationsClient object to access its operations. - * - * @return the ApplicationsClient object. + * Gets the IotSecuritySolutionAnalyticsClient object to access its operations. + * + * @return the IotSecuritySolutionAnalyticsClient object. */ - ApplicationsClient getApplications(); + IotSecuritySolutionAnalyticsClient getIotSecuritySolutionAnalytics(); /** - * Gets the ApplicationOperationsClient object to access its operations. - * - * @return the ApplicationOperationsClient object. + * Gets the IotSecuritySolutionsAnalyticsAggregatedAlertsClient object to access its operations. + * + * @return the IotSecuritySolutionsAnalyticsAggregatedAlertsClient object. */ - ApplicationOperationsClient getApplicationOperations(); + IotSecuritySolutionsAnalyticsAggregatedAlertsClient getIotSecuritySolutionsAnalyticsAggregatedAlerts(); /** - * Gets the SecurityConnectorApplicationsClient object to access its operations. - * - * @return the SecurityConnectorApplicationsClient object. + * Gets the IotSecuritySolutionsAnalyticsRecommendationsClient object to access its operations. + * + * @return the IotSecuritySolutionsAnalyticsRecommendationsClient object. */ - SecurityConnectorApplicationsClient getSecurityConnectorApplications(); + IotSecuritySolutionsAnalyticsRecommendationsClient getIotSecuritySolutionsAnalyticsRecommendations(); /** - * Gets the SecurityConnectorApplicationOperationsClient object to access its operations. - * - * @return the SecurityConnectorApplicationOperationsClient object. + * Gets the IotSecuritySolutionsClient object to access its operations. + * + * @return the IotSecuritySolutionsClient object. */ - SecurityConnectorApplicationOperationsClient getSecurityConnectorApplicationOperations(); + IotSecuritySolutionsClient getIotSecuritySolutions(); /** - * Gets the ApiCollectionsClient object to access its operations. - * - * @return the ApiCollectionsClient object. + * Gets the AdaptiveNetworkHardeningsClient object to access its operations. + * + * @return the AdaptiveNetworkHardeningsClient object. */ - ApiCollectionsClient getApiCollections(); + AdaptiveNetworkHardeningsClient getAdaptiveNetworkHardenings(); /** - * Gets the ApiCollectionOnboardingsClient object to access its operations. - * - * @return the ApiCollectionOnboardingsClient object. + * Gets the AllowedConnectionsClient object to access its operations. + * + * @return the AllowedConnectionsClient object. */ - ApiCollectionOnboardingsClient getApiCollectionOnboardings(); + AllowedConnectionsClient getAllowedConnections(); /** - * Gets the ApiCollectionOffboardingsClient object to access its operations. - * - * @return the ApiCollectionOffboardingsClient object. + * Gets the AdaptiveApplicationControlsClient object to access its operations. + * + * @return the AdaptiveApplicationControlsClient object. */ - ApiCollectionOffboardingsClient getApiCollectionOffboardings(); + AdaptiveApplicationControlsClient getAdaptiveApplicationControls(); /** - * Gets the HealthReportsClient object to access its operations. - * - * @return the HealthReportsClient object. + * Gets the DiscoveredSecuritySolutionsClient object to access its operations. + * + * @return the DiscoveredSecuritySolutionsClient object. */ - HealthReportsClient getHealthReports(); + DiscoveredSecuritySolutionsClient getDiscoveredSecuritySolutions(); /** - * Gets the HealthReportOperationsClient object to access its operations. - * - * @return the HealthReportOperationsClient object. + * Gets the ExternalSecuritySolutionsClient object to access its operations. + * + * @return the ExternalSecuritySolutionsClient object. */ - HealthReportOperationsClient getHealthReportOperations(); + ExternalSecuritySolutionsClient getExternalSecuritySolutions(); /** - * Gets the SqlVulnerabilityAssessmentScansClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentScansClient object. + * Gets the JitNetworkAccessPoliciesClient object to access its operations. + * + * @return the JitNetworkAccessPoliciesClient object. */ - SqlVulnerabilityAssessmentScansClient getSqlVulnerabilityAssessmentScans(); + JitNetworkAccessPoliciesClient getJitNetworkAccessPolicies(); /** - * Gets the SqlVulnerabilityAssessmentScanResultsClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentScanResultsClient object. + * Gets the SecureScoresClient object to access its operations. + * + * @return the SecureScoresClient object. */ - SqlVulnerabilityAssessmentScanResultsClient getSqlVulnerabilityAssessmentScanResults(); + SecureScoresClient getSecureScores(); /** - * Gets the SqlVulnerabilityAssessmentBaselineRulesClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentBaselineRulesClient object. + * Gets the SecureScoreControlsClient object to access its operations. + * + * @return the SecureScoreControlsClient object. */ - SqlVulnerabilityAssessmentBaselineRulesClient getSqlVulnerabilityAssessmentBaselineRules(); + SecureScoreControlsClient getSecureScoreControls(); /** - * Gets the SecurityConnectorsClient object to access its operations. - * - * @return the SecurityConnectorsClient object. + * Gets the SecureScoreControlDefinitionsClient object to access its operations. + * + * @return the SecureScoreControlDefinitionsClient object. */ - SecurityConnectorsClient getSecurityConnectors(); + SecureScoreControlDefinitionsClient getSecureScoreControlDefinitions(); /** - * Gets the SecurityOperatorsClient object to access its operations. - * - * @return the SecurityOperatorsClient object. + * Gets the SecuritySolutionsClient object to access its operations. + * + * @return the SecuritySolutionsClient object. */ - SecurityOperatorsClient getSecurityOperators(); + SecuritySolutionsClient getSecuritySolutions(); + + /** + * Gets the SecuritySolutionsReferenceDatasClient object to access its operations. + * + * @return the SecuritySolutionsReferenceDatasClient object. + */ + SecuritySolutionsReferenceDatasClient getSecuritySolutionsReferenceDatas(); + + /** + * 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 AssessmentsMetadatasClient object to access its operations. + * + * @return the AssessmentsMetadatasClient object. + */ + AssessmentsMetadatasClient getAssessmentsMetadatas(); + + /** + * Gets the AssessmentsClient object to access its operations. + * + * @return the AssessmentsClient object. + */ + AssessmentsClient getAssessments(); + + /** + * Gets the AlertsClient object to access its operations. + * + * @return the AlertsClient object. + */ + AlertsClient getAlerts(); + + /** + * Gets the SettingsClient object to access its operations. + * + * @return the SettingsClient object. + */ + SettingsClient getSettings(); + + /** + * Gets the ServerVulnerabilityAssessmentsSettingsClient object to access its operations. + * + * @return the ServerVulnerabilityAssessmentsSettingsClient object. + */ + ServerVulnerabilityAssessmentsSettingsClient getServerVulnerabilityAssessmentsSettings(); + + /** + * Gets the ApiCollectionsClient object to access its operations. + * + * @return the ApiCollectionsClient object. + */ + ApiCollectionsClient getApiCollections(); + + /** + * Gets the PricingsClient object to access its operations. + * + * @return the PricingsClient object. + */ + PricingsClient getPricings(); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorApplicationOperationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorApplicationOperationsClient.java index 019e8eefacc01..8a5151b952815 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorApplicationOperationsClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorApplicationOperationsClient.java @@ -17,9 +17,9 @@ public interface SecurityConnectorApplicationOperationsClient { /** * Get a specific application for the requested scope by applicationId. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -29,14 +29,14 @@ public interface SecurityConnectorApplicationOperationsClient { * @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); + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -49,9 +49,9 @@ Response getWithResponse( /** * Creates or update a security Application on the given security connector. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -62,18 +62,14 @@ Response getWithResponse( * @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); + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -83,14 +79,14 @@ Response createOrUpdateWithResponse( * @return security Application over a given scope. */ @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationInner createOrUpdate( - String resourceGroupName, String securityConnectorName, String applicationId, ApplicationInner application); + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -100,14 +96,14 @@ ApplicationInner createOrUpdate( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String securityConnectorName, String applicationId, Context context); + 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 within the user's subscription. The name is case - * insensitive. + * 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. 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 index bafeb6ef94d41..fd9ab063f4d8c 100644 --- 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 @@ -10,35 +10,37 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in SecurityConnectorApplicationsClient. + */ public interface SecurityConnectorApplicationsClient { /** * Get a list of all relevant applications over a security connector level scope. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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}. + * {@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 within the user's subscription. The name is case - * insensitive. + * 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}. + * {@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 index a1a51a3fcf9cb..c213bebdc82b5 100644 --- 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 @@ -11,12 +11,14 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in SecurityConnectorsClient. + */ public interface SecurityConnectorsClient { /** * 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}. @@ -27,7 +29,7 @@ public interface SecurityConnectorsClient { /** * 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. @@ -40,9 +42,9 @@ public interface SecurityConnectorsClient { /** * 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -54,9 +56,9 @@ public interface SecurityConnectorsClient { /** * 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -68,9 +70,9 @@ public interface SecurityConnectorsClient { /** * Retrieves details of a specific security connector. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param securityConnectorName The security connector name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -79,14 +81,14 @@ public interface SecurityConnectorsClient { * @return the security connector resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String securityConnectorName, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, + String securityConnectorName, Context context); /** * Retrieves details of a specific security connector. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -99,9 +101,9 @@ Response getByResourceGroupWithResponse( /** * 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param securityConnectorName The security connector name. * @param securityConnector The security connector resource. * @param context The context to associate with this operation. @@ -111,18 +113,15 @@ Response getByResourceGroupWithResponse( * @return the security connector resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String securityConnectorName, - SecurityConnectorInner securityConnector, - Context context); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param securityConnectorName The security connector name. * @param securityConnector The security connector resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -131,14 +130,14 @@ Response createOrUpdateWithResponse( * @return the security connector resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - SecurityConnectorInner createOrUpdate( - String resourceGroupName, String securityConnectorName, SecurityConnectorInner securityConnector); + SecurityConnectorInner createOrUpdate(String resourceGroupName, String securityConnectorName, + SecurityConnectorInner securityConnector); /** * Updates a security connector. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param securityConnectorName The security connector name. * @param securityConnector The security connector resource. * @param context The context to associate with this operation. @@ -148,17 +147,14 @@ SecurityConnectorInner createOrUpdate( * @return the security connector resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String securityConnectorName, - SecurityConnectorInner securityConnector, - Context context); + Response updateWithResponse(String resourceGroupName, String securityConnectorName, + SecurityConnectorInner securityConnector, Context context); /** * Updates a security connector. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param securityConnectorName The security connector name. * @param securityConnector The security connector resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -167,14 +163,14 @@ Response updateWithResponse( * @return the security connector resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - SecurityConnectorInner update( - String resourceGroupName, String securityConnectorName, SecurityConnectorInner securityConnector); + SecurityConnectorInner update(String resourceGroupName, String securityConnectorName, + SecurityConnectorInner securityConnector); /** * Deletes a security connector. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param securityConnectorName The security connector name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -187,9 +183,9 @@ SecurityConnectorInner update( /** * Deletes a security connector. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. 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 index ab1c6851f948f..ed6a348f7243b 100644 --- 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 @@ -10,12 +10,15 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in SecurityContactsClient. + */ public interface SecurityContactsClient { /** * 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}. @@ -25,7 +28,7 @@ public interface SecurityContactsClient { /** * 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. @@ -37,7 +40,7 @@ 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. @@ -46,11 +49,11 @@ public interface SecurityContactsClient { * @return default Security contact configurations for the subscription along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String securityContactName, Context context); + 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. @@ -58,11 +61,11 @@ public interface SecurityContactsClient { * @return default Security contact configurations for the subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - SecurityContactInner get(String securityContactName); + 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. @@ -70,15 +73,15 @@ public interface SecurityContactsClient { * @throws com.azure.core.management.exception.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}. + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String securityContactName, SecurityContactInner securityContact, Context context); + 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. @@ -87,11 +90,11 @@ Response createWithResponse( * @return contact details and configurations for notifications coming from Microsoft Defender for Cloud. */ @ServiceMethod(returns = ReturnType.SINGLE) - SecurityContactInner create(String securityContactName, SecurityContactInner securityContact); + 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. @@ -100,16 +103,16 @@ Response createWithResponse( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String securityContactName, Context context); + 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(String securityContactName); + void delete(SecurityContactName securityContactName); } 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 index bd785ec861db9..1971f46dd42ef 100644 --- 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 @@ -11,11 +11,13 @@ import com.azure.resourcemanager.security.fluent.models.SecurityOperatorInner; import com.azure.resourcemanager.security.fluent.models.SecurityOperatorListInner; -/** An instance of this class provides access to all the operations defined in SecurityOperatorsClient. */ +/** + * An instance of this class provides access to all the operations defined in SecurityOperatorsClient. + */ public interface SecurityOperatorsClient { /** * 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. @@ -28,7 +30,7 @@ public interface SecurityOperatorsClient { /** * 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. @@ -40,7 +42,7 @@ public interface SecurityOperatorsClient { /** * Get a specific security operator for the requested scope. - * + * * @param pricingName name of the pricing configuration. * @param securityOperatorName name of the securityOperator. * @param context The context to associate with this operation. @@ -54,7 +56,7 @@ public interface SecurityOperatorsClient { /** * Get a specific security operator for the requested scope. - * + * * @param pricingName name of the pricing configuration. * @param securityOperatorName name of the securityOperator. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -67,7 +69,7 @@ public interface SecurityOperatorsClient { /** * Creates Microsoft Defender for Cloud security operator on the given scope. - * + * * @param pricingName name of the pricing configuration. * @param securityOperatorName name of the securityOperator. * @param context The context to associate with this operation. @@ -77,12 +79,12 @@ public interface SecurityOperatorsClient { * @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); + 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 securityOperator. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -95,7 +97,7 @@ Response createOrUpdateWithResponse( /** * Delete Microsoft Defender for Cloud securityOperator in the subscription. - * + * * @param pricingName name of the pricing configuration. * @param securityOperatorName name of the securityOperator. * @param context The context to associate with this operation. @@ -109,7 +111,7 @@ Response createOrUpdateWithResponse( /** * Delete Microsoft Defender for Cloud securityOperator in the subscription. - * + * * @param pricingName name of the pricing configuration. * @param securityOperatorName name of the securityOperator. * @throws IllegalArgumentException thrown if parameters fail the validation. 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 index 172a35c22dd14..f922c9711f74c 100644 --- 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 @@ -11,11 +11,13 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in SecuritySolutionsClient. + */ public interface SecuritySolutionsClient { /** * 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}. @@ -25,7 +27,7 @@ public interface SecuritySolutionsClient { /** * 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. @@ -37,11 +39,11 @@ public interface SecuritySolutionsClient { /** * Gets a specific Security Solution. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param securitySolutionName Name of security solution. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -50,16 +52,16 @@ public interface SecuritySolutionsClient { * @return a specific Security Solution along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String ascLocation, String securitySolutionName, Context context); + Response getWithResponse(String resourceGroupName, String ascLocation, + String securitySolutionName, Context context); /** * Gets a specific Security Solution. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. 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 index 2e07125883e6c..a9a8c60b23a64 100644 --- 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 @@ -10,11 +10,13 @@ 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. */ +/** + * 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. @@ -26,7 +28,7 @@ public interface SecuritySolutionsReferenceDatasClient { /** * 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. @@ -36,9 +38,9 @@ public interface SecuritySolutionsReferenceDatasClient { /** * 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. + * 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. @@ -50,9 +52,9 @@ public interface SecuritySolutionsReferenceDatasClient { /** * 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. + * 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. diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/HealthReportOperationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SensitivitySettingsClient.java similarity index 52% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/HealthReportOperationsClient.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SensitivitySettingsClient.java index 9127fc7b309b8..b8884846a989a 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/HealthReportOperationsClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SensitivitySettingsClient.java @@ -8,34 +8,31 @@ 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.HealthReportInner; +import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsListResponseInner; -/** An instance of this class provides access to all the operations defined in HealthReportOperationsClient. */ -public interface HealthReportOperationsClient { +/** + * An instance of this class provides access to all the operations defined in SensitivitySettingsClient. + */ +public interface SensitivitySettingsClient { /** - * Get health report of resource. - * - * @param resourceId The identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report type. + * 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 health report of resource along with {@link Response}. + * @return a list with a single sensitivity settings resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceId, String healthReportName, Context context); + Response listWithResponse(Context context); /** - * Get health report of resource. - * - * @param resourceId The identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report type. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * 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 health report of resource. + * @return a list with a single sensitivity settings resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - HealthReportInner get(String resourceId, String healthReportName); + 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 index 26e9c4152c359..375d8f3879e30 100644 --- 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 @@ -13,13 +13,15 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in ServerVulnerabilityAssessmentsClient. + */ public interface ServerVulnerabilityAssessmentsClient { /** * Gets a list of server vulnerability assessment onboarding statuses on a given resource. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -27,18 +29,18 @@ public interface ServerVulnerabilityAssessmentsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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}. + * @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); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -48,14 +50,14 @@ Response listByExtendedResourceWithResp * @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); + ServerVulnerabilityAssessmentsListInner listByExtendedResource(String resourceGroupName, String resourceNamespace, + String resourceType, String resourceName); /** * Gets a server vulnerability assessment onboarding statuses on a given resource. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -66,14 +68,14 @@ ServerVulnerabilityAssessmentsListInner listByExtendedResource( * @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); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -83,15 +85,15 @@ Response getWithResponse( * @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); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -102,15 +104,15 @@ ServerVulnerabilityAssessmentInner get( * @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); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -120,14 +122,14 @@ Response createOrUpdateWithResponse( * @return describes the server vulnerability assessment details on a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - ServerVulnerabilityAssessmentInner createOrUpdate( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -137,14 +139,14 @@ ServerVulnerabilityAssessmentInner createOrUpdate( * @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); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -155,14 +157,14 @@ SyncPoller, Void> beginDelete( * @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); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -175,9 +177,9 @@ SyncPoller, Void> beginDelete( /** * Removing server vulnerability assessment from a resource. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -187,6 +189,6 @@ SyncPoller, Void> beginDelete( * @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); + void delete(String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, + Context context); } 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 new file mode 100644 index 0000000000000..10e3f00b359f5 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ServerVulnerabilityAssessmentsSettingsClient.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 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); + + /** + * 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); +} 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 index 1d2ca46fd4b9a..18ef6bb2b741e 100644 --- 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 @@ -10,13 +10,15 @@ 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; +import com.azure.resourcemanager.security.models.SettingNameAutoGenerated; -/** An instance of this class provides access to all the operations defined in SettingsClient. */ +/** + * An instance of this class provides access to all the operations defined in SettingsClient. + */ public interface SettingsClient { /** * 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}. @@ -26,7 +28,7 @@ public interface SettingsClient { /** * 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. @@ -38,7 +40,7 @@ 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. @@ -47,11 +49,11 @@ public interface SettingsClient { * @return the kind of the security setting along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(SettingName settingName, Context context); + Response getWithResponse(SettingNameAutoGenerated 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. @@ -59,11 +61,11 @@ public interface SettingsClient { * @return the kind of the security setting. */ @ServiceMethod(returns = ReturnType.SINGLE) - SettingInner get(SettingName settingName); + SettingInner get(SettingNameAutoGenerated 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. @@ -73,11 +75,12 @@ public interface SettingsClient { * @return the kind of the security setting along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(SettingName settingName, SettingInner setting, Context context); + Response updateWithResponse(SettingNameAutoGenerated 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. @@ -86,5 +89,5 @@ public interface SettingsClient { * @return the kind of the security setting. */ @ServiceMethod(returns = ReturnType.SINGLE) - SettingInner update(SettingName settingName, SettingInner setting); + SettingInner update(SettingNameAutoGenerated settingName, SettingInner setting); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SoftwareInventoriesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SoftwareInventoriesClient.java index 68430027e1942..44c87aa6b3438 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SoftwareInventoriesClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SoftwareInventoriesClient.java @@ -11,13 +11,15 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.security.fluent.models.SoftwareInner; -/** An instance of this class provides access to all the operations defined in SoftwareInventoriesClient. */ +/** + * An instance of this class provides access to all the operations defined in SoftwareInventoriesClient. + */ public interface SoftwareInventoriesClient { /** * Gets the software inventory of the virtual machine. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -27,14 +29,14 @@ public interface SoftwareInventoriesClient { * @return the software inventory of the virtual machine as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName); + PagedIterable listByExtendedResource(String resourceGroupName, String resourceNamespace, + String resourceType, String resourceName); /** * Gets the software inventory of the virtual machine. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -45,38 +47,38 @@ PagedIterable listByExtendedResource( * @return the software inventory of the virtual machine as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context); + PagedIterable listByExtendedResource(String resourceGroupName, String resourceNamespace, + String resourceType, String resourceName, Context context); /** * Gets the software inventory of all virtual machines in 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 the software inventory of all virtual machines in the subscriptions as paginated response with {@link - * PagedIterable}. + * @return the software inventory of all virtual machines in the subscriptions as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** * Gets the software inventory of all virtual machines in 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 the software inventory of all virtual machines in the subscriptions as paginated response with {@link - * PagedIterable}. + * @return the software inventory of all virtual machines in the subscriptions as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); /** * Gets a single software data of the virtual machine. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -88,19 +90,14 @@ PagedIterable listByExtendedResource( * @return a single software data of the virtual machine along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String softwareName, - Context context); + Response getWithResponse(String resourceGroupName, String resourceNamespace, String resourceType, + String resourceName, String softwareName, Context context); /** * Gets a single software data of the virtual machine. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -111,10 +108,6 @@ Response getWithResponse( * @return a single software data of the virtual machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - SoftwareInner get( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, + SoftwareInner get(String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, String softwareName); } 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 index 01e57856a5c64..4ddb2758ac869 100644 --- 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 @@ -20,7 +20,7 @@ public interface SqlVulnerabilityAssessmentBaselineRulesClient { /** * Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - * + * * @param ruleId The rule Id. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -32,12 +32,12 @@ public interface SqlVulnerabilityAssessmentBaselineRulesClient { * @return rule results along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String ruleId, String workspaceId, String resourceId, RuleResultsInput body, Context context); + Response createOrUpdateWithResponse(String ruleId, String workspaceId, String resourceId, + RuleResultsInput body, Context context); /** * Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - * + * * @param ruleId The rule Id. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -51,7 +51,7 @@ Response createOrUpdateWithResponse( /** * Gets the results for a given rule in the Baseline. - * + * * @param ruleId The rule Id. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -66,7 +66,7 @@ Response createOrUpdateWithResponse( /** * Gets the results for a given rule in the Baseline. - * + * * @param ruleId The rule Id. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -80,7 +80,7 @@ Response createOrUpdateWithResponse( /** * Deletes a rule from the Baseline of a given database. - * + * * @param ruleId The rule Id. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -95,7 +95,7 @@ Response createOrUpdateWithResponse( /** * Deletes a rule from the Baseline of a given database. - * + * * @param ruleId The rule Id. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -108,7 +108,7 @@ Response createOrUpdateWithResponse( /** * Gets the results for all rules in the Baseline. - * + * * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. * @param context The context to associate with this operation. @@ -122,7 +122,7 @@ Response createOrUpdateWithResponse( /** * Gets the results for all rules in the Baseline. - * + * * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -135,7 +135,7 @@ Response createOrUpdateWithResponse( /** * Add a list of baseline rules. Will overwrite any previously existing results (for all rules). - * + * * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. * @param body The baseline rules. @@ -146,12 +146,12 @@ Response createOrUpdateWithResponse( * @return a list of rules results along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response addWithResponse( - String workspaceId, String resourceId, RulesResultsInput body, Context context); + Response addWithResponse(String workspaceId, String resourceId, RulesResultsInput body, + Context context); /** * Add a list of baseline rules. Will overwrite any previously existing results (for all rules). - * + * * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. 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 index 9ab7d96a286fc..c669c0462cd7b 100644 --- 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 @@ -18,7 +18,7 @@ public interface SqlVulnerabilityAssessmentScanResultsClient { /** * Gets the scan results of a single rule in a scan record. - * + * * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. * @param scanResultId The rule Id of the results. * @param workspaceId The workspace Id. @@ -30,12 +30,12 @@ public interface SqlVulnerabilityAssessmentScanResultsClient { * @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 workspaceId, String resourceId, Context context); + Response getWithResponse(String scanId, String scanResultId, String workspaceId, String resourceId, + Context context); /** * Gets the scan results of a single rule in a scan record. - * + * * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. * @param scanResultId The rule Id of the results. * @param workspaceId The workspace Id. @@ -50,7 +50,7 @@ Response getWithResponse( /** * Gets a list of scan results for a single scan record. - * + * * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -65,7 +65,7 @@ Response getWithResponse( /** * Gets a list of scan results for a single scan record. - * + * * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. 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 index c586949d0f773..d87cdc9a55830 100644 --- 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 @@ -11,11 +11,13 @@ import com.azure.resourcemanager.security.fluent.models.ScanInner; import com.azure.resourcemanager.security.fluent.models.ScansInner; -/** An instance of this class provides access to all the operations defined in SqlVulnerabilityAssessmentScansClient. */ +/** + * An instance of this class provides access to all the operations defined in SqlVulnerabilityAssessmentScansClient. + */ public interface SqlVulnerabilityAssessmentScansClient { /** * 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 workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -30,7 +32,7 @@ public interface SqlVulnerabilityAssessmentScansClient { /** * 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 workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -44,7 +46,7 @@ public interface SqlVulnerabilityAssessmentScansClient { /** * Gets a list of scan records. - * + * * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. * @param context The context to associate with this operation. @@ -58,7 +60,7 @@ public interface SqlVulnerabilityAssessmentScansClient { /** * Gets a list of scan records. - * + * * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. 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 index 84dfe1f4ca079..4c3cc7e17d9d7 100644 --- 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 @@ -11,73 +11,75 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in SubAssessmentsClient. + */ public interface SubAssessmentsClient { /** * Get security sub-assessments on all your scanned resources inside a subscription scope. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * 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 Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listAll(String scope, Context context); /** * Get security sub-assessments on all your scanned resources inside a scope. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @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 security sub-assessments on all your scanned resources inside a scope as paginated response with {@link - * PagedIterable}. + * @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 Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @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 security sub-assessments on all your scanned resources inside a scope as paginated response with {@link - * PagedIterable}. + * @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 a security sub-assessment on your scanned resource. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param assessmentName The 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. @@ -87,14 +89,14 @@ public interface SubAssessmentsClient { * @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); + Response getWithResponse(String scope, String assessmentName, String subAssessmentName, + Context context); /** * Get a security sub-assessment on your scanned resource. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param assessmentName The 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. 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 index a2c5a01a49be2..5e45193f7e01e 100644 --- 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 @@ -12,11 +12,13 @@ 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. */ +/** + * 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. - * + * * @throws com.azure.core.management.exception.ManagementException thrown 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}. @@ -26,7 +28,7 @@ public interface TasksClient { /** * 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. @@ -39,9 +41,9 @@ public interface TasksClient { /** * 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. + * 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. @@ -52,9 +54,9 @@ public interface TasksClient { /** * 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. + * locations. * @param filter OData filter. Optional. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -67,9 +69,9 @@ public interface TasksClient { /** * 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. + * 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. @@ -78,14 +80,14 @@ public interface TasksClient { * @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); + 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. + * 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. @@ -97,9 +99,9 @@ Response getSubscriptionLevelTaskWithResponse( /** * 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. + * 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. @@ -109,14 +111,14 @@ Response getSubscriptionLevelTaskWithResponse( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateSubscriptionLevelTaskStateWithResponse( - String ascLocation, String taskName, TaskUpdateActionType taskUpdateActionType, Context context); + 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. + * 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. @@ -124,16 +126,16 @@ Response updateSubscriptionLevelTaskStateWithResponse( * @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); + void updateSubscriptionLevelTaskState(String ascLocation, String taskName, + TaskUpdateActionType taskUpdateActionType); /** * Recommended tasks that will help improve the security of the subscription proactively. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -144,11 +146,11 @@ void updateSubscriptionLevelTaskState( /** * Recommended tasks that will help improve the security of the subscription proactively. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param filter OData filter. Optional. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -157,16 +159,16 @@ void updateSubscriptionLevelTaskState( * @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); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -175,16 +177,16 @@ PagedIterable listByResourceGroup( * @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); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -196,11 +198,11 @@ Response getResourceGroupLevelTaskWithResponse( /** * Recommended tasks that will help improve the security of the subscription proactively. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -210,20 +212,16 @@ Response getResourceGroupLevelTaskWithResponse( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateResourceGroupLevelTaskStateWithResponse( - String resourceGroupName, - String ascLocation, - String taskName, - TaskUpdateActionType taskUpdateActionType, - Context context); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -231,6 +229,6 @@ Response updateResourceGroupLevelTaskStateWithResponse( * @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); + void updateResourceGroupLevelTaskState(String resourceGroupName, String ascLocation, String taskName, + TaskUpdateActionType taskUpdateActionType); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/TopologiesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/TopologiesClient.java index 2af153a9fd5d2..b0568bbfcf13b 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/TopologiesClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/TopologiesClient.java @@ -11,68 +11,70 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in TopologiesClient. + */ public interface TopologiesClient { /** * 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}. + * @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}. + * @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); /** * 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. + * 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}. + * {@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. + * 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}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByHomeRegion(String ascLocation, Context context); /** * Gets a specific topology component. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -81,16 +83,16 @@ public interface TopologiesClient { * @return a specific topology component along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String ascLocation, String topologyResourceName, Context context); + Response getWithResponse(String resourceGroupName, String ascLocation, + String topologyResourceName, Context context); /** * Gets a specific topology component. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. 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 index 4aeb551884764..246993e8efde6 100644 --- 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 @@ -11,12 +11,14 @@ 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. */ +/** + * 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. - * + * * @throws com.azure.core.management.exception.ManagementException thrown 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}. @@ -27,7 +29,7 @@ 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -40,7 +42,7 @@ 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. @@ -54,7 +56,7 @@ 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -66,7 +68,7 @@ public interface WorkspaceSettingsClient { /** * 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. @@ -76,12 +78,12 @@ public interface WorkspaceSettingsClient { * @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); + 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. @@ -94,7 +96,7 @@ Response createWithResponse( /** * 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. @@ -104,12 +106,12 @@ Response createWithResponse( * @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); + 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. @@ -122,7 +124,7 @@ Response updateWithResponse( /** * 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. @@ -135,7 +137,7 @@ Response updateWithResponse( /** * 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. diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveApplicationControlGroupData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveApplicationControlGroupData.java index de1ccc31bb952..3385d4ff5529e 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveApplicationControlGroupData.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveApplicationControlGroupData.java @@ -16,7 +16,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Represents a machines group and set of rules to be allowed running on a machine. */ +/** + * Represents a machines group and set of rules to be allowed running on a machine. + */ @Fluent public final class AdaptiveApplicationControlGroupData { /* @@ -68,14 +70,16 @@ public final class AdaptiveApplicationControlGroupData { @JsonProperty(value = "pathRecommendations") private List pathRecommendations; - /** Creates an instance of AdaptiveApplicationControlGroupData class. */ + /** + * Creates an instance of AdaptiveApplicationControlGroupData class. + */ public AdaptiveApplicationControlGroupData() { } /** * Get the enforcementMode property: The application control policy enforcement/protection mode of the machine * group. - * + * * @return the enforcementMode value. */ public EnforcementMode enforcementMode() { @@ -85,7 +89,7 @@ public EnforcementMode enforcementMode() { /** * Set the enforcementMode property: The application control policy enforcement/protection mode of the machine * group. - * + * * @param enforcementMode the enforcementMode value to set. * @return the AdaptiveApplicationControlGroupData object itself. */ @@ -97,7 +101,7 @@ public AdaptiveApplicationControlGroupData withEnforcementMode(EnforcementMode e /** * Get the protectionMode property: The protection mode of the collection/file types. Exe/Msi/Script are used for * Windows, Executable is used for Linux. - * + * * @return the protectionMode value. */ public ProtectionMode protectionMode() { @@ -107,7 +111,7 @@ public ProtectionMode protectionMode() { /** * Set the protectionMode property: The protection mode of the collection/file types. Exe/Msi/Script are used for * Windows, Executable is used for Linux. - * + * * @param protectionMode the protectionMode value to set. * @return the AdaptiveApplicationControlGroupData object itself. */ @@ -118,7 +122,7 @@ public AdaptiveApplicationControlGroupData withProtectionMode(ProtectionMode pro /** * Get the configurationStatus property: The configuration status of the machines group or machine or rule. - * + * * @return the configurationStatus value. */ public ConfigurationStatus configurationStatus() { @@ -127,7 +131,7 @@ public ConfigurationStatus configurationStatus() { /** * Get the recommendationStatus property: The initial recommendation status of the machine group or machine. - * + * * @return the recommendationStatus value. */ public RecommendationStatus recommendationStatus() { @@ -136,7 +140,7 @@ public RecommendationStatus recommendationStatus() { /** * Get the issues property: The issues property. - * + * * @return the issues value. */ public List issues() { @@ -145,7 +149,7 @@ public List issues() { /** * Get the sourceSystem property: The source type of the machine group. - * + * * @return the sourceSystem value. */ public SourceSystem sourceSystem() { @@ -154,7 +158,7 @@ public SourceSystem sourceSystem() { /** * Get the vmRecommendations property: The vmRecommendations property. - * + * * @return the vmRecommendations value. */ public List vmRecommendations() { @@ -163,7 +167,7 @@ public List vmRecommendations() { /** * Set the vmRecommendations property: The vmRecommendations property. - * + * * @param vmRecommendations the vmRecommendations value to set. * @return the AdaptiveApplicationControlGroupData object itself. */ @@ -174,7 +178,7 @@ public AdaptiveApplicationControlGroupData withVmRecommendations(List pathRecommendations() { @@ -183,7 +187,7 @@ public List pathRecommendations() { /** * Set the pathRecommendations property: The pathRecommendations property. - * + * * @param pathRecommendations the pathRecommendations value to set. * @return the AdaptiveApplicationControlGroupData object itself. */ @@ -194,7 +198,7 @@ public AdaptiveApplicationControlGroupData withPathRecommendations(List issues() { @@ -135,7 +139,7 @@ public List issues() { /** * Get the sourceSystem property: The source type of the machine group. - * + * * @return the sourceSystem value. */ public SourceSystem sourceSystem() { @@ -144,7 +148,7 @@ public SourceSystem sourceSystem() { /** * Get the vmRecommendations property: The vmRecommendations property. - * + * * @return the vmRecommendations value. */ public List vmRecommendations() { @@ -153,7 +157,7 @@ public List vmRecommendations() { /** * Set the vmRecommendations property: The vmRecommendations property. - * + * * @param vmRecommendations the vmRecommendations value to set. * @return the AdaptiveApplicationControlGroupInner object itself. */ @@ -167,7 +171,7 @@ public AdaptiveApplicationControlGroupInner withVmRecommendations(List pathRecommendations() { @@ -176,7 +180,7 @@ public List pathRecommendations() { /** * Set the pathRecommendations property: The pathRecommendations property. - * + * * @param pathRecommendations the pathRecommendations value to set. * @return the AdaptiveApplicationControlGroupInner object itself. */ @@ -190,15 +194,13 @@ public AdaptiveApplicationControlGroupInner withPathRecommendations(List value; - /** Creates an instance of AdaptiveApplicationControlGroupsInner class. */ + /** + * Creates an instance of AdaptiveApplicationControlGroupsInner class. + */ public AdaptiveApplicationControlGroupsInner() { } /** * Get the value property: The value property. - * + * * @return the value value. */ public List value() { @@ -35,7 +37,7 @@ public List value() { /** * Set the value property: The value property. - * + * * @param value the value value to set. * @return the AdaptiveApplicationControlGroupsInner object itself. */ @@ -46,7 +48,7 @@ public AdaptiveApplicationControlGroupsInner withValue(List rules() { @@ -45,7 +49,7 @@ public List rules() { /** * Set the rules property: The security rules which are recommended to be effective on the VM. - * + * * @param rules the rules value to set. * @return the AdaptiveNetworkHardeningInner object itself. */ @@ -59,7 +63,7 @@ public AdaptiveNetworkHardeningInner withRules(List rules) { /** * Get the rulesCalculationTime property: The UTC time on which the rules were calculated. - * + * * @return the rulesCalculationTime value. */ public OffsetDateTime rulesCalculationTime() { @@ -68,7 +72,7 @@ public OffsetDateTime rulesCalculationTime() { /** * Set the rulesCalculationTime property: The UTC time on which the rules were calculated. - * + * * @param rulesCalculationTime the rulesCalculationTime value to set. * @return the AdaptiveNetworkHardeningInner object itself. */ @@ -83,7 +87,7 @@ public AdaptiveNetworkHardeningInner withRulesCalculationTime(OffsetDateTime rul /** * Get the effectiveNetworkSecurityGroups property: The Network Security Groups effective on the network interfaces * of the protected resource. - * + * * @return the effectiveNetworkSecurityGroups value. */ public List effectiveNetworkSecurityGroups() { @@ -93,12 +97,12 @@ public List effectiveNetworkSecurityGroups() { /** * Set the effectiveNetworkSecurityGroups property: The Network Security Groups effective on the network interfaces * of the protected resource. - * + * * @param effectiveNetworkSecurityGroups the effectiveNetworkSecurityGroups value to set. * @return the AdaptiveNetworkHardeningInner object itself. */ - public AdaptiveNetworkHardeningInner withEffectiveNetworkSecurityGroups( - List effectiveNetworkSecurityGroups) { + public AdaptiveNetworkHardeningInner + withEffectiveNetworkSecurityGroups(List effectiveNetworkSecurityGroups) { if (this.innerProperties() == null) { this.innerProperties = new AdaptiveNetworkHardeningProperties(); } @@ -108,7 +112,7 @@ public AdaptiveNetworkHardeningInner withEffectiveNetworkSecurityGroups( /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveNetworkHardeningProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveNetworkHardeningProperties.java index d674845c04923..c17319b56de30 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveNetworkHardeningProperties.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveNetworkHardeningProperties.java @@ -11,7 +11,9 @@ import java.time.OffsetDateTime; import java.util.List; -/** Adaptive Network Hardening resource properties. */ +/** + * Adaptive Network Hardening resource properties. + */ @Fluent public final class AdaptiveNetworkHardeningProperties { /* @@ -32,13 +34,15 @@ public final class AdaptiveNetworkHardeningProperties { @JsonProperty(value = "effectiveNetworkSecurityGroups") private List effectiveNetworkSecurityGroups; - /** Creates an instance of AdaptiveNetworkHardeningProperties class. */ + /** + * Creates an instance of AdaptiveNetworkHardeningProperties class. + */ public AdaptiveNetworkHardeningProperties() { } /** * Get the rules property: The security rules which are recommended to be effective on the VM. - * + * * @return the rules value. */ public List rules() { @@ -47,7 +51,7 @@ public List rules() { /** * Set the rules property: The security rules which are recommended to be effective on the VM. - * + * * @param rules the rules value to set. * @return the AdaptiveNetworkHardeningProperties object itself. */ @@ -58,7 +62,7 @@ public AdaptiveNetworkHardeningProperties withRules(List rules) { /** * Get the rulesCalculationTime property: The UTC time on which the rules were calculated. - * + * * @return the rulesCalculationTime value. */ public OffsetDateTime rulesCalculationTime() { @@ -67,7 +71,7 @@ public OffsetDateTime rulesCalculationTime() { /** * Set the rulesCalculationTime property: The UTC time on which the rules were calculated. - * + * * @param rulesCalculationTime the rulesCalculationTime value to set. * @return the AdaptiveNetworkHardeningProperties object itself. */ @@ -79,7 +83,7 @@ public AdaptiveNetworkHardeningProperties withRulesCalculationTime(OffsetDateTim /** * Get the effectiveNetworkSecurityGroups property: The Network Security Groups effective on the network interfaces * of the protected resource. - * + * * @return the effectiveNetworkSecurityGroups value. */ public List effectiveNetworkSecurityGroups() { @@ -89,19 +93,19 @@ public List effectiveNetworkSecurityGroups() { /** * Set the effectiveNetworkSecurityGroups property: The Network Security Groups effective on the network interfaces * of the protected resource. - * + * * @param effectiveNetworkSecurityGroups the effectiveNetworkSecurityGroups value to set. * @return the AdaptiveNetworkHardeningProperties object itself. */ - public AdaptiveNetworkHardeningProperties withEffectiveNetworkSecurityGroups( - List effectiveNetworkSecurityGroups) { + public AdaptiveNetworkHardeningProperties + withEffectiveNetworkSecurityGroups(List effectiveNetworkSecurityGroups) { this.effectiveNetworkSecurityGroups = effectiveNetworkSecurityGroups; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 3255fbeb3048b..76167c2ac2c9a 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The Advanced Threat Protection settings. */ +/** + * The Advanced Threat Protection settings. + */ @Fluent public final class AdvancedThreatProtectionProperties { /* @@ -16,13 +18,15 @@ public final class AdvancedThreatProtectionProperties { @JsonProperty(value = "isEnabled") private Boolean isEnabled; - /** Creates an instance of AdvancedThreatProtectionProperties class. */ + /** + * 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() { @@ -31,7 +35,7 @@ public Boolean isEnabled() { /** * Set the isEnabled property: Indicates whether Advanced Threat Protection is enabled. - * + * * @param isEnabled the isEnabled value to set. * @return the AdvancedThreatProtectionProperties object itself. */ @@ -42,7 +46,7 @@ public AdvancedThreatProtectionProperties withIsEnabled(Boolean isEnabled) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index fb63249f6d372..54ca2c870ac17 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.core.management.ProxyResource; import com.fasterxml.jackson.annotation.JsonProperty; -/** The Advanced Threat Protection resource. */ +/** + * The Advanced Threat Protection resource. + */ @Fluent public final class AdvancedThreatProtectionSettingInner extends ProxyResource { /* @@ -17,13 +19,15 @@ public final class AdvancedThreatProtectionSettingInner extends ProxyResource { @JsonProperty(value = "properties") private AdvancedThreatProtectionProperties innerProperties; - /** Creates an instance of AdvancedThreatProtectionSettingInner class. */ + /** + * Creates an instance of AdvancedThreatProtectionSettingInner class. + */ public AdvancedThreatProtectionSettingInner() { } /** * Get the innerProperties property: The Advanced Threat Protection settings. - * + * * @return the innerProperties value. */ private AdvancedThreatProtectionProperties innerProperties() { @@ -32,7 +36,7 @@ private AdvancedThreatProtectionProperties innerProperties() { /** * Get the isEnabled property: Indicates whether Advanced Threat Protection is enabled. - * + * * @return the isEnabled value. */ public Boolean isEnabled() { @@ -41,7 +45,7 @@ public Boolean isEnabled() { /** * Set the isEnabled property: Indicates whether Advanced Threat Protection is enabled. - * + * * @param isEnabled the isEnabled value to set. * @return the AdvancedThreatProtectionSettingInner object itself. */ @@ -55,7 +59,7 @@ public AdvancedThreatProtectionSettingInner withIsEnabled(Boolean isEnabled) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index ac8fd6624bd45..1280f5d3ce195 100644 --- 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 @@ -17,7 +17,9 @@ import java.util.List; import java.util.Map; -/** Security alert. */ +/** + * Security alert. + */ @Fluent public final class AlertInner extends ProxyResource { /* @@ -26,13 +28,15 @@ public final class AlertInner extends ProxyResource { @JsonProperty(value = "properties") private AlertProperties innerProperties; - /** Creates an instance of AlertInner class. */ + /** + * Creates an instance of AlertInner class. + */ public AlertInner() { } /** * Get the innerProperties property: describes security alert properties. - * + * * @return the innerProperties value. */ private AlertProperties innerProperties() { @@ -41,7 +45,7 @@ private AlertProperties innerProperties() { /** * Get the version property: Schema version. - * + * * @return the version value. */ public String version() { @@ -51,7 +55,7 @@ public String 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() { @@ -60,7 +64,7 @@ public String alertType() { /** * Get the systemAlertId property: Unique identifier for the alert. - * + * * @return the systemAlertId value. */ public String systemAlertId() { @@ -70,7 +74,7 @@ public String 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() { @@ -79,7 +83,7 @@ public String productComponentName() { /** * Get the alertDisplayName property: The display name of the alert. - * + * * @return the alertDisplayName value. */ public String alertDisplayName() { @@ -88,7 +92,7 @@ public String alertDisplayName() { /** * Get the description property: Description of the suspicious activity that was detected. - * + * * @return the description value. */ public String description() { @@ -98,7 +102,7 @@ public String 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() { @@ -108,7 +112,7 @@ public AlertSeverity 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() { @@ -118,7 +122,7 @@ public Intent 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() { @@ -127,7 +131,7 @@ public OffsetDateTime 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() { @@ -138,7 +142,7 @@ public OffsetDateTime 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() { @@ -147,7 +151,7 @@ public List resourceIdentifiers() { /** * Get the remediationSteps property: Manual action items to take to remediate the alert. - * + * * @return the remediationSteps value. */ public List remediationSteps() { @@ -156,7 +160,7 @@ public List remediationSteps() { /** * Get the vendorName property: The name of the vendor that raises the alert. - * + * * @return the vendorName value. */ public String vendorName() { @@ -165,7 +169,7 @@ public String vendorName() { /** * Get the status property: The life cycle status of the alert. - * + * * @return the status value. */ public AlertStatus status() { @@ -174,7 +178,7 @@ public AlertStatus status() { /** * Get the extendedLinks property: Links related to the alert. - * + * * @return the extendedLinks value. */ public List> extendedLinks() { @@ -183,7 +187,7 @@ public List> extendedLinks() { /** * Get the alertUri property: A direct link to the alert page in Azure Portal. - * + * * @return the alertUri value. */ public String alertUri() { @@ -192,7 +196,7 @@ public String alertUri() { /** * Get the timeGeneratedUtc property: The UTC time the alert was generated in ISO8601 format. - * + * * @return the timeGeneratedUtc value. */ public OffsetDateTime timeGeneratedUtc() { @@ -203,7 +207,7 @@ public OffsetDateTime 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() { @@ -212,7 +216,7 @@ public String productName() { /** * Get the processingEndTimeUtc property: The UTC processing end time of the alert in ISO8601 format. - * + * * @return the processingEndTimeUtc value. */ public OffsetDateTime processingEndTimeUtc() { @@ -221,7 +225,7 @@ public OffsetDateTime processingEndTimeUtc() { /** * Get the entities property: A list of entities related to the alert. - * + * * @return the entities value. */ public List entities() { @@ -231,7 +235,7 @@ public List 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() { @@ -241,7 +245,7 @@ public Boolean 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() { @@ -250,7 +254,7 @@ public String correlationKey() { /** * Get the extendedProperties property: Custom properties for the alert. - * + * * @return the extendedProperties value. */ public Map extendedProperties() { @@ -259,7 +263,7 @@ public Map extendedProperties() { /** * Set the extendedProperties property: Custom properties for the alert. - * + * * @param extendedProperties the extendedProperties value to set. * @return the AlertInner object itself. */ @@ -273,7 +277,7 @@ public AlertInner withExtendedProperties(Map extendedProperties) /** * Get the compromisedEntity property: The display name of the resource most related to this alert. - * + * * @return the compromisedEntity value. */ public String compromisedEntity() { @@ -282,7 +286,7 @@ public String compromisedEntity() { /** * Get the techniques property: kill chain related techniques behind the alert. - * + * * @return the techniques value. */ public List techniques() { @@ -291,7 +295,7 @@ public List techniques() { /** * Get the subTechniques property: Kill chain related sub-techniques behind the alert. - * + * * @return the subTechniques value. */ public List subTechniques() { @@ -300,7 +304,7 @@ public List subTechniques() { /** * Get the supportingEvidence property: Changing set of properties depending on the supportingEvidence type. - * + * * @return the supportingEvidence value. */ public AlertPropertiesSupportingEvidence supportingEvidence() { @@ -309,7 +313,7 @@ public AlertPropertiesSupportingEvidence supportingEvidence() { /** * Set the supportingEvidence property: Changing set of properties depending on the supportingEvidence type. - * + * * @param supportingEvidence the supportingEvidence value to set. * @return the AlertInner object itself. */ @@ -323,7 +327,7 @@ public AlertInner withSupportingEvidence(AlertPropertiesSupportingEvidence suppo /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 5a65af987b501..5c3d6c4e39493 100644 --- 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 @@ -17,7 +17,9 @@ import java.util.List; import java.util.Map; -/** describes security alert properties. */ +/** + * describes security alert properties. + */ @Fluent public final class AlertProperties { /* @@ -190,13 +192,15 @@ public final class AlertProperties { @JsonProperty(value = "supportingEvidence") private AlertPropertiesSupportingEvidence supportingEvidence; - /** Creates an instance of AlertProperties class. */ + /** + * Creates an instance of AlertProperties class. + */ public AlertProperties() { } /** * Get the version property: Schema version. - * + * * @return the version value. */ public String version() { @@ -206,7 +210,7 @@ public String 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() { @@ -215,7 +219,7 @@ public String alertType() { /** * Get the systemAlertId property: Unique identifier for the alert. - * + * * @return the systemAlertId value. */ public String systemAlertId() { @@ -225,7 +229,7 @@ public String 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() { @@ -234,7 +238,7 @@ public String productComponentName() { /** * Get the alertDisplayName property: The display name of the alert. - * + * * @return the alertDisplayName value. */ public String alertDisplayName() { @@ -243,7 +247,7 @@ public String alertDisplayName() { /** * Get the description property: Description of the suspicious activity that was detected. - * + * * @return the description value. */ public String description() { @@ -253,7 +257,7 @@ public String 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() { @@ -263,7 +267,7 @@ public AlertSeverity 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() { @@ -273,7 +277,7 @@ public Intent 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() { @@ -282,7 +286,7 @@ public OffsetDateTime 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() { @@ -293,7 +297,7 @@ public OffsetDateTime 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() { @@ -302,7 +306,7 @@ public List resourceIdentifiers() { /** * Get the remediationSteps property: Manual action items to take to remediate the alert. - * + * * @return the remediationSteps value. */ public List remediationSteps() { @@ -311,7 +315,7 @@ public List remediationSteps() { /** * Get the vendorName property: The name of the vendor that raises the alert. - * + * * @return the vendorName value. */ public String vendorName() { @@ -320,7 +324,7 @@ public String vendorName() { /** * Get the status property: The life cycle status of the alert. - * + * * @return the status value. */ public AlertStatus status() { @@ -329,7 +333,7 @@ public AlertStatus status() { /** * Get the extendedLinks property: Links related to the alert. - * + * * @return the extendedLinks value. */ public List> extendedLinks() { @@ -338,7 +342,7 @@ public List> extendedLinks() { /** * Get the alertUri property: A direct link to the alert page in Azure Portal. - * + * * @return the alertUri value. */ public String alertUri() { @@ -347,7 +351,7 @@ public String alertUri() { /** * Get the timeGeneratedUtc property: The UTC time the alert was generated in ISO8601 format. - * + * * @return the timeGeneratedUtc value. */ public OffsetDateTime timeGeneratedUtc() { @@ -358,7 +362,7 @@ public OffsetDateTime 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() { @@ -367,7 +371,7 @@ public String productName() { /** * Get the processingEndTimeUtc property: The UTC processing end time of the alert in ISO8601 format. - * + * * @return the processingEndTimeUtc value. */ public OffsetDateTime processingEndTimeUtc() { @@ -376,7 +380,7 @@ public OffsetDateTime processingEndTimeUtc() { /** * Get the entities property: A list of entities related to the alert. - * + * * @return the entities value. */ public List entities() { @@ -386,7 +390,7 @@ public List 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() { @@ -396,7 +400,7 @@ public Boolean 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() { @@ -405,7 +409,7 @@ public String correlationKey() { /** * Get the extendedProperties property: Custom properties for the alert. - * + * * @return the extendedProperties value. */ public Map extendedProperties() { @@ -414,7 +418,7 @@ public Map extendedProperties() { /** * Set the extendedProperties property: Custom properties for the alert. - * + * * @param extendedProperties the extendedProperties value to set. * @return the AlertProperties object itself. */ @@ -425,7 +429,7 @@ public AlertProperties withExtendedProperties(Map extendedProper /** * Get the compromisedEntity property: The display name of the resource most related to this alert. - * + * * @return the compromisedEntity value. */ public String compromisedEntity() { @@ -434,7 +438,7 @@ public String compromisedEntity() { /** * Get the techniques property: kill chain related techniques behind the alert. - * + * * @return the techniques value. */ public List techniques() { @@ -443,7 +447,7 @@ public List techniques() { /** * Get the subTechniques property: Kill chain related sub-techniques behind the alert. - * + * * @return the subTechniques value. */ public List subTechniques() { @@ -452,7 +456,7 @@ public List subTechniques() { /** * Get the supportingEvidence property: Changing set of properties depending on the supportingEvidence type. - * + * * @return the supportingEvidence value. */ public AlertPropertiesSupportingEvidence supportingEvidence() { @@ -461,7 +465,7 @@ public AlertPropertiesSupportingEvidence supportingEvidence() { /** * Set the supportingEvidence property: Changing set of properties depending on the supportingEvidence type. - * + * * @param supportingEvidence the supportingEvidence value to set. * @return the AlertProperties object itself. */ @@ -472,7 +476,7 @@ public AlertProperties withSupportingEvidence(AlertPropertiesSupportingEvidence /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index fe3186458ebb7..95d1855ae1f9f 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The alert sync setting properties. */ +/** + * The alert sync setting properties. + */ @Fluent public final class AlertSyncSettingProperties { /* @@ -16,13 +18,15 @@ public final class AlertSyncSettingProperties { @JsonProperty(value = "enabled", required = true) private boolean enabled; - /** Creates an instance of AlertSyncSettingProperties class. */ + /** + * 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() { @@ -31,7 +35,7 @@ public boolean enabled() { /** * Set the enabled property: Is the alert sync setting enabled. - * + * * @param enabled the enabled value to set. * @return the AlertSyncSettingProperties object itself. */ @@ -42,7 +46,7 @@ public AlertSyncSettingProperties withEnabled(boolean enabled) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 110197b8998b2..236997fedc029 100644 --- 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 @@ -11,7 +11,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; -/** Describes the suppression rule. */ +/** + * Describes the suppression rule. + */ @Fluent public final class AlertsSuppressionRuleInner extends ProxyResource { /* @@ -20,13 +22,15 @@ public final class AlertsSuppressionRuleInner extends ProxyResource { @JsonProperty(value = "properties") private AlertsSuppressionRuleProperties innerProperties; - /** Creates an instance of AlertsSuppressionRuleInner class. */ + /** + * Creates an instance of AlertsSuppressionRuleInner class. + */ public AlertsSuppressionRuleInner() { } /** * Get the innerProperties property: describes AlertsSuppressionRule properties. - * + * * @return the innerProperties value. */ private AlertsSuppressionRuleProperties innerProperties() { @@ -35,7 +39,7 @@ private AlertsSuppressionRuleProperties innerProperties() { /** * Get the alertType property: Type of the alert to automatically suppress. For all alert types, use '*'. - * + * * @return the alertType value. */ public String alertType() { @@ -44,7 +48,7 @@ public String 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. */ @@ -58,7 +62,7 @@ public AlertsSuppressionRuleInner withAlertType(String alertType) { /** * Get the lastModifiedUtc property: The last time this rule was modified. - * + * * @return the lastModifiedUtc value. */ public OffsetDateTime lastModifiedUtc() { @@ -67,8 +71,8 @@ public OffsetDateTime lastModifiedUtc() { /** * Get the expirationDateUtc property: Expiration date of the rule, if value is not provided or provided as null - * this field will default to the maximum allowed expiration date. - * + * there will no expiration at all. + * * @return the expirationDateUtc value. */ public OffsetDateTime expirationDateUtc() { @@ -77,8 +81,8 @@ public OffsetDateTime expirationDateUtc() { /** * Set the expirationDateUtc property: Expiration date of the rule, if value is not provided or provided as null - * this field will default to the maximum allowed expiration date. - * + * there will no expiration at all. + * * @param expirationDateUtc the expirationDateUtc value to set. * @return the AlertsSuppressionRuleInner object itself. */ @@ -92,7 +96,7 @@ public AlertsSuppressionRuleInner withExpirationDateUtc(OffsetDateTime expiratio /** * Get the reason property: The reason for dismissing the alert. - * + * * @return the reason value. */ public String reason() { @@ -101,7 +105,7 @@ public String reason() { /** * Set the reason property: The reason for dismissing the alert. - * + * * @param reason the reason value to set. * @return the AlertsSuppressionRuleInner object itself. */ @@ -115,7 +119,7 @@ public AlertsSuppressionRuleInner withReason(String reason) { /** * Get the state property: Possible states of the rule. - * + * * @return the state value. */ public RuleState state() { @@ -124,7 +128,7 @@ public RuleState state() { /** * Set the state property: Possible states of the rule. - * + * * @param state the state value to set. * @return the AlertsSuppressionRuleInner object itself. */ @@ -138,7 +142,7 @@ public AlertsSuppressionRuleInner withState(RuleState state) { /** * Get the comment property: Any comment regarding the rule. - * + * * @return the comment value. */ public String comment() { @@ -147,7 +151,7 @@ public String comment() { /** * Set the comment property: Any comment regarding the rule. - * + * * @param comment the comment value to set. * @return the AlertsSuppressionRuleInner object itself. */ @@ -161,7 +165,7 @@ public AlertsSuppressionRuleInner withComment(String comment) { /** * Get the suppressionAlertsScope property: The suppression conditions. - * + * * @return the suppressionAlertsScope value. */ public SuppressionAlertsScope suppressionAlertsScope() { @@ -170,7 +174,7 @@ public SuppressionAlertsScope suppressionAlertsScope() { /** * Set the suppressionAlertsScope property: The suppression conditions. - * + * * @param suppressionAlertsScope the suppressionAlertsScope value to set. * @return the AlertsSuppressionRuleInner object itself. */ @@ -184,7 +188,7 @@ public AlertsSuppressionRuleInner withSuppressionAlertsScope(SuppressionAlertsSc /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 3ec48688de442..3f778272a1585 100644 --- 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 @@ -11,7 +11,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; -/** describes AlertsSuppressionRule properties. */ +/** + * describes AlertsSuppressionRule properties. + */ @Fluent public final class AlertsSuppressionRuleProperties { /* @@ -27,8 +29,7 @@ public final class AlertsSuppressionRuleProperties { private OffsetDateTime lastModifiedUtc; /* - * Expiration date of the rule, if value is not provided or provided as null this field will default to the maximum - * allowed expiration date. + * Expiration date of the rule, if value is not provided or provided as null there will no expiration at all */ @JsonProperty(value = "expirationDateUtc") private OffsetDateTime expirationDateUtc; @@ -57,13 +58,15 @@ public final class AlertsSuppressionRuleProperties { @JsonProperty(value = "suppressionAlertsScope") private SuppressionAlertsScope suppressionAlertsScope; - /** Creates an instance of AlertsSuppressionRuleProperties class. */ + /** + * 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() { @@ -72,7 +75,7 @@ public String 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. */ @@ -83,7 +86,7 @@ public AlertsSuppressionRuleProperties withAlertType(String alertType) { /** * Get the lastModifiedUtc property: The last time this rule was modified. - * + * * @return the lastModifiedUtc value. */ public OffsetDateTime lastModifiedUtc() { @@ -92,8 +95,8 @@ public OffsetDateTime lastModifiedUtc() { /** * Get the expirationDateUtc property: Expiration date of the rule, if value is not provided or provided as null - * this field will default to the maximum allowed expiration date. - * + * there will no expiration at all. + * * @return the expirationDateUtc value. */ public OffsetDateTime expirationDateUtc() { @@ -102,8 +105,8 @@ public OffsetDateTime expirationDateUtc() { /** * Set the expirationDateUtc property: Expiration date of the rule, if value is not provided or provided as null - * this field will default to the maximum allowed expiration date. - * + * there will no expiration at all. + * * @param expirationDateUtc the expirationDateUtc value to set. * @return the AlertsSuppressionRuleProperties object itself. */ @@ -114,7 +117,7 @@ public AlertsSuppressionRuleProperties withExpirationDateUtc(OffsetDateTime expi /** * Get the reason property: The reason for dismissing the alert. - * + * * @return the reason value. */ public String reason() { @@ -123,7 +126,7 @@ public String reason() { /** * Set the reason property: The reason for dismissing the alert. - * + * * @param reason the reason value to set. * @return the AlertsSuppressionRuleProperties object itself. */ @@ -134,7 +137,7 @@ public AlertsSuppressionRuleProperties withReason(String reason) { /** * Get the state property: Possible states of the rule. - * + * * @return the state value. */ public RuleState state() { @@ -143,7 +146,7 @@ public RuleState state() { /** * Set the state property: Possible states of the rule. - * + * * @param state the state value to set. * @return the AlertsSuppressionRuleProperties object itself. */ @@ -154,7 +157,7 @@ public AlertsSuppressionRuleProperties withState(RuleState state) { /** * Get the comment property: Any comment regarding the rule. - * + * * @return the comment value. */ public String comment() { @@ -163,7 +166,7 @@ public String comment() { /** * Set the comment property: Any comment regarding the rule. - * + * * @param comment the comment value to set. * @return the AlertsSuppressionRuleProperties object itself. */ @@ -174,7 +177,7 @@ public AlertsSuppressionRuleProperties withComment(String comment) { /** * Get the suppressionAlertsScope property: The suppression conditions. - * + * * @return the suppressionAlertsScope value. */ public SuppressionAlertsScope suppressionAlertsScope() { @@ -183,7 +186,7 @@ public SuppressionAlertsScope suppressionAlertsScope() { /** * Set the suppressionAlertsScope property: The suppression conditions. - * + * * @param suppressionAlertsScope the suppressionAlertsScope value to set. * @return the AlertsSuppressionRuleProperties object itself. */ @@ -194,27 +197,21 @@ public AlertsSuppressionRuleProperties withSuppressionAlertsScope(SuppressionAle /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (alertType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property alertType in model AlertsSuppressionRuleProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property alertType in model AlertsSuppressionRuleProperties")); } if (reason() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property reason in model AlertsSuppressionRuleProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property reason in model AlertsSuppressionRuleProperties")); } if (state() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property state in model AlertsSuppressionRuleProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property state in model AlertsSuppressionRuleProperties")); } if (suppressionAlertsScope() != null) { suppressionAlertsScope().validate(); 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 index 7c222562dfcb1..8e5129cea2704 100644 --- 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 @@ -11,7 +11,9 @@ import java.time.OffsetDateTime; import java.util.List; -/** The resource whose properties describes the allowed traffic between Azure resources. */ +/** + * The resource whose properties describes the allowed traffic between Azure resources. + */ @Immutable public final class AllowedConnectionsResourceInner extends ProxyResource { /* @@ -26,13 +28,15 @@ public final class AllowedConnectionsResourceInner extends ProxyResource { @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) private String location; - /** Creates an instance of AllowedConnectionsResourceInner class. */ + /** + * Creates an instance of AllowedConnectionsResourceInner class. + */ public AllowedConnectionsResourceInner() { } /** * Get the innerProperties property: Describes the allowed traffic between Azure resources. - * + * * @return the innerProperties value. */ private AllowedConnectionsResourceProperties innerProperties() { @@ -41,7 +45,7 @@ private AllowedConnectionsResourceProperties innerProperties() { /** * Get the location property: Location where the resource is stored. - * + * * @return the location value. */ public String location() { @@ -50,7 +54,7 @@ public String location() { /** * Get the calculatedDateTime property: The UTC time on which the allowed connections resource was calculated. - * + * * @return the calculatedDateTime value. */ public OffsetDateTime calculatedDateTime() { @@ -59,7 +63,7 @@ public OffsetDateTime calculatedDateTime() { /** * Get the connectableResources property: List of connectable resources. - * + * * @return the connectableResources value. */ public List connectableResources() { @@ -68,7 +72,7 @@ public List connectableResources() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 26132bd10a555..65cec8ebc7925 100644 --- 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 @@ -10,7 +10,9 @@ import java.time.OffsetDateTime; import java.util.List; -/** Describes the allowed traffic between Azure resources. */ +/** + * Describes the allowed traffic between Azure resources. + */ @Immutable public final class AllowedConnectionsResourceProperties { /* @@ -25,13 +27,15 @@ public final class AllowedConnectionsResourceProperties { @JsonProperty(value = "connectableResources", access = JsonProperty.Access.WRITE_ONLY) private List connectableResources; - /** Creates an instance of AllowedConnectionsResourceProperties class. */ + /** + * Creates an instance of AllowedConnectionsResourceProperties class. + */ public AllowedConnectionsResourceProperties() { } /** * Get the calculatedDateTime property: The UTC time on which the allowed connections resource was calculated. - * + * * @return the calculatedDateTime value. */ public OffsetDateTime calculatedDateTime() { @@ -40,7 +44,7 @@ public OffsetDateTime calculatedDateTime() { /** * Get the connectableResources property: List of connectable resources. - * + * * @return the connectableResources value. */ public List connectableResources() { @@ -49,7 +53,7 @@ public List connectableResources() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 new file mode 100644 index 0000000000000..60fdc7257adbd --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApiCollectionInner.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.security.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An API collection as represented by Microsoft Defender for APIs. + */ +@Immutable +public final class ApiCollectionInner extends ProxyResource { + /* + * Describes the properties of an API collection. + */ + @JsonProperty(value = "properties") + private ApiCollectionProperties innerProperties; + + /** + * Creates an instance of ApiCollectionInner class. + */ + public ApiCollectionInner() { + } + + /** + * Get the innerProperties property: Describes the properties of an API collection. + * + * @return the innerProperties value. + */ + private ApiCollectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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(); + } + } +} 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 index 951e62c71a5c6..ee64ab453eeaf 100644 --- 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 @@ -4,34 +4,94 @@ package com.azure.resourcemanager.security.fluent.models; -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.security.models.ProvisioningState; import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; -/** Describes the properties of an API collection. */ -@Fluent +/** + * Describes the properties of an API collection. + */ +@Immutable public final class ApiCollectionProperties { /* - * The display name of the Azure API Management API. + * Gets the provisioning state of the API collection. */ - @JsonProperty(value = "displayName") + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The display name of the API collection. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) private String displayName; /* - * Additional data regarding the API collection. + * The resource Id of the resource from where this API collection was discovered. + */ + @JsonProperty(value = "discoveredVia", access = JsonProperty.Access.WRITE_ONLY) + private String discoveredVia; + + /* + * The base URI for this API collection. All endpoints of this API collection extend this base URI. + */ + @JsonProperty(value = "baseUrl", access = JsonProperty.Access.WRITE_ONLY) + private String baseUrl; + + /* + * The number of API endpoints discovered in this API collection. + */ + @JsonProperty(value = "numberOfApiEndpoints", access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfApiEndpoints; + + /* + * The number of API endpoints in this API collection that have not received any API traffic in the last 30 days. + */ + @JsonProperty(value = "numberOfInactiveApiEndpoints", access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfInactiveApiEndpoints; + + /* + * The number of API endpoints in this API collection that are unauthenticated. */ - @JsonProperty(value = "additionalData") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map additionalData; + @JsonProperty(value = "numberOfUnauthenticatedApiEndpoints", access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfUnauthenticatedApiEndpoints; - /** Creates an instance of ApiCollectionProperties class. */ + /* + * The number of API endpoints in this API collection for which API traffic from the internet was observed. + */ + @JsonProperty(value = "numberOfExternalApiEndpoints", access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfExternalApiEndpoints; + + /* + * The number of API endpoints in this API collection which are exposing sensitive data in their requests and/or + * responses. + */ + @JsonProperty(value = "numberOfApiEndpointsWithSensitiveDataExposed", access = JsonProperty.Access.WRITE_ONLY) + private Long numberOfApiEndpointsWithSensitiveDataExposed; + + /* + * The highest priority sensitivity label from Microsoft Purview in this API collection. + */ + @JsonProperty(value = "sensitivityLabel", access = JsonProperty.Access.WRITE_ONLY) + private String sensitivityLabel; + + /** + * Creates an instance of ApiCollectionProperties class. + */ public ApiCollectionProperties() { } /** - * Get the displayName property: The display name of the Azure API Management API. - * + * 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() { @@ -39,39 +99,86 @@ public String displayName() { } /** - * Set the displayName property: The display name of the Azure API Management API. - * - * @param displayName the displayName value to set. - * @return the ApiCollectionProperties object itself. - */ - public ApiCollectionProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; + * 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 additionalData property: Additional data regarding the API collection. - * - * @return the additionalData value. + * Get the numberOfUnauthenticatedApiEndpoints property: The number of API endpoints in this API collection that + * are unauthenticated. + * + * @return the numberOfUnauthenticatedApiEndpoints value. */ - public Map additionalData() { - return this.additionalData; + public Long numberOfUnauthenticatedApiEndpoints() { + return this.numberOfUnauthenticatedApiEndpoints; } /** - * Set the additionalData property: Additional data regarding the API collection. - * - * @param additionalData the additionalData value to set. - * @return the ApiCollectionProperties object itself. - */ - public ApiCollectionProperties withAdditionalData(Map additionalData) { - this.additionalData = additionalData; - return this; + * 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() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApiCollectionResponseInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApiCollectionResponseInner.java deleted file mode 100644 index 6224a7ea4eb48..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApiCollectionResponseInner.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** An API collection as represented by Defender for APIs. */ -@Fluent -public final class ApiCollectionResponseInner extends ProxyResource { - /* - * Describes the properties of an API collection. - */ - @JsonProperty(value = "properties") - private ApiCollectionProperties innerProperties; - - /** Creates an instance of ApiCollectionResponseInner class. */ - public ApiCollectionResponseInner() { - } - - /** - * Get the innerProperties property: Describes the properties of an API collection. - * - * @return the innerProperties value. - */ - private ApiCollectionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the displayName property: The display name of the Azure API Management API. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: The display name of the Azure API Management API. - * - * @param displayName the displayName value to set. - * @return the ApiCollectionResponseInner object itself. - */ - public ApiCollectionResponseInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new ApiCollectionProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the additionalData property: Additional data regarding the API collection. - * - * @return the additionalData value. - */ - public Map additionalData() { - return this.innerProperties() == null ? null : this.innerProperties().additionalData(); - } - - /** - * Set the additionalData property: Additional data regarding the API collection. - * - * @param additionalData the additionalData value to set. - * @return the ApiCollectionResponseInner object itself. - */ - public ApiCollectionResponseInner withAdditionalData(Map additionalData) { - if (this.innerProperties() == null) { - this.innerProperties = new ApiCollectionProperties(); - } - 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(); - } - } -} 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 index 52bda95475adf..ec4589ff800dd 100644 --- 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 @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Security Application over a given scope. */ +/** + * Security Application over a given scope. + */ @Fluent public final class ApplicationInner extends ProxyResource { /* @@ -19,13 +21,15 @@ public final class ApplicationInner extends ProxyResource { @JsonProperty(value = "properties") private ApplicationProperties innerProperties; - /** Creates an instance of ApplicationInner class. */ + /** + * Creates an instance of ApplicationInner class. + */ public ApplicationInner() { } /** * Get the innerProperties property: Properties of a security application. - * + * * @return the innerProperties value. */ private ApplicationProperties innerProperties() { @@ -34,7 +38,7 @@ private ApplicationProperties innerProperties() { /** * Get the displayName property: display name of the application. - * + * * @return the displayName value. */ public String displayName() { @@ -43,7 +47,7 @@ public String displayName() { /** * Set the displayName property: display name of the application. - * + * * @param displayName the displayName value to set. * @return the ApplicationInner object itself. */ @@ -57,7 +61,7 @@ public ApplicationInner withDisplayName(String displayName) { /** * Get the description property: description of the application. - * + * * @return the description value. */ public String description() { @@ -66,7 +70,7 @@ public String description() { /** * Set the description property: description of the application. - * + * * @param description the description value to set. * @return the ApplicationInner object itself. */ @@ -80,7 +84,7 @@ public ApplicationInner withDescription(String description) { /** * Get the sourceResourceType property: The application source, what it affects, e.g. Assessments. - * + * * @return the sourceResourceType value. */ public ApplicationSourceResourceType sourceResourceType() { @@ -89,7 +93,7 @@ public ApplicationSourceResourceType 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. */ @@ -103,7 +107,7 @@ public ApplicationInner withSourceResourceType(ApplicationSourceResourceType sou /** * Get the conditionSets property: The application conditionSets - see examples. - * + * * @return the conditionSets value. */ public List conditionSets() { @@ -112,7 +116,7 @@ public List conditionSets() { /** * Set the conditionSets property: The application conditionSets - see examples. - * + * * @param conditionSets the conditionSets value to set. * @return the ApplicationInner object itself. */ @@ -126,7 +130,7 @@ public ApplicationInner withConditionSets(List conditionSets) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index bace1b11b0a5f..a0d1c03be990f 100644 --- 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 @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Describes properties of an application. */ +/** + * Describes properties of an application. + */ @Fluent public final class ApplicationProperties { /* @@ -37,13 +39,15 @@ public final class ApplicationProperties { @JsonProperty(value = "conditionSets", required = true) private List conditionSets; - /** Creates an instance of ApplicationProperties class. */ + /** + * Creates an instance of ApplicationProperties class. + */ public ApplicationProperties() { } /** * Get the displayName property: display name of the application. - * + * * @return the displayName value. */ public String displayName() { @@ -52,7 +56,7 @@ public String displayName() { /** * Set the displayName property: display name of the application. - * + * * @param displayName the displayName value to set. * @return the ApplicationProperties object itself. */ @@ -63,7 +67,7 @@ public ApplicationProperties withDisplayName(String displayName) { /** * Get the description property: description of the application. - * + * * @return the description value. */ public String description() { @@ -72,7 +76,7 @@ public String description() { /** * Set the description property: description of the application. - * + * * @param description the description value to set. * @return the ApplicationProperties object itself. */ @@ -83,7 +87,7 @@ public ApplicationProperties withDescription(String description) { /** * Get the sourceResourceType property: The application source, what it affects, e.g. Assessments. - * + * * @return the sourceResourceType value. */ public ApplicationSourceResourceType sourceResourceType() { @@ -92,7 +96,7 @@ public ApplicationSourceResourceType 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. */ @@ -103,7 +107,7 @@ public ApplicationProperties withSourceResourceType(ApplicationSourceResourceTyp /** * Get the conditionSets property: The application conditionSets - see examples. - * + * * @return the conditionSets value. */ public List conditionSets() { @@ -112,7 +116,7 @@ public List conditionSets() { /** * Set the conditionSets property: The application conditionSets - see examples. - * + * * @param conditionSets the conditionSets value to set. * @return the ApplicationProperties object itself. */ @@ -123,21 +127,17 @@ public ApplicationProperties withConditionSets(List conditionSets) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (sourceResourceType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sourceResourceType in model ApplicationProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property sourceResourceType in model ApplicationProperties")); } if (conditionSets() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property conditionSets in model ApplicationProperties")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property conditionSets in model ApplicationProperties")); } } 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 index 351e2b24190fc..698386ce96506 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.core.management.ProxyResource; import com.fasterxml.jackson.annotation.JsonProperty; -/** The ASC location of the subscription is in the "name" field. */ +/** + * The ASC location of the subscription is in the "name" field. + */ @Fluent public final class AscLocationInner extends ProxyResource { /* @@ -17,13 +19,15 @@ public final class AscLocationInner extends ProxyResource { @JsonProperty(value = "properties") private Object properties; - /** Creates an instance of AscLocationInner class. */ + /** + * Creates an instance of AscLocationInner class. + */ public AscLocationInner() { } /** * Get the properties property: An empty set of properties. - * + * * @return the properties value. */ public Object properties() { @@ -32,7 +36,7 @@ public Object properties() { /** * Set the properties property: An empty set of properties. - * + * * @param properties the properties value to set. * @return the AscLocationInner object itself. */ @@ -43,7 +47,7 @@ public AscLocationInner withProperties(Object properties) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 8360f8b33cc30..925be47a8c8d4 100644 --- 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 @@ -9,7 +9,9 @@ import com.azure.resourcemanager.security.models.AutoProvision; import com.fasterxml.jackson.annotation.JsonProperty; -/** Auto provisioning setting. */ +/** + * Auto provisioning setting. + */ @Fluent public final class AutoProvisioningSettingInner extends ProxyResource { /* @@ -18,13 +20,15 @@ public final class AutoProvisioningSettingInner extends ProxyResource { @JsonProperty(value = "properties") private AutoProvisioningSettingProperties innerProperties; - /** Creates an instance of AutoProvisioningSettingInner class. */ + /** + * Creates an instance of AutoProvisioningSettingInner class. + */ public AutoProvisioningSettingInner() { } /** * Get the innerProperties property: Auto provisioning setting data. - * + * * @return the innerProperties value. */ private AutoProvisioningSettingProperties innerProperties() { @@ -33,7 +37,7 @@ private AutoProvisioningSettingProperties innerProperties() { /** * Get the autoProvision property: Describes what kind of security agent provisioning action to take. - * + * * @return the autoProvision value. */ public AutoProvision autoProvision() { @@ -42,7 +46,7 @@ public AutoProvision 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. */ @@ -56,7 +60,7 @@ public AutoProvisioningSettingInner withAutoProvision(AutoProvision autoProvisio /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 52a8ebeec0129..f17bd03d8bd37 100644 --- 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 @@ -9,7 +9,9 @@ import com.azure.resourcemanager.security.models.AutoProvision; import com.fasterxml.jackson.annotation.JsonProperty; -/** describes properties of an auto provisioning setting. */ +/** + * describes properties of an auto provisioning setting. + */ @Fluent public final class AutoProvisioningSettingProperties { /* @@ -18,13 +20,15 @@ public final class AutoProvisioningSettingProperties { @JsonProperty(value = "autoProvision", required = true) private AutoProvision autoProvision; - /** Creates an instance of AutoProvisioningSettingProperties class. */ + /** + * 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() { @@ -33,7 +37,7 @@ public AutoProvision 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. */ @@ -44,15 +48,13 @@ public AutoProvisioningSettingProperties withAutoProvision(AutoProvision autoPro /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (autoProvision() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property autoProvision in model AutoProvisioningSettingProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property autoProvision in model AutoProvisioningSettingProperties")); } } 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 index 3881c341098ce..ffbb280ca023b 100644 --- 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 @@ -13,7 +13,9 @@ import java.util.List; import java.util.Map; -/** The security automation resource. */ +/** + * The security automation resource. + */ @Fluent public final class AutomationInner extends Resource { /* @@ -22,27 +24,33 @@ public final class AutomationInner extends Resource { @JsonProperty(value = "properties") private AutomationProperties innerProperties; - /** Creates an instance of AutomationInner class. */ + /** + * 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; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AutomationInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AutomationInner withTags(Map tags) { super.withTags(tags); @@ -51,7 +59,7 @@ public AutomationInner withTags(Map tags) { /** * Get the description property: The security automation description. - * + * * @return the description value. */ public String description() { @@ -60,7 +68,7 @@ public String description() { /** * Set the description property: The security automation description. - * + * * @param description the description value to set. * @return the AutomationInner object itself. */ @@ -74,7 +82,7 @@ public AutomationInner withDescription(String description) { /** * Get the isEnabled property: Indicates whether the security automation is enabled. - * + * * @return the isEnabled value. */ public Boolean isEnabled() { @@ -83,7 +91,7 @@ public Boolean isEnabled() { /** * Set the isEnabled property: Indicates whether the security automation is enabled. - * + * * @param isEnabled the isEnabled value to set. * @return the AutomationInner object itself. */ @@ -97,9 +105,9 @@ public AutomationInner withIsEnabled(Boolean isEnabled) { /** * 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. - * + * 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() { @@ -108,9 +116,9 @@ public List 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. - * + * 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. */ @@ -125,7 +133,7 @@ public AutomationInner withScopes(List scopes) { /** * 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() { @@ -135,7 +143,7 @@ public List 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. */ @@ -150,7 +158,7 @@ public AutomationInner withSources(List sources) { /** * 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() { @@ -160,7 +168,7 @@ public List 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. */ @@ -174,7 +182,7 @@ public AutomationInner withActions(List actions) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index c84b9645e4287..f0ec00d46ad2e 100644 --- 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 @@ -49,13 +49,15 @@ public final class AutomationProperties { @JsonProperty(value = "actions") private List actions; - /** Creates an instance of AutomationProperties class. */ + /** + * Creates an instance of AutomationProperties class. + */ public AutomationProperties() { } /** * Get the description property: The security automation description. - * + * * @return the description value. */ public String description() { @@ -64,7 +66,7 @@ public String description() { /** * Set the description property: The security automation description. - * + * * @param description the description value to set. * @return the AutomationProperties object itself. */ @@ -75,7 +77,7 @@ public AutomationProperties withDescription(String description) { /** * Get the isEnabled property: Indicates whether the security automation is enabled. - * + * * @return the isEnabled value. */ public Boolean isEnabled() { @@ -84,7 +86,7 @@ public Boolean isEnabled() { /** * Set the isEnabled property: Indicates whether the security automation is enabled. - * + * * @param isEnabled the isEnabled value to set. * @return the AutomationProperties object itself. */ @@ -95,9 +97,9 @@ public AutomationProperties withIsEnabled(Boolean isEnabled) { /** * 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. - * + * 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() { @@ -106,9 +108,9 @@ public List 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. - * + * 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. */ @@ -120,7 +122,7 @@ public AutomationProperties withScopes(List scopes) { /** * 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() { @@ -130,7 +132,7 @@ public List 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. */ @@ -142,7 +144,7 @@ public AutomationProperties withSources(List sources) { /** * 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() { @@ -152,7 +154,7 @@ public List 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. */ @@ -163,7 +165,7 @@ public AutomationProperties withActions(List actions) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index a43555c19211a..7ebb43e68de04 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The security automation model state property bag. */ +/** + * The security automation model state property bag. + */ @Fluent public final class AutomationValidationStatusInner { /* @@ -22,13 +24,15 @@ public final class AutomationValidationStatusInner { @JsonProperty(value = "message") private String message; - /** Creates an instance of AutomationValidationStatusInner class. */ + /** + * Creates an instance of AutomationValidationStatusInner class. + */ public AutomationValidationStatusInner() { } /** * Get the isValid property: Indicates whether the model is valid or not. - * + * * @return the isValid value. */ public Boolean isValid() { @@ -37,7 +41,7 @@ public Boolean isValid() { /** * Set the isValid property: Indicates whether the model is valid or not. - * + * * @param isValid the isValid value to set. * @return the AutomationValidationStatusInner object itself. */ @@ -48,7 +52,7 @@ public AutomationValidationStatusInner withIsValid(Boolean isValid) { /** * Get the message property: The validation message. - * + * * @return the message value. */ public String message() { @@ -57,7 +61,7 @@ public String message() { /** * Set the message property: The validation message. - * + * * @param message the message value to set. * @return the AutomationValidationStatusInner object itself. */ @@ -68,7 +72,7 @@ public AutomationValidationStatusInner withMessage(String message) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 new file mode 100644 index 0000000000000..65a89d987a176 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsOrgInner.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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.resourcemanager.security.models.AzureDevOpsOrgProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure DevOps Organization resource. + */ +@Fluent +public final class AzureDevOpsOrgInner extends ProxyResource { + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Azure DevOps Organization properties. + */ + @JsonProperty(value = "properties") + private AzureDevOpsOrgProperties properties; + + /** + * Creates an instance of AzureDevOpsOrgInner class. + */ + public AzureDevOpsOrgInner() { + } + + /** + * 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 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} 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 new file mode 100644 index 0000000000000..d84170ba3669a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsOrgListResponseInner.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * List of RP resources which supports pagination. + */ +@Fluent +public final class AzureDevOpsOrgListResponseInner { + /* + * Gets or sets list of resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets next link to scroll over the results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Creates an instance of AzureDevOpsOrgListResponseInner class. + */ + public AzureDevOpsOrgListResponseInner() { + } + + /** + * Get the value property: Gets or sets list of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets list of resources. + * + * @param value the value value to set. + * @return the AzureDevOpsOrgListResponseInner object itself. + */ + public AzureDevOpsOrgListResponseInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets next link to scroll over the results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets next link to scroll over the results. + * + * @param nextLink the nextLink value to set. + * @return the AzureDevOpsOrgListResponseInner object itself. + */ + public AzureDevOpsOrgListResponseInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} 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 new file mode 100644 index 0000000000000..0b80eb4533bdf --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsProjectInner.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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.resourcemanager.security.models.AzureDevOpsProjectProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure DevOps Project resource. + */ +@Fluent +public final class AzureDevOpsProjectInner extends ProxyResource { + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Azure DevOps Project properties. + */ + @JsonProperty(value = "properties") + private AzureDevOpsProjectProperties properties; + + /** + * Creates an instance of AzureDevOpsProjectInner class. + */ + public AzureDevOpsProjectInner() { + } + + /** + * 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 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} 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 new file mode 100644 index 0000000000000..ce96e9660324f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsRepositoryInner.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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.resourcemanager.security.models.AzureDevOpsRepositoryProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure DevOps Repository resource. + */ +@Fluent +public final class AzureDevOpsRepositoryInner extends ProxyResource { + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Azure DevOps Repository properties. + */ + @JsonProperty(value = "properties") + private AzureDevOpsRepositoryProperties properties; + + /** + * Creates an instance of AzureDevOpsRepositoryInner class. + */ + public AzureDevOpsRepositoryInner() { + } + + /** + * 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 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} 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 index 4017d627a9d07..209bd4b33efe6 100644 --- 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 @@ -11,7 +11,9 @@ import java.time.OffsetDateTime; import java.util.List; -/** Compliance of a scope. */ +/** + * Compliance of a scope. + */ @Immutable public final class ComplianceInner extends ProxyResource { /* @@ -20,13 +22,15 @@ public final class ComplianceInner extends ProxyResource { @JsonProperty(value = "properties") private ComplianceProperties innerProperties; - /** Creates an instance of ComplianceInner class. */ + /** + * Creates an instance of ComplianceInner class. + */ public ComplianceInner() { } /** * Get the innerProperties property: Compliance data. - * + * * @return the innerProperties value. */ private ComplianceProperties innerProperties() { @@ -35,7 +39,7 @@ private ComplianceProperties innerProperties() { /** * Get the assessmentTimestampUtcDate property: The timestamp when the Compliance calculation was conducted. - * + * * @return the assessmentTimestampUtcDate value. */ public OffsetDateTime assessmentTimestampUtcDate() { @@ -43,9 +47,9 @@ public OffsetDateTime 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). - * + * 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() { @@ -54,7 +58,7 @@ public Integer resourceCount() { /** * Get the assessmentResult property: An array of segment, which is the actually the compliance assessment. - * + * * @return the assessmentResult value. */ public List assessmentResult() { @@ -63,7 +67,7 @@ public List assessmentResult() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 8eb6d80114fc8..1ff87cb576075 100644 --- 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 @@ -36,13 +36,15 @@ public final class ComplianceProperties { @JsonProperty(value = "assessmentResult", access = JsonProperty.Access.WRITE_ONLY) private List assessmentResult; - /** Creates an instance of ComplianceProperties class. */ + /** + * Creates an instance of ComplianceProperties class. + */ public ComplianceProperties() { } /** * Get the assessmentTimestampUtcDate property: The timestamp when the Compliance calculation was conducted. - * + * * @return the assessmentTimestampUtcDate value. */ public OffsetDateTime assessmentTimestampUtcDate() { @@ -50,9 +52,9 @@ public OffsetDateTime 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). - * + * 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() { @@ -61,7 +63,7 @@ public Integer resourceCount() { /** * Get the assessmentResult property: An array of segment, which is the actually the compliance assessment. - * + * * @return the assessmentResult value. */ public List assessmentResult() { @@ -70,7 +72,7 @@ public List assessmentResult() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 4487e681da9ba..7ba1143528a38 100644 --- 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 @@ -9,7 +9,9 @@ import com.azure.resourcemanager.security.models.ResourceStatus; import com.fasterxml.jackson.annotation.JsonProperty; -/** a compliance result. */ +/** + * a compliance result. + */ @Immutable public final class ComplianceResultInner extends ProxyResource { /* @@ -18,13 +20,15 @@ public final class ComplianceResultInner extends ProxyResource { @JsonProperty(value = "properties") private ComplianceResultProperties innerProperties; - /** Creates an instance of ComplianceResultInner class. */ + /** + * Creates an instance of ComplianceResultInner class. + */ public ComplianceResultInner() { } /** * Get the innerProperties property: Compliance result data. - * + * * @return the innerProperties value. */ private ComplianceResultProperties innerProperties() { @@ -33,7 +37,7 @@ private ComplianceResultProperties innerProperties() { /** * Get the resourceStatus property: The status of the resource regarding a single assessment. - * + * * @return the resourceStatus value. */ public ResourceStatus resourceStatus() { @@ -42,7 +46,7 @@ public ResourceStatus resourceStatus() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 743f7fe1a8b7b..1b58d3960bcce 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.resourcemanager.security.models.ResourceStatus; import com.fasterxml.jackson.annotation.JsonProperty; -/** Compliance result data. */ +/** + * Compliance result data. + */ @Immutable public final class ComplianceResultProperties { /* @@ -17,13 +19,15 @@ public final class ComplianceResultProperties { @JsonProperty(value = "resourceStatus", access = JsonProperty.Access.WRITE_ONLY) private ResourceStatus resourceStatus; - /** Creates an instance of ComplianceResultProperties class. */ + /** + * Creates an instance of ComplianceResultProperties class. + */ public ComplianceResultProperties() { } /** * Get the resourceStatus property: The status of the resource regarding a single assessment. - * + * * @return the resourceStatus value. */ public ResourceStatus resourceStatus() { @@ -32,7 +36,7 @@ public ResourceStatus resourceStatus() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectionStringsInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectionStringsInner.java deleted file mode 100644 index 4e21ee921fae2..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectionStringsInner.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.IngestionConnectionString; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Connection string for ingesting security data and logs. */ -@Fluent -public final class ConnectionStringsInner { - /* - * Connection strings - */ - @JsonProperty(value = "value", required = true) - private List value; - - /** Creates an instance of ConnectionStringsInner class. */ - public ConnectionStringsInner() { - } - - /** - * Get the value property: Connection strings. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Connection strings. - * - * @param value the value value to set. - * @return the ConnectionStringsInner object itself. - */ - public ConnectionStringsInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model ConnectionStringsInner")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ConnectionStringsInner.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectorSettingInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectorSettingInner.java index 423238e44dabf..447751f0bfe10 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectorSettingInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectorSettingInner.java @@ -10,7 +10,9 @@ import com.azure.resourcemanager.security.models.HybridComputeSettingsProperties; import com.fasterxml.jackson.annotation.JsonProperty; -/** The connector setting. */ +/** + * The connector setting. + */ @Fluent public final class ConnectorSettingInner extends ProxyResource { /* @@ -19,13 +21,15 @@ public final class ConnectorSettingInner extends ProxyResource { @JsonProperty(value = "properties") private ConnectorSettingProperties innerProperties; - /** Creates an instance of ConnectorSettingInner class. */ + /** + * Creates an instance of ConnectorSettingInner class. + */ public ConnectorSettingInner() { } /** * Get the innerProperties property: Connector setting data. - * + * * @return the innerProperties value. */ private ConnectorSettingProperties innerProperties() { @@ -35,7 +39,7 @@ private ConnectorSettingProperties innerProperties() { /** * Get the hybridComputeSettings property: Settings for hybrid compute management. These settings are relevant only * for Arc autoProvision (Hybrid Compute). - * + * * @return the hybridComputeSettings value. */ public HybridComputeSettingsProperties hybridComputeSettings() { @@ -45,7 +49,7 @@ public HybridComputeSettingsProperties hybridComputeSettings() { /** * Set the hybridComputeSettings property: Settings for hybrid compute management. These settings are relevant only * for Arc autoProvision (Hybrid Compute). - * + * * @param hybridComputeSettings the hybridComputeSettings value to set. * @return the ConnectorSettingInner object itself. */ @@ -60,7 +64,7 @@ public ConnectorSettingInner withHybridComputeSettings(HybridComputeSettingsProp /** * Get the authenticationDetails property: Settings for authentication management, these settings are relevant only * for the cloud connector. - * + * * @return the authenticationDetails value. */ public AuthenticationDetailsProperties authenticationDetails() { @@ -70,7 +74,7 @@ public AuthenticationDetailsProperties authenticationDetails() { /** * Set the authenticationDetails property: Settings for authentication management, these settings are relevant only * for the cloud connector. - * + * * @param authenticationDetails the authenticationDetails value to set. * @return the ConnectorSettingInner object itself. */ @@ -84,7 +88,7 @@ public ConnectorSettingInner withAuthenticationDetails(AuthenticationDetailsProp /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectorSettingProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectorSettingProperties.java index 5a6a558eed594..800caa677e3bf 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectorSettingProperties.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectorSettingProperties.java @@ -9,7 +9,9 @@ import com.azure.resourcemanager.security.models.HybridComputeSettingsProperties; import com.fasterxml.jackson.annotation.JsonProperty; -/** Describes properties of a connector setting. */ +/** + * Describes properties of a connector setting. + */ @Fluent public final class ConnectorSettingProperties { /* @@ -24,14 +26,16 @@ public final class ConnectorSettingProperties { @JsonProperty(value = "authenticationDetails") private AuthenticationDetailsProperties authenticationDetails; - /** Creates an instance of ConnectorSettingProperties class. */ + /** + * Creates an instance of ConnectorSettingProperties class. + */ public ConnectorSettingProperties() { } /** * Get the hybridComputeSettings property: Settings for hybrid compute management. These settings are relevant only * for Arc autoProvision (Hybrid Compute). - * + * * @return the hybridComputeSettings value. */ public HybridComputeSettingsProperties hybridComputeSettings() { @@ -41,7 +45,7 @@ public HybridComputeSettingsProperties hybridComputeSettings() { /** * Set the hybridComputeSettings property: Settings for hybrid compute management. These settings are relevant only * for Arc autoProvision (Hybrid Compute). - * + * * @param hybridComputeSettings the hybridComputeSettings value to set. * @return the ConnectorSettingProperties object itself. */ @@ -53,7 +57,7 @@ public ConnectorSettingProperties withHybridComputeSettings(HybridComputeSetting /** * Get the authenticationDetails property: Settings for authentication management, these settings are relevant only * for the cloud connector. - * + * * @return the authenticationDetails value. */ public AuthenticationDetailsProperties authenticationDetails() { @@ -63,7 +67,7 @@ public AuthenticationDetailsProperties authenticationDetails() { /** * Set the authenticationDetails property: Settings for authentication management, these settings are relevant only * for the cloud connector. - * + * * @param authenticationDetails the authenticationDetails value to set. * @return the ConnectorSettingProperties object itself. */ @@ -74,7 +78,7 @@ public ConnectorSettingProperties withAuthenticationDetails(AuthenticationDetail /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationInner.java index 77f1347c266e5..405c0fe7d59ea 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationInner.java @@ -11,7 +11,9 @@ import com.azure.resourcemanager.security.models.SupportedCloudEnum; import com.fasterxml.jackson.annotation.JsonProperty; -/** Custom Assessment Automation. */ +/** + * Custom Assessment Automation. + */ @Fluent public final class CustomAssessmentAutomationInner extends ProxyResource { /* @@ -26,13 +28,15 @@ public final class CustomAssessmentAutomationInner extends ProxyResource { @JsonProperty(value = "properties") private CustomAssessmentAutomationProperties innerProperties; - /** Creates an instance of CustomAssessmentAutomationInner class. */ + /** + * Creates an instance of CustomAssessmentAutomationInner class. + */ public CustomAssessmentAutomationInner() { } /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { @@ -41,7 +45,7 @@ public SystemData systemData() { /** * Get the innerProperties property: describes Custom Assessment Automation properties. - * + * * @return the innerProperties value. */ private CustomAssessmentAutomationProperties innerProperties() { @@ -49,8 +53,9 @@ private CustomAssessmentAutomationProperties innerProperties() { } /** - * Get the compressedQuery property: GZip encoded KQL query representing the assessment automation results required. - * + * Get the compressedQuery property: GZip encoded KQL query representing the assessment automation results + * required. + * * @return the compressedQuery value. */ public String compressedQuery() { @@ -58,8 +63,9 @@ public String compressedQuery() { } /** - * Set the compressedQuery property: GZip encoded KQL query representing the assessment automation results required. - * + * Set the compressedQuery property: GZip encoded KQL query representing the assessment automation results + * required. + * * @param compressedQuery the compressedQuery value to set. * @return the CustomAssessmentAutomationInner object itself. */ @@ -73,7 +79,7 @@ public CustomAssessmentAutomationInner withCompressedQuery(String compressedQuer /** * Get the supportedCloud property: Relevant cloud for the custom assessment automation. - * + * * @return the supportedCloud value. */ public SupportedCloudEnum supportedCloud() { @@ -82,7 +88,7 @@ public SupportedCloudEnum supportedCloud() { /** * Set the supportedCloud property: Relevant cloud for the custom assessment automation. - * + * * @param supportedCloud the supportedCloud value to set. * @return the CustomAssessmentAutomationInner object itself. */ @@ -96,7 +102,7 @@ public CustomAssessmentAutomationInner withSupportedCloud(SupportedCloudEnum sup /** * Get the severity property: The severity to relate to the assessments generated by this assessment automation. - * + * * @return the severity value. */ public SeverityEnum severity() { @@ -105,7 +111,7 @@ public SeverityEnum severity() { /** * Set the severity property: The severity to relate to the assessments generated by this assessment automation. - * + * * @param severity the severity value to set. * @return the CustomAssessmentAutomationInner object itself. */ @@ -119,7 +125,7 @@ public CustomAssessmentAutomationInner withSeverity(SeverityEnum severity) { /** * Get the displayName property: The display name of the assessments generated by this assessment automation. - * + * * @return the displayName value. */ public String displayName() { @@ -128,7 +134,7 @@ public String displayName() { /** * Set the displayName property: The display name of the assessments generated by this assessment automation. - * + * * @param displayName the displayName value to set. * @return the CustomAssessmentAutomationInner object itself. */ @@ -143,7 +149,7 @@ public CustomAssessmentAutomationInner withDisplayName(String displayName) { /** * Get the description property: The description to relate to the assessments generated by this assessment * automation. - * + * * @return the description value. */ public String description() { @@ -153,7 +159,7 @@ public String description() { /** * Set the description property: The description to relate to the assessments generated by this assessment * automation. - * + * * @param description the description value to set. * @return the CustomAssessmentAutomationInner object itself. */ @@ -168,7 +174,7 @@ public CustomAssessmentAutomationInner withDescription(String description) { /** * Get the remediationDescription property: The remediation description to relate to the assessments generated by * this assessment automation. - * + * * @return the remediationDescription value. */ public String remediationDescription() { @@ -178,7 +184,7 @@ public String remediationDescription() { /** * Set the remediationDescription property: The remediation description to relate to the assessments generated by * this assessment automation. - * + * * @param remediationDescription the remediationDescription value to set. * @return the CustomAssessmentAutomationInner object itself. */ @@ -193,7 +199,7 @@ public CustomAssessmentAutomationInner withRemediationDescription(String remedia /** * Get the assessmentKey property: The assessment metadata key used when an assessment is generated for this * assessment automation. - * + * * @return the assessmentKey value. */ public String assessmentKey() { @@ -203,7 +209,7 @@ public String assessmentKey() { /** * Set the assessmentKey property: The assessment metadata key used when an assessment is generated for this * assessment automation. - * + * * @param assessmentKey the assessmentKey value to set. * @return the CustomAssessmentAutomationInner object itself. */ @@ -217,7 +223,7 @@ public CustomAssessmentAutomationInner withAssessmentKey(String assessmentKey) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationProperties.java index 9e8384522a946..7c86d35c0290d 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationProperties.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationProperties.java @@ -9,7 +9,9 @@ import com.azure.resourcemanager.security.models.SupportedCloudEnum; import com.fasterxml.jackson.annotation.JsonProperty; -/** describes the Custom Assessment Automation properties. */ +/** + * describes the Custom Assessment Automation properties. + */ @Fluent public final class CustomAssessmentAutomationProperties { /* @@ -54,13 +56,16 @@ public final class CustomAssessmentAutomationProperties { @JsonProperty(value = "assessmentKey") private String assessmentKey; - /** Creates an instance of CustomAssessmentAutomationProperties class. */ + /** + * Creates an instance of CustomAssessmentAutomationProperties class. + */ public CustomAssessmentAutomationProperties() { } /** - * Get the compressedQuery property: GZip encoded KQL query representing the assessment automation results required. - * + * Get the compressedQuery property: GZip encoded KQL query representing the assessment automation results + * required. + * * @return the compressedQuery value. */ public String compressedQuery() { @@ -68,8 +73,9 @@ public String compressedQuery() { } /** - * Set the compressedQuery property: GZip encoded KQL query representing the assessment automation results required. - * + * Set the compressedQuery property: GZip encoded KQL query representing the assessment automation results + * required. + * * @param compressedQuery the compressedQuery value to set. * @return the CustomAssessmentAutomationProperties object itself. */ @@ -80,7 +86,7 @@ public CustomAssessmentAutomationProperties withCompressedQuery(String compresse /** * Get the supportedCloud property: Relevant cloud for the custom assessment automation. - * + * * @return the supportedCloud value. */ public SupportedCloudEnum supportedCloud() { @@ -89,7 +95,7 @@ public SupportedCloudEnum supportedCloud() { /** * Set the supportedCloud property: Relevant cloud for the custom assessment automation. - * + * * @param supportedCloud the supportedCloud value to set. * @return the CustomAssessmentAutomationProperties object itself. */ @@ -100,7 +106,7 @@ public CustomAssessmentAutomationProperties withSupportedCloud(SupportedCloudEnu /** * Get the severity property: The severity to relate to the assessments generated by this assessment automation. - * + * * @return the severity value. */ public SeverityEnum severity() { @@ -109,7 +115,7 @@ public SeverityEnum severity() { /** * Set the severity property: The severity to relate to the assessments generated by this assessment automation. - * + * * @param severity the severity value to set. * @return the CustomAssessmentAutomationProperties object itself. */ @@ -120,7 +126,7 @@ public CustomAssessmentAutomationProperties withSeverity(SeverityEnum severity) /** * Get the displayName property: The display name of the assessments generated by this assessment automation. - * + * * @return the displayName value. */ public String displayName() { @@ -129,7 +135,7 @@ public String displayName() { /** * Set the displayName property: The display name of the assessments generated by this assessment automation. - * + * * @param displayName the displayName value to set. * @return the CustomAssessmentAutomationProperties object itself. */ @@ -141,7 +147,7 @@ public CustomAssessmentAutomationProperties withDisplayName(String displayName) /** * Get the description property: The description to relate to the assessments generated by this assessment * automation. - * + * * @return the description value. */ public String description() { @@ -151,7 +157,7 @@ public String description() { /** * Set the description property: The description to relate to the assessments generated by this assessment * automation. - * + * * @param description the description value to set. * @return the CustomAssessmentAutomationProperties object itself. */ @@ -163,7 +169,7 @@ public CustomAssessmentAutomationProperties withDescription(String description) /** * Get the remediationDescription property: The remediation description to relate to the assessments generated by * this assessment automation. - * + * * @return the remediationDescription value. */ public String remediationDescription() { @@ -173,7 +179,7 @@ public String remediationDescription() { /** * Set the remediationDescription property: The remediation description to relate to the assessments generated by * this assessment automation. - * + * * @param remediationDescription the remediationDescription value to set. * @return the CustomAssessmentAutomationProperties object itself. */ @@ -185,7 +191,7 @@ public CustomAssessmentAutomationProperties withRemediationDescription(String re /** * Get the assessmentKey property: The assessment metadata key used when an assessment is generated for this * assessment automation. - * + * * @return the assessmentKey value. */ public String assessmentKey() { @@ -195,7 +201,7 @@ public String assessmentKey() { /** * Set the assessmentKey property: The assessment metadata key used when an assessment is generated for this * assessment automation. - * + * * @param assessmentKey the assessmentKey value to set. * @return the CustomAssessmentAutomationProperties object itself. */ @@ -206,7 +212,7 @@ public CustomAssessmentAutomationProperties withAssessmentKey(String assessmentK /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationRequestProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationRequestProperties.java index 524a5c5db165c..69a9046298a65 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationRequestProperties.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationRequestProperties.java @@ -9,7 +9,9 @@ import com.azure.resourcemanager.security.models.SupportedCloudEnum; import com.fasterxml.jackson.annotation.JsonProperty; -/** describes the Custom Assessment Automation properties. */ +/** + * describes the Custom Assessment Automation properties. + */ @Fluent public final class CustomAssessmentAutomationRequestProperties { /* @@ -48,14 +50,16 @@ public final class CustomAssessmentAutomationRequestProperties { @JsonProperty(value = "remediationDescription") private String remediationDescription; - /** Creates an instance of CustomAssessmentAutomationRequestProperties class. */ + /** + * Creates an instance of CustomAssessmentAutomationRequestProperties class. + */ public CustomAssessmentAutomationRequestProperties() { } /** * Get the compressedQuery property: Base 64 encoded KQL query representing the assessment automation results * required. - * + * * @return the compressedQuery value. */ public String compressedQuery() { @@ -65,7 +69,7 @@ public String compressedQuery() { /** * Set the compressedQuery property: Base 64 encoded KQL query representing the assessment automation results * required. - * + * * @param compressedQuery the compressedQuery value to set. * @return the CustomAssessmentAutomationRequestProperties object itself. */ @@ -76,7 +80,7 @@ public CustomAssessmentAutomationRequestProperties withCompressedQuery(String co /** * Get the supportedCloud property: Relevant cloud for the custom assessment automation. - * + * * @return the supportedCloud value. */ public SupportedCloudEnum supportedCloud() { @@ -85,7 +89,7 @@ public SupportedCloudEnum supportedCloud() { /** * Set the supportedCloud property: Relevant cloud for the custom assessment automation. - * + * * @param supportedCloud the supportedCloud value to set. * @return the CustomAssessmentAutomationRequestProperties object itself. */ @@ -96,7 +100,7 @@ public CustomAssessmentAutomationRequestProperties withSupportedCloud(SupportedC /** * Get the severity property: The severity to relate to the assessments generated by this assessment automation. - * + * * @return the severity value. */ public SeverityEnum severity() { @@ -105,7 +109,7 @@ public SeverityEnum severity() { /** * Set the severity property: The severity to relate to the assessments generated by this assessment automation. - * + * * @param severity the severity value to set. * @return the CustomAssessmentAutomationRequestProperties object itself. */ @@ -116,7 +120,7 @@ public CustomAssessmentAutomationRequestProperties withSeverity(SeverityEnum sev /** * Get the displayName property: The display name of the assessments generated by this assessment automation. - * + * * @return the displayName value. */ public String displayName() { @@ -125,7 +129,7 @@ public String displayName() { /** * Set the displayName property: The display name of the assessments generated by this assessment automation. - * + * * @param displayName the displayName value to set. * @return the CustomAssessmentAutomationRequestProperties object itself. */ @@ -137,7 +141,7 @@ public CustomAssessmentAutomationRequestProperties withDisplayName(String displa /** * Get the description property: The description to relate to the assessments generated by this assessment * automation. - * + * * @return the description value. */ public String description() { @@ -147,7 +151,7 @@ public String description() { /** * Set the description property: The description to relate to the assessments generated by this assessment * automation. - * + * * @param description the description value to set. * @return the CustomAssessmentAutomationRequestProperties object itself. */ @@ -159,7 +163,7 @@ public CustomAssessmentAutomationRequestProperties withDescription(String descri /** * Get the remediationDescription property: The remediation description to relate to the assessments generated by * this assessment automation. - * + * * @return the remediationDescription value. */ public String remediationDescription() { @@ -169,7 +173,7 @@ public String remediationDescription() { /** * Set the remediationDescription property: The remediation description to relate to the assessments generated by * this assessment automation. - * + * * @param remediationDescription the remediationDescription value to set. * @return the CustomAssessmentAutomationRequestProperties object itself. */ @@ -180,7 +184,7 @@ public CustomAssessmentAutomationRequestProperties withRemediationDescription(St /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentInner.java index 0ac905684d259..3a24a6da384ba 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentInner.java @@ -9,7 +9,9 @@ import com.azure.core.management.SystemData; import com.fasterxml.jackson.annotation.JsonProperty; -/** Custom entity store assignment. */ +/** + * Custom entity store assignment. + */ @Fluent public final class CustomEntityStoreAssignmentInner extends ProxyResource { /* @@ -24,13 +26,15 @@ public final class CustomEntityStoreAssignmentInner extends ProxyResource { @JsonProperty(value = "properties") private CustomEntityStoreAssignmentProperties innerProperties; - /** Creates an instance of CustomEntityStoreAssignmentInner class. */ + /** + * Creates an instance of CustomEntityStoreAssignmentInner class. + */ public CustomEntityStoreAssignmentInner() { } /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { @@ -39,7 +43,7 @@ public SystemData systemData() { /** * Get the innerProperties property: describes custom entity store assignment properties. - * + * * @return the innerProperties value. */ private CustomEntityStoreAssignmentProperties innerProperties() { @@ -49,7 +53,7 @@ private CustomEntityStoreAssignmentProperties innerProperties() { /** * Get the principal property: The principal assigned with entity store. Format of principal is: [AAD * type]=[PrincipalObjectId];[TenantId]. - * + * * @return the principal value. */ public String principal() { @@ -59,7 +63,7 @@ public String principal() { /** * Set the principal property: The principal assigned with entity store. Format of principal is: [AAD * type]=[PrincipalObjectId];[TenantId]. - * + * * @param principal the principal value to set. * @return the CustomEntityStoreAssignmentInner object itself. */ @@ -73,7 +77,7 @@ public CustomEntityStoreAssignmentInner withPrincipal(String principal) { /** * Get the entityStoreDatabaseLink property: The link to entity store database. - * + * * @return the entityStoreDatabaseLink value. */ public String entityStoreDatabaseLink() { @@ -82,7 +86,7 @@ public String entityStoreDatabaseLink() { /** * Set the entityStoreDatabaseLink property: The link to entity store database. - * + * * @param entityStoreDatabaseLink the entityStoreDatabaseLink value to set. * @return the CustomEntityStoreAssignmentInner object itself. */ @@ -96,7 +100,7 @@ public CustomEntityStoreAssignmentInner withEntityStoreDatabaseLink(String entit /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentProperties.java index cf2b86ebd137c..b6b881e2da6e4 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentProperties.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentProperties.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** describes the custom entity store assignment properties. */ +/** + * describes the custom entity store assignment properties. + */ @Fluent public final class CustomEntityStoreAssignmentProperties { /* @@ -22,14 +24,16 @@ public final class CustomEntityStoreAssignmentProperties { @JsonProperty(value = "entityStoreDatabaseLink") private String entityStoreDatabaseLink; - /** Creates an instance of CustomEntityStoreAssignmentProperties class. */ + /** + * Creates an instance of CustomEntityStoreAssignmentProperties class. + */ public CustomEntityStoreAssignmentProperties() { } /** * Get the principal property: The principal assigned with entity store. Format of principal is: [AAD * type]=[PrincipalObjectId];[TenantId]. - * + * * @return the principal value. */ public String principal() { @@ -39,7 +43,7 @@ public String principal() { /** * Set the principal property: The principal assigned with entity store. Format of principal is: [AAD * type]=[PrincipalObjectId];[TenantId]. - * + * * @param principal the principal value to set. * @return the CustomEntityStoreAssignmentProperties object itself. */ @@ -50,7 +54,7 @@ public CustomEntityStoreAssignmentProperties withPrincipal(String principal) { /** * Get the entityStoreDatabaseLink property: The link to entity store database. - * + * * @return the entityStoreDatabaseLink value. */ public String entityStoreDatabaseLink() { @@ -59,7 +63,7 @@ public String entityStoreDatabaseLink() { /** * Set the entityStoreDatabaseLink property: The link to entity store database. - * + * * @param entityStoreDatabaseLink the entityStoreDatabaseLink value to set. * @return the CustomEntityStoreAssignmentProperties object itself. */ @@ -70,7 +74,7 @@ public CustomEntityStoreAssignmentProperties withEntityStoreDatabaseLink(String /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentRequestProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentRequestProperties.java index fc9ebcd59cabe..07235339fa567 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentRequestProperties.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentRequestProperties.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** describes properties of custom entity store assignment request. */ +/** + * describes properties of custom entity store assignment request. + */ @Fluent public final class CustomEntityStoreAssignmentRequestProperties { /* @@ -17,14 +19,16 @@ public final class CustomEntityStoreAssignmentRequestProperties { @JsonProperty(value = "principal") private String principal; - /** Creates an instance of CustomEntityStoreAssignmentRequestProperties class. */ + /** + * Creates an instance of CustomEntityStoreAssignmentRequestProperties class. + */ public CustomEntityStoreAssignmentRequestProperties() { } /** - * Get the principal property: The principal assigned with entity store. If not provided, will use caller principal. - * Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]. - * + * Get the principal property: The principal assigned with entity store. If not provided, will use caller + * principal. Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]. + * * @return the principal value. */ public String principal() { @@ -32,9 +36,9 @@ public String principal() { } /** - * Set the principal property: The principal assigned with entity store. If not provided, will use caller principal. - * Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]. - * + * Set the principal property: The principal assigned with entity store. If not provided, will use caller + * principal. Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]. + * * @param principal the principal value to set. * @return the CustomEntityStoreAssignmentRequestProperties object itself. */ @@ -45,7 +49,7 @@ public CustomEntityStoreAssignmentRequestProperties withPrincipal(String princip /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 5f8daf7eabc5f..eca261e08f1f2 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The data export setting properties. */ +/** + * The data export setting properties. + */ @Fluent public final class DataExportSettingProperties { /* @@ -16,13 +18,15 @@ public final class DataExportSettingProperties { @JsonProperty(value = "enabled", required = true) private boolean enabled; - /** Creates an instance of DataExportSettingProperties class. */ + /** + * 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() { @@ -31,7 +35,7 @@ public boolean enabled() { /** * Set the enabled property: Is the data export setting enabled. - * + * * @param enabled the enabled value to set. * @return the DataExportSettingProperties object itself. */ @@ -42,7 +46,7 @@ public DataExportSettingProperties withEnabled(boolean enabled) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 new file mode 100644 index 0000000000000..0a1562f2ddd55 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DefenderForStorageSettingInner.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.security.models.OperationStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Defender for Storage resource. + */ +@Fluent +public final class DefenderForStorageSettingInner extends ProxyResource { + /* + * Defender for Storage resource properties. + */ + @JsonProperty(value = "properties") + private DefenderForStorageSettingProperties innerProperties; + + /** + * Creates an instance of DefenderForStorageSettingInner class. + */ + public DefenderForStorageSettingInner() { + } + + /** + * Get the innerProperties property: Defender for Storage resource properties. + * + * @return the innerProperties value. + */ + private DefenderForStorageSettingProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the isEnabled property: Indicates whether Defender for Storage is enabled on this storage account. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().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 DefenderForStorageSettingInner object itself. + */ + public DefenderForStorageSettingInner withIsEnabled(Boolean isEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new DefenderForStorageSettingProperties(); + } + this.innerProperties().withIsEnabled(isEnabled); + 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.innerProperties() == null ? null : this.innerProperties().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 DefenderForStorageSettingInner object itself. + */ + public DefenderForStorageSettingInner + withOverrideSubscriptionLevelSettings(Boolean overrideSubscriptionLevelSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new DefenderForStorageSettingProperties(); + } + this.innerProperties().withOverrideSubscriptionLevelSettings(overrideSubscriptionLevelSettings); + return this; + } + + /** + * Get the scanResultsEventGridTopicResourceId property: Optional. Resource id of an Event Grid Topic to send scan + * results to. + * + * @return the scanResultsEventGridTopicResourceId value. + */ + public String scanResultsEventGridTopicResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().scanResultsEventGridTopicResourceId(); + } + + /** + * Set the scanResultsEventGridTopicResourceId property: Optional. Resource id of an Event Grid Topic to send scan + * results to. + * + * @param scanResultsEventGridTopicResourceId the scanResultsEventGridTopicResourceId value to set. + * @return the DefenderForStorageSettingInner object itself. + */ + public DefenderForStorageSettingInner + withScanResultsEventGridTopicResourceId(String scanResultsEventGridTopicResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new DefenderForStorageSettingProperties(); + } + this.innerProperties().withScanResultsEventGridTopicResourceId(scanResultsEventGridTopicResourceId); + return this; + } + + /** + * Get the operationStatus property: Upon failure or partial success. Additional data describing Malware Scanning + * enable/disable operation. + * + * @return the operationStatus value. + */ + public OperationStatus operationStatus() { + return this.innerProperties() == null ? null : this.innerProperties().operationStatus(); + } + + /** + * Get the isEnabledMalwareScanningIsEnabled property: Indicates whether On Upload malware scanning should be + * enabled. + * + * @return the isEnabledMalwareScanningIsEnabled value. + */ + public Boolean isEnabledMalwareScanningIsEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().isEnabledMalwareScanningIsEnabled(); + } + + /** + * Set the isEnabledMalwareScanningIsEnabled property: Indicates whether On Upload malware scanning should be + * enabled. + * + * @param isEnabledMalwareScanningIsEnabled the isEnabledMalwareScanningIsEnabled value to set. + * @return the DefenderForStorageSettingInner object itself. + */ + public DefenderForStorageSettingInner + withIsEnabledMalwareScanningIsEnabled(Boolean isEnabledMalwareScanningIsEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new DefenderForStorageSettingProperties(); + } + this.innerProperties().withIsEnabledMalwareScanningIsEnabled(isEnabledMalwareScanningIsEnabled); + return this; + } + + /** + * Get the capGBPerMonth property: Defines the max GB to be scanned per Month. Set to -1 if no capping is needed. + * + * @return the capGBPerMonth value. + */ + public Integer capGBPerMonth() { + return this.innerProperties() == null ? null : this.innerProperties().capGBPerMonth(); + } + + /** + * Set the capGBPerMonth property: Defines the max GB to be scanned per Month. Set to -1 if no capping is needed. + * + * @param capGBPerMonth the capGBPerMonth value to set. + * @return the DefenderForStorageSettingInner object itself. + */ + public DefenderForStorageSettingInner withCapGBPerMonth(Integer capGBPerMonth) { + if (this.innerProperties() == null) { + this.innerProperties = new DefenderForStorageSettingProperties(); + } + this.innerProperties().withCapGBPerMonth(capGBPerMonth); + return this; + } + + /** + * Get the isEnabledSensitiveDataDiscoveryIsEnabled property: Indicates whether Sensitive Data Discovery should be + * enabled. + * + * @return the isEnabledSensitiveDataDiscoveryIsEnabled value. + */ + public Boolean isEnabledSensitiveDataDiscoveryIsEnabled() { + return this.innerProperties() == null ? null + : this.innerProperties().isEnabledSensitiveDataDiscoveryIsEnabled(); + } + + /** + * Set the isEnabledSensitiveDataDiscoveryIsEnabled property: Indicates whether Sensitive Data Discovery should be + * enabled. + * + * @param isEnabledSensitiveDataDiscoveryIsEnabled the isEnabledSensitiveDataDiscoveryIsEnabled value to set. + * @return the DefenderForStorageSettingInner object itself. + */ + public DefenderForStorageSettingInner + withIsEnabledSensitiveDataDiscoveryIsEnabled(Boolean isEnabledSensitiveDataDiscoveryIsEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new DefenderForStorageSettingProperties(); + } + this.innerProperties().withIsEnabledSensitiveDataDiscoveryIsEnabled(isEnabledSensitiveDataDiscoveryIsEnabled); + return this; + } + + /** + * Get the operationStatusSensitiveDataDiscoveryOperationStatus property: Upon failure or partial success. + * Additional data describing Sensitive Data Discovery enable/disable operation. + * + * @return the operationStatusSensitiveDataDiscoveryOperationStatus value. + */ + public OperationStatus operationStatusSensitiveDataDiscoveryOperationStatus() { + return this.innerProperties() == null ? null + : this.innerProperties().operationStatusSensitiveDataDiscoveryOperationStatus(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DefenderForStorageSettingProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DefenderForStorageSettingProperties.java new file mode 100644 index 0000000000000..f462bb803cd01 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DefenderForStorageSettingProperties.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.security.models.OperationStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defender for Storage resource properties. + */ +@Fluent +public final class DefenderForStorageSettingProperties { + /* + * Indicates whether Defender for Storage is enabled on this storage account. + */ + @JsonProperty(value = "isEnabled") + private Boolean isEnabled; + + /* + * Properties of Malware Scanning. + */ + @JsonProperty(value = "malwareScanning") + private MalwareScanningProperties innerMalwareScanning; + + /* + * Properties of Sensitive Data Discovery. + */ + @JsonProperty(value = "sensitiveDataDiscovery") + private SensitiveDataDiscoveryProperties innerSensitiveDataDiscovery; + + /* + * Indicates whether the settings defined for this storage account should override the settings defined for the + * subscription. + */ + @JsonProperty(value = "overrideSubscriptionLevelSettings") + 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 innerMalwareScanning property: Properties of Malware Scanning. + * + * @return the innerMalwareScanning value. + */ + private MalwareScanningProperties innerMalwareScanning() { + return this.innerMalwareScanning; + } + + /** + * Get the innerSensitiveDataDiscovery property: Properties of Sensitive Data Discovery. + * + * @return the innerSensitiveDataDiscovery value. + */ + private SensitiveDataDiscoveryProperties innerSensitiveDataDiscovery() { + return this.innerSensitiveDataDiscovery; + } + + /** + * 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; + } + + /** + * Get the scanResultsEventGridTopicResourceId property: Optional. Resource id of an Event Grid Topic to send scan + * results to. + * + * @return the scanResultsEventGridTopicResourceId value. + */ + public String scanResultsEventGridTopicResourceId() { + return this.innerMalwareScanning() == null ? null + : this.innerMalwareScanning().scanResultsEventGridTopicResourceId(); + } + + /** + * Set the scanResultsEventGridTopicResourceId property: Optional. Resource id of an Event Grid Topic to send scan + * results to. + * + * @param scanResultsEventGridTopicResourceId the scanResultsEventGridTopicResourceId value to set. + * @return the DefenderForStorageSettingProperties object itself. + */ + public DefenderForStorageSettingProperties + withScanResultsEventGridTopicResourceId(String scanResultsEventGridTopicResourceId) { + if (this.innerMalwareScanning() == null) { + this.innerMalwareScanning = new MalwareScanningProperties(); + } + this.innerMalwareScanning().withScanResultsEventGridTopicResourceId(scanResultsEventGridTopicResourceId); + return this; + } + + /** + * Get the operationStatus property: Upon failure or partial success. Additional data describing Malware Scanning + * enable/disable operation. + * + * @return the operationStatus value. + */ + public OperationStatus operationStatus() { + return this.innerMalwareScanning() == null ? null : this.innerMalwareScanning().operationStatus(); + } + + /** + * Get the isEnabled property: Indicates whether On Upload malware scanning should be enabled. + * + * @return the isEnabled value. + */ + public Boolean isEnabledMalwareScanningIsEnabled() { + return this.innerMalwareScanning() == null ? null : this.innerMalwareScanning().isEnabled(); + } + + /** + * Set the isEnabled property: Indicates whether On Upload malware scanning should be enabled. + * + * @param isEnabled the isEnabled value to set. + * @return the DefenderForStorageSettingProperties object itself. + */ + public DefenderForStorageSettingProperties withIsEnabledMalwareScanningIsEnabled(Boolean isEnabled) { + if (this.innerMalwareScanning() == null) { + this.innerMalwareScanning = new MalwareScanningProperties(); + } + this.innerMalwareScanning().withIsEnabled(isEnabled); + return this; + } + + /** + * Get the capGBPerMonth property: Defines the max GB to be scanned per Month. Set to -1 if no capping is needed. + * + * @return the capGBPerMonth value. + */ + public Integer capGBPerMonth() { + return this.innerMalwareScanning() == null ? null : this.innerMalwareScanning().capGBPerMonth(); + } + + /** + * Set the capGBPerMonth property: Defines the max GB to be scanned per Month. Set to -1 if no capping is needed. + * + * @param capGBPerMonth the capGBPerMonth value to set. + * @return the DefenderForStorageSettingProperties object itself. + */ + public DefenderForStorageSettingProperties withCapGBPerMonth(Integer capGBPerMonth) { + if (this.innerMalwareScanning() == null) { + this.innerMalwareScanning = new MalwareScanningProperties(); + } + this.innerMalwareScanning().withCapGBPerMonth(capGBPerMonth); + return this; + } + + /** + * Get the isEnabled property: Indicates whether Sensitive Data Discovery should be enabled. + * + * @return the isEnabled value. + */ + public Boolean isEnabledSensitiveDataDiscoveryIsEnabled() { + return this.innerSensitiveDataDiscovery() == null ? null : this.innerSensitiveDataDiscovery().isEnabled(); + } + + /** + * Set the isEnabled property: Indicates whether Sensitive Data Discovery should be enabled. + * + * @param isEnabled the isEnabled value to set. + * @return the DefenderForStorageSettingProperties object itself. + */ + public DefenderForStorageSettingProperties withIsEnabledSensitiveDataDiscoveryIsEnabled(Boolean isEnabled) { + if (this.innerSensitiveDataDiscovery() == null) { + this.innerSensitiveDataDiscovery = new SensitiveDataDiscoveryProperties(); + } + this.innerSensitiveDataDiscovery().withIsEnabled(isEnabled); + return this; + } + + /** + * Get the operationStatus property: Upon failure or partial success. Additional data describing Sensitive Data + * Discovery enable/disable operation. + * + * @return the operationStatus value. + */ + public OperationStatus operationStatusSensitiveDataDiscoveryOperationStatus() { + return this.innerSensitiveDataDiscovery() == null ? null : this.innerSensitiveDataDiscovery().operationStatus(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerMalwareScanning() != null) { + innerMalwareScanning().validate(); + } + if (innerSensitiveDataDiscovery() != null) { + innerSensitiveDataDiscovery().validate(); + } + } +} 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 new file mode 100644 index 0000000000000..84cd2be215f63 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DevOpsConfigurationInner.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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.resourcemanager.security.models.DevOpsConfigurationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * DevOps Configuration resource. + */ +@Fluent +public final class DevOpsConfigurationInner extends ProxyResource { + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * DevOps Configuration properties. + */ + @JsonProperty(value = "properties") + private DevOpsConfigurationProperties properties; + + /** + * Creates an instance of DevOpsConfigurationInner class. + */ + public DevOpsConfigurationInner() { + } + + /** + * 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 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} 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 index 29aa17350b738..4ac5384380fa6 100644 --- 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 @@ -13,7 +13,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The device security group resource. */ +/** + * The device security group resource. + */ @Fluent public final class DeviceSecurityGroupInner extends ProxyResource { /* @@ -22,13 +24,15 @@ public final class DeviceSecurityGroupInner extends ProxyResource { @JsonProperty(value = "properties") private DeviceSecurityGroupProperties innerProperties; - /** Creates an instance of DeviceSecurityGroupInner class. */ + /** + * Creates an instance of DeviceSecurityGroupInner class. + */ public DeviceSecurityGroupInner() { } /** * Get the innerProperties property: Device Security group data. - * + * * @return the innerProperties value. */ private DeviceSecurityGroupProperties innerProperties() { @@ -37,7 +41,7 @@ private DeviceSecurityGroupProperties innerProperties() { /** * Get the thresholdRules property: The list of custom alert threshold rules. - * + * * @return the thresholdRules value. */ public List thresholdRules() { @@ -46,7 +50,7 @@ public List thresholdRules() { /** * Set the thresholdRules property: The list of custom alert threshold rules. - * + * * @param thresholdRules the thresholdRules value to set. * @return the DeviceSecurityGroupInner object itself. */ @@ -60,7 +64,7 @@ public DeviceSecurityGroupInner withThresholdRules(List timeWindowRules() { @@ -69,7 +73,7 @@ public List 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. */ @@ -83,7 +87,7 @@ public DeviceSecurityGroupInner withTimeWindowRules(List allowlistRules() { @@ -92,7 +96,7 @@ public List allowlistRules() { /** * Set the allowlistRules property: The allow-list custom alert rules. - * + * * @param allowlistRules the allowlistRules value to set. * @return the DeviceSecurityGroupInner object itself. */ @@ -106,7 +110,7 @@ public DeviceSecurityGroupInner withAllowlistRules(List denylistRules() { @@ -115,7 +119,7 @@ public List denylistRules() { /** * Set the denylistRules property: The deny-list custom alert rules. - * + * * @param denylistRules the denylistRules value to set. * @return the DeviceSecurityGroupInner object itself. */ @@ -129,7 +133,7 @@ public DeviceSecurityGroupInner withDenylistRules(List /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 0ee8520c518c5..89cd036e97e25 100644 --- 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 @@ -12,7 +12,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** describes properties of a security group. */ +/** + * describes properties of a security group. + */ @Fluent public final class DeviceSecurityGroupProperties { /* @@ -39,13 +41,15 @@ public final class DeviceSecurityGroupProperties { @JsonProperty(value = "denylistRules") private List denylistRules; - /** Creates an instance of DeviceSecurityGroupProperties class. */ + /** + * 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() { @@ -54,7 +58,7 @@ public List thresholdRules() { /** * Set the thresholdRules property: The list of custom alert threshold rules. - * + * * @param thresholdRules the thresholdRules value to set. * @return the DeviceSecurityGroupProperties object itself. */ @@ -65,7 +69,7 @@ public DeviceSecurityGroupProperties withThresholdRules(List timeWindowRules() { @@ -74,7 +78,7 @@ public List 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. */ @@ -85,7 +89,7 @@ public DeviceSecurityGroupProperties withTimeWindowRules(List allowlistRules() { @@ -94,7 +98,7 @@ public List allowlistRules() { /** * Set the allowlistRules property: The allow-list custom alert rules. - * + * * @param allowlistRules the allowlistRules value to set. * @return the DeviceSecurityGroupProperties object itself. */ @@ -105,7 +109,7 @@ public DeviceSecurityGroupProperties withAllowlistRules(List denylistRules() { @@ -114,7 +118,7 @@ public List denylistRules() { /** * Set the denylistRules property: The deny-list custom alert rules. - * + * * @param denylistRules the denylistRules value to set. * @return the DeviceSecurityGroupProperties object itself. */ @@ -125,7 +129,7 @@ public DeviceSecurityGroupProperties withDenylistRules(List value; + + /** + * Creates an instance of GetSensitivitySettingsListResponseInner class. + */ + public GetSensitivitySettingsListResponseInner() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the GetSensitivitySettingsListResponseInner object itself. + */ + public GetSensitivitySettingsListResponseInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} 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 new file mode 100644 index 0000000000000..9163e92035027 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsResponseInner.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.security.models.GetSensitivitySettingsResponseProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data sensitivity settings for sensitive data discovery. + */ +@Fluent +public final class GetSensitivitySettingsResponseInner extends ProxyResource { + /* + * The sensitivity settings properties + */ + @JsonProperty(value = "properties") + private GetSensitivitySettingsResponseProperties properties; + + /** + * Creates an instance of GetSensitivitySettingsResponseInner class. + */ + public GetSensitivitySettingsResponseInner() { + } + + /** + * Get the properties property: The sensitivity settings properties. + * + * @return the properties value. + */ + public GetSensitivitySettingsResponseProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The sensitivity settings properties. + * + * @param properties the properties value to set. + * @return the GetSensitivitySettingsResponseInner object itself. + */ + public GetSensitivitySettingsResponseInner withProperties(GetSensitivitySettingsResponseProperties 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(); + } + } +} 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 new file mode 100644 index 0000000000000..cdc48c7f89f21 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubOwnerInner.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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.resourcemanager.security.models.GitHubOwnerProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * GitHub Owner resource. + */ +@Fluent +public final class GitHubOwnerInner extends ProxyResource { + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * GitHub Owner properties. + */ + @JsonProperty(value = "properties") + private GitHubOwnerProperties properties; + + /** + * Creates an instance of GitHubOwnerInner class. + */ + public GitHubOwnerInner() { + } + + /** + * 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 properties property: GitHub Owner properties. + * + * @return the properties value. + */ + public GitHubOwnerProperties properties() { + return this.properties; + } + + /** + * Set the properties property: GitHub Owner properties. + * + * @param properties the properties value to set. + * @return the GitHubOwnerInner object itself. + */ + public GitHubOwnerInner withProperties(GitHubOwnerProperties 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(); + } + } +} 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 new file mode 100644 index 0000000000000..37ea6f2cba59d --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubOwnerListResponseInner.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * List of RP resources which supports pagination. + */ +@Fluent +public final class GitHubOwnerListResponseInner { + /* + * Gets or sets list of resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets next link to scroll over the results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Creates an instance of GitHubOwnerListResponseInner class. + */ + public GitHubOwnerListResponseInner() { + } + + /** + * Get the value property: Gets or sets list of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets list of resources. + * + * @param value the value value to set. + * @return the GitHubOwnerListResponseInner object itself. + */ + public GitHubOwnerListResponseInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets next link to scroll over the results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets next link to scroll over the results. + * + * @param nextLink the nextLink value to set. + * @return the GitHubOwnerListResponseInner object itself. + */ + public GitHubOwnerListResponseInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} 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 new file mode 100644 index 0000000000000..fdf3cf2876ca4 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubRepositoryInner.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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.resourcemanager.security.models.GitHubRepositoryProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * GitHub Repository resource. + */ +@Fluent +public final class GitHubRepositoryInner extends ProxyResource { + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * GitHub Repository properties. + */ + @JsonProperty(value = "properties") + private GitHubRepositoryProperties properties; + + /** + * Creates an instance of GitHubRepositoryInner class. + */ + public GitHubRepositoryInner() { + } + + /** + * 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 properties property: GitHub Repository properties. + * + * @return the properties value. + */ + public GitHubRepositoryProperties properties() { + return this.properties; + } + + /** + * Set the properties property: GitHub Repository properties. + * + * @param properties the properties value to set. + * @return the GitHubRepositoryInner object itself. + */ + public GitHubRepositoryInner withProperties(GitHubRepositoryProperties 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(); + } + } +} 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 new file mode 100644 index 0000000000000..40c4ee5cb99d1 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabGroupInner.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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.resourcemanager.security.models.GitLabGroupProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * GitLab Group resource. + */ +@Fluent +public final class GitLabGroupInner extends ProxyResource { + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * GitLab Group properties. + */ + @JsonProperty(value = "properties") + private GitLabGroupProperties properties; + + /** + * Creates an instance of GitLabGroupInner class. + */ + public GitLabGroupInner() { + } + + /** + * 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 properties property: GitLab Group properties. + * + * @return the properties value. + */ + public GitLabGroupProperties properties() { + return this.properties; + } + + /** + * Set the properties property: GitLab Group properties. + * + * @param properties the properties value to set. + * @return the GitLabGroupInner object itself. + */ + public GitLabGroupInner withProperties(GitLabGroupProperties 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(); + } + } +} 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 new file mode 100644 index 0000000000000..12ece067735e2 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabGroupListResponseInner.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * List of RP resources which supports pagination. + */ +@Fluent +public final class GitLabGroupListResponseInner { + /* + * Gets or sets list of resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets next link to scroll over the results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Creates an instance of GitLabGroupListResponseInner class. + */ + public GitLabGroupListResponseInner() { + } + + /** + * Get the value property: Gets or sets list of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets list of resources. + * + * @param value the value value to set. + * @return the GitLabGroupListResponseInner object itself. + */ + public GitLabGroupListResponseInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets next link to scroll over the results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets next link to scroll over the results. + * + * @param nextLink the nextLink value to set. + * @return the GitLabGroupListResponseInner object itself. + */ + public GitLabGroupListResponseInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} 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 new file mode 100644 index 0000000000000..646ee832cd081 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabProjectInner.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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.resourcemanager.security.models.GitLabProjectProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * GitLab Project resource. + */ +@Fluent +public final class GitLabProjectInner extends ProxyResource { + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * GitLab Project properties. + */ + @JsonProperty(value = "properties") + private GitLabProjectProperties properties; + + /** + * Creates an instance of GitLabProjectInner class. + */ + public GitLabProjectInner() { + } + + /** + * 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 properties property: GitLab Project properties. + * + * @return the properties value. + */ + public GitLabProjectProperties properties() { + return this.properties; + } + + /** + * Set the properties property: GitLab Project properties. + * + * @param properties the properties value to set. + * @return the GitLabProjectInner object itself. + */ + public GitLabProjectInner withProperties(GitLabProjectProperties 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(); + } + } +} 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 index f880104179cce..b7ca7624af9a3 100644 --- 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 @@ -12,7 +12,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; -/** Governance assignment over a given scope. */ +/** + * Governance assignment over a given scope. + */ @Fluent public final class GovernanceAssignmentInner extends ProxyResource { /* @@ -21,13 +23,15 @@ public final class GovernanceAssignmentInner extends ProxyResource { @JsonProperty(value = "properties") private GovernanceAssignmentProperties innerProperties; - /** Creates an instance of GovernanceAssignmentInner class. */ + /** + * 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() { @@ -36,7 +40,7 @@ private GovernanceAssignmentProperties innerProperties() { /** * Get the owner property: The Owner for the governance assignment - e.g. user@contoso.com - see example. - * + * * @return the owner value. */ public String owner() { @@ -45,7 +49,7 @@ public String 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. */ @@ -58,9 +62,9 @@ public GovernanceAssignmentInner withOwner(String owner) { } /** - * Get the remediationDueDate property: The remediation due-date - after this date Secure Score will be affected (in - * case of active grace-period). - * + * 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() { @@ -68,9 +72,9 @@ public OffsetDateTime remediationDueDate() { } /** - * Set the remediationDueDate property: The remediation due-date - after this date Secure Score will be affected (in - * case of active grace-period). - * + * 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. */ @@ -84,7 +88,7 @@ public GovernanceAssignmentInner withRemediationDueDate(OffsetDateTime remediati /** * Get the remediationEta property: The ETA (estimated time of arrival) for remediation (optional), see example. - * + * * @return the remediationEta value. */ public RemediationEta remediationEta() { @@ -93,7 +97,7 @@ public RemediationEta 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. */ @@ -107,7 +111,7 @@ public GovernanceAssignmentInner withRemediationEta(RemediationEta remediationEt /** * Get the isGracePeriod property: Defines whether there is a grace period on the governance assignment. - * + * * @return the isGracePeriod value. */ public Boolean isGracePeriod() { @@ -116,7 +120,7 @@ public Boolean 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. */ @@ -131,7 +135,7 @@ public GovernanceAssignmentInner withIsGracePeriod(Boolean isGracePeriod) { /** * 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() { @@ -141,12 +145,12 @@ public GovernanceEmailNotification 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) { + public GovernanceAssignmentInner + withGovernanceEmailNotification(GovernanceEmailNotification governanceEmailNotification) { if (this.innerProperties() == null) { this.innerProperties = new GovernanceAssignmentProperties(); } @@ -157,7 +161,7 @@ public GovernanceAssignmentInner withGovernanceEmailNotification( /** * 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() { @@ -167,7 +171,7 @@ public GovernanceAssignmentAdditionalData 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. */ @@ -181,7 +185,7 @@ public GovernanceAssignmentInner withAdditionalData(GovernanceAssignmentAddition /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 4fe799c627982..48d00b1ec88bb 100644 --- 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 @@ -12,7 +12,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; -/** Describes properties of an governance assignment. */ +/** + * Describes properties of an governance assignment. + */ @Fluent public final class GovernanceAssignmentProperties { /* @@ -22,7 +24,7 @@ public final class GovernanceAssignmentProperties { private String owner; /* - * The remediation due-date - after this date Secure Score will be affected (in case of active grace-period) + * The remediation due-date - after this date Secure Score will be affected (in case of active grace-period) */ @JsonProperty(value = "remediationDueDate", required = true) private OffsetDateTime remediationDueDate; @@ -52,13 +54,15 @@ public final class GovernanceAssignmentProperties { @JsonProperty(value = "additionalData") private GovernanceAssignmentAdditionalData additionalData; - /** Creates an instance of GovernanceAssignmentProperties class. */ + /** + * 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() { @@ -67,7 +71,7 @@ public String 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. */ @@ -77,9 +81,9 @@ public GovernanceAssignmentProperties withOwner(String owner) { } /** - * Get the remediationDueDate property: The remediation due-date - after this date Secure Score will be affected (in - * case of active grace-period). - * + * 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() { @@ -87,9 +91,9 @@ public OffsetDateTime remediationDueDate() { } /** - * Set the remediationDueDate property: The remediation due-date - after this date Secure Score will be affected (in - * case of active grace-period). - * + * 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. */ @@ -100,7 +104,7 @@ public GovernanceAssignmentProperties withRemediationDueDate(OffsetDateTime reme /** * Get the remediationEta property: The ETA (estimated time of arrival) for remediation (optional), see example. - * + * * @return the remediationEta value. */ public RemediationEta remediationEta() { @@ -109,7 +113,7 @@ public RemediationEta 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. */ @@ -120,7 +124,7 @@ public GovernanceAssignmentProperties withRemediationEta(RemediationEta remediat /** * Get the isGracePeriod property: Defines whether there is a grace period on the governance assignment. - * + * * @return the isGracePeriod value. */ public Boolean isGracePeriod() { @@ -129,7 +133,7 @@ public Boolean 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. */ @@ -141,7 +145,7 @@ public GovernanceAssignmentProperties withIsGracePeriod(Boolean isGracePeriod) { /** * 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() { @@ -151,12 +155,12 @@ public GovernanceEmailNotification 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) { + public GovernanceAssignmentProperties + withGovernanceEmailNotification(GovernanceEmailNotification governanceEmailNotification) { this.governanceEmailNotification = governanceEmailNotification; return this; } @@ -164,7 +168,7 @@ public GovernanceAssignmentProperties withGovernanceEmailNotification( /** * 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() { @@ -174,7 +178,7 @@ public GovernanceAssignmentAdditionalData 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. */ @@ -185,15 +189,13 @@ public GovernanceAssignmentProperties withAdditionalData(GovernanceAssignmentAdd /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (remediationDueDate() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property remediationDueDate in model GovernanceAssignmentProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property remediationDueDate in model GovernanceAssignmentProperties")); } if (remediationEta() != null) { remediationEta().validate(); 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 index 62781d9a3ac87..f8f9c07ca09d4 100644 --- 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 @@ -14,7 +14,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Governance rule over a given scope. */ +/** + * Governance rule over a given scope. + */ @Fluent public final class GovernanceRuleInner extends ProxyResource { /* @@ -23,13 +25,15 @@ public final class GovernanceRuleInner extends ProxyResource { @JsonProperty(value = "properties") private GovernanceRuleProperties innerProperties; - /** Creates an instance of GovernanceRuleInner class. */ + /** + * Creates an instance of GovernanceRuleInner class. + */ public GovernanceRuleInner() { } /** * Get the innerProperties property: Properties of a governance rule. - * + * * @return the innerProperties value. */ private GovernanceRuleProperties innerProperties() { @@ -38,7 +42,7 @@ private GovernanceRuleProperties innerProperties() { /** * Get the tenantId property: The tenantId (GUID). - * + * * @return the tenantId value. */ public String tenantId() { @@ -47,7 +51,7 @@ public String tenantId() { /** * Get the displayName property: Display name of the governance rule. - * + * * @return the displayName value. */ public String displayName() { @@ -56,7 +60,7 @@ public String displayName() { /** * Set the displayName property: Display name of the governance rule. - * + * * @param displayName the displayName value to set. * @return the GovernanceRuleInner object itself. */ @@ -70,7 +74,7 @@ public GovernanceRuleInner withDisplayName(String displayName) { /** * Get the description property: Description of the governance rule. - * + * * @return the description value. */ public String description() { @@ -79,7 +83,7 @@ public String description() { /** * Set the description property: Description of the governance rule. - * + * * @param description the description value to set. * @return the GovernanceRuleInner object itself. */ @@ -94,7 +98,7 @@ public GovernanceRuleInner withDescription(String description) { /** * 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() { @@ -104,7 +108,7 @@ public String 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. */ @@ -118,7 +122,7 @@ public GovernanceRuleInner withRemediationTimeframe(String remediationTimeframe) /** * Get the isGracePeriod property: Defines whether there is a grace period on the governance rule. - * + * * @return the isGracePeriod value. */ public Boolean isGracePeriod() { @@ -127,7 +131,7 @@ public Boolean 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. */ @@ -142,7 +146,7 @@ public GovernanceRuleInner withIsGracePeriod(Boolean isGracePeriod) { /** * 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() { @@ -152,7 +156,7 @@ public Integer 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. */ @@ -166,7 +170,7 @@ public GovernanceRuleInner withRulePriority(Integer rulePriority) { /** * Get the isDisabled property: Defines whether the rule is active/inactive. - * + * * @return the isDisabled value. */ public Boolean isDisabled() { @@ -175,7 +179,7 @@ public Boolean isDisabled() { /** * Set the isDisabled property: Defines whether the rule is active/inactive. - * + * * @param isDisabled the isDisabled value to set. * @return the GovernanceRuleInner object itself. */ @@ -189,7 +193,7 @@ public GovernanceRuleInner withIsDisabled(Boolean isDisabled) { /** * 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() { @@ -198,7 +202,7 @@ public GovernanceRuleType 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. */ @@ -212,7 +216,7 @@ public GovernanceRuleInner withRuleType(GovernanceRuleType ruleType) { /** * Get the sourceResourceType property: The governance rule source, what the rule affects, e.g. Assessments. - * + * * @return the sourceResourceType value. */ public GovernanceRuleSourceResourceType sourceResourceType() { @@ -221,7 +225,7 @@ public GovernanceRuleSourceResourceType 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. */ @@ -234,8 +238,9 @@ public GovernanceRuleInner withSourceResourceType(GovernanceRuleSourceResourceTy } /** - * Get the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on management scopes). - * + * Get the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on management + * scopes). + * * @return the excludedScopes value. */ public List excludedScopes() { @@ -243,8 +248,9 @@ public List excludedScopes() { } /** - * Set the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on management scopes). - * + * 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. */ @@ -258,7 +264,7 @@ public GovernanceRuleInner withExcludedScopes(List excludedScopes) { /** * Get the conditionSets property: The governance rule conditionSets - see examples. - * + * * @return the conditionSets value. */ public List conditionSets() { @@ -267,7 +273,7 @@ public List conditionSets() { /** * Set the conditionSets property: The governance rule conditionSets - see examples. - * + * * @param conditionSets the conditionSets value to set. * @return the GovernanceRuleInner object itself. */ @@ -282,7 +288,7 @@ public GovernanceRuleInner withConditionSets(List conditionSets) { /** * 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() { @@ -292,7 +298,7 @@ public Boolean 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. */ @@ -307,7 +313,7 @@ public GovernanceRuleInner withIncludeMemberScopes(Boolean includeMemberScopes) /** * 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() { @@ -317,7 +323,7 @@ public GovernanceRuleOwnerSource 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. */ @@ -332,7 +338,7 @@ public GovernanceRuleInner withOwnerSource(GovernanceRuleOwnerSource ownerSource /** * 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() { @@ -342,12 +348,12 @@ public GovernanceRuleEmailNotification 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) { + public GovernanceRuleInner + withGovernanceEmailNotification(GovernanceRuleEmailNotification governanceEmailNotification) { if (this.innerProperties() == null) { this.innerProperties = new GovernanceRuleProperties(); } @@ -357,7 +363,7 @@ public GovernanceRuleInner withGovernanceEmailNotification( /** * Get the metadata property: The governance rule metadata. - * + * * @return the metadata value. */ public GovernanceRuleMetadata metadata() { @@ -366,7 +372,7 @@ public GovernanceRuleMetadata metadata() { /** * Set the metadata property: The governance rule metadata. - * + * * @param metadata the metadata value to set. * @return the GovernanceRuleInner object itself. */ @@ -380,7 +386,7 @@ public GovernanceRuleInner withMetadata(GovernanceRuleMetadata metadata) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index d54629e94239b..8840e80b5b41e 100644 --- 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 @@ -14,7 +14,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Describes properties of an governance rule. */ +/** + * Describes properties of an governance rule. + */ @Fluent public final class GovernanceRuleProperties { /* @@ -110,13 +112,15 @@ public final class GovernanceRuleProperties { @JsonProperty(value = "metadata") private GovernanceRuleMetadata metadata; - /** Creates an instance of GovernanceRuleProperties class. */ + /** + * Creates an instance of GovernanceRuleProperties class. + */ public GovernanceRuleProperties() { } /** * Get the tenantId property: The tenantId (GUID). - * + * * @return the tenantId value. */ public String tenantId() { @@ -125,7 +129,7 @@ public String tenantId() { /** * Get the displayName property: Display name of the governance rule. - * + * * @return the displayName value. */ public String displayName() { @@ -134,7 +138,7 @@ public String displayName() { /** * Set the displayName property: Display name of the governance rule. - * + * * @param displayName the displayName value to set. * @return the GovernanceRuleProperties object itself. */ @@ -145,7 +149,7 @@ public GovernanceRuleProperties withDisplayName(String displayName) { /** * Get the description property: Description of the governance rule. - * + * * @return the description value. */ public String description() { @@ -154,7 +158,7 @@ public String description() { /** * Set the description property: Description of the governance rule. - * + * * @param description the description value to set. * @return the GovernanceRuleProperties object itself. */ @@ -166,7 +170,7 @@ public GovernanceRuleProperties withDescription(String description) { /** * 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() { @@ -176,7 +180,7 @@ public String 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. */ @@ -187,7 +191,7 @@ public GovernanceRuleProperties withRemediationTimeframe(String remediationTimef /** * Get the isGracePeriod property: Defines whether there is a grace period on the governance rule. - * + * * @return the isGracePeriod value. */ public Boolean isGracePeriod() { @@ -196,7 +200,7 @@ public Boolean 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. */ @@ -208,7 +212,7 @@ public GovernanceRuleProperties withIsGracePeriod(Boolean isGracePeriod) { /** * 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() { @@ -218,7 +222,7 @@ public int 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. */ @@ -229,7 +233,7 @@ public GovernanceRuleProperties withRulePriority(int rulePriority) { /** * Get the isDisabled property: Defines whether the rule is active/inactive. - * + * * @return the isDisabled value. */ public Boolean isDisabled() { @@ -238,7 +242,7 @@ public Boolean isDisabled() { /** * Set the isDisabled property: Defines whether the rule is active/inactive. - * + * * @param isDisabled the isDisabled value to set. * @return the GovernanceRuleProperties object itself. */ @@ -249,7 +253,7 @@ public GovernanceRuleProperties withIsDisabled(Boolean isDisabled) { /** * 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() { @@ -258,7 +262,7 @@ public GovernanceRuleType 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. */ @@ -269,7 +273,7 @@ public GovernanceRuleProperties withRuleType(GovernanceRuleType ruleType) { /** * Get the sourceResourceType property: The governance rule source, what the rule affects, e.g. Assessments. - * + * * @return the sourceResourceType value. */ public GovernanceRuleSourceResourceType sourceResourceType() { @@ -278,7 +282,7 @@ public GovernanceRuleSourceResourceType 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. */ @@ -288,8 +292,9 @@ public GovernanceRuleProperties withSourceResourceType(GovernanceRuleSourceResou } /** - * Get the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on management scopes). - * + * Get the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on management + * scopes). + * * @return the excludedScopes value. */ public List excludedScopes() { @@ -297,8 +302,9 @@ public List excludedScopes() { } /** - * Set the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on management scopes). - * + * 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. */ @@ -309,7 +315,7 @@ public GovernanceRuleProperties withExcludedScopes(List excludedScopes) /** * Get the conditionSets property: The governance rule conditionSets - see examples. - * + * * @return the conditionSets value. */ public List conditionSets() { @@ -318,7 +324,7 @@ public List conditionSets() { /** * Set the conditionSets property: The governance rule conditionSets - see examples. - * + * * @param conditionSets the conditionSets value to set. * @return the GovernanceRuleProperties object itself. */ @@ -330,7 +336,7 @@ public GovernanceRuleProperties withConditionSets(List conditionSets) { /** * 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() { @@ -340,7 +346,7 @@ public Boolean 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. */ @@ -352,7 +358,7 @@ public GovernanceRuleProperties withIncludeMemberScopes(Boolean includeMemberSco /** * 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() { @@ -362,7 +368,7 @@ public GovernanceRuleOwnerSource 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. */ @@ -374,7 +380,7 @@ public GovernanceRuleProperties withOwnerSource(GovernanceRuleOwnerSource ownerS /** * 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() { @@ -384,19 +390,19 @@ public GovernanceRuleEmailNotification 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) { + 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() { @@ -405,7 +411,7 @@ public GovernanceRuleMetadata metadata() { /** * Set the metadata property: The governance rule metadata. - * + * * @param metadata the metadata value to set. * @return the GovernanceRuleProperties object itself. */ @@ -416,39 +422,29 @@ public GovernanceRuleProperties withMetadata(GovernanceRuleMetadata metadata) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (displayName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property displayName in model GovernanceRuleProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property displayName in model GovernanceRuleProperties")); } if (ruleType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property ruleType in model GovernanceRuleProperties")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property ruleType in model GovernanceRuleProperties")); } if (sourceResourceType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sourceResourceType in model GovernanceRuleProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property sourceResourceType in model GovernanceRuleProperties")); } if (conditionSets() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property conditionSets in model GovernanceRuleProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property conditionSets in model GovernanceRuleProperties")); } if (ownerSource() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property ownerSource in model GovernanceRuleProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property ownerSource in model GovernanceRuleProperties")); } else { ownerSource().validate(); } 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 index 31f24ba0c299b..75b77db58ad4f 100644 --- 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 @@ -13,8 +13,11 @@ import com.azure.resourcemanager.security.models.StatusAutoGenerated; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; +import java.util.Map; -/** The health report resource. */ +/** + * The health report resource. + */ @Fluent public final class HealthReportInner extends ProxyResource { /* @@ -23,13 +26,15 @@ public final class HealthReportInner extends ProxyResource { @JsonProperty(value = "properties") private HealthReportProperties innerProperties; - /** Creates an instance of HealthReportInner class. */ + /** + * Creates an instance of HealthReportInner class. + */ public HealthReportInner() { } /** * Get the innerProperties property: Properties of a health report. - * + * * @return the innerProperties value. */ private HealthReportProperties innerProperties() { @@ -38,7 +43,7 @@ private HealthReportProperties innerProperties() { /** * Get the resourceDetails property: The resource details of the health report. - * + * * @return the resourceDetails value. */ public ResourceDetailsAutoGenerated resourceDetails() { @@ -47,7 +52,7 @@ public ResourceDetailsAutoGenerated resourceDetails() { /** * Set the resourceDetails property: The resource details of the health report. - * + * * @param resourceDetails the resourceDetails value to set. * @return the HealthReportInner object itself. */ @@ -61,7 +66,7 @@ public HealthReportInner withResourceDetails(ResourceDetailsAutoGenerated resour /** * Get the environmentDetails property: The environment details of the resource. - * + * * @return the environmentDetails value. */ public EnvironmentDetails environmentDetails() { @@ -70,7 +75,7 @@ public EnvironmentDetails environmentDetails() { /** * Set the environmentDetails property: The environment details of the resource. - * + * * @param environmentDetails the environmentDetails value to set. * @return the HealthReportInner object itself. */ @@ -84,7 +89,7 @@ public HealthReportInner withEnvironmentDetails(EnvironmentDetails environmentDe /** * Get the healthDataClassification property: The classification of the health report. - * + * * @return the healthDataClassification value. */ public HealthDataClassification healthDataClassification() { @@ -93,7 +98,7 @@ public HealthDataClassification healthDataClassification() { /** * Set the healthDataClassification property: The classification of the health report. - * + * * @param healthDataClassification the healthDataClassification value to set. * @return the HealthReportInner object itself. */ @@ -107,7 +112,7 @@ public HealthReportInner withHealthDataClassification(HealthDataClassification h /** * Get the status property: The status of the health report. - * + * * @return the status value. */ public StatusAutoGenerated status() { @@ -116,7 +121,7 @@ public StatusAutoGenerated status() { /** * Set the status property: The status of the health report. - * + * * @param status the status value to set. * @return the HealthReportInner object itself. */ @@ -130,7 +135,7 @@ public HealthReportInner withStatus(StatusAutoGenerated status) { /** * Get the affectedDefendersPlans property: The affected defenders plans by unhealthy report. - * + * * @return the affectedDefendersPlans value. */ public List affectedDefendersPlans() { @@ -139,7 +144,7 @@ public List affectedDefendersPlans() { /** * Set the affectedDefendersPlans property: The affected defenders plans by unhealthy report. - * + * * @param affectedDefendersPlans the affectedDefendersPlans value to set. * @return the HealthReportInner object itself. */ @@ -151,9 +156,42 @@ public HealthReportInner withAffectedDefendersPlans(List affectedDefende return this; } + /** + * 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(); + } + + /** + * Set the affectedDefendersSubPlans property: The affected defenders sub plans by unhealthy report. + * + * @param affectedDefendersSubPlans the affectedDefendersSubPlans value to set. + * @return the HealthReportInner object itself. + */ + public HealthReportInner withAffectedDefendersSubPlans(List affectedDefendersSubPlans) { + if (this.innerProperties() == null) { + this.innerProperties = new HealthReportProperties(); + } + this.innerProperties().withAffectedDefendersSubPlans(affectedDefendersSubPlans); + return this; + } + + /** + * 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() { @@ -162,7 +200,7 @@ public List issues() { /** * Set the issues property: A collection of the issues in the report. - * + * * @param issues the issues value to set. * @return the HealthReportInner object itself. */ @@ -176,7 +214,7 @@ public HealthReportInner withIssues(List issues) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 98ee1832e128c..e503e82693b24 100644 --- 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 @@ -10,10 +10,14 @@ import com.azure.resourcemanager.security.models.Issue; import com.azure.resourcemanager.security.models.ResourceDetailsAutoGenerated; import com.azure.resourcemanager.security.models.StatusAutoGenerated; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; +import java.util.Map; -/** Describes properties of the health report. */ +/** + * Describes properties of the health report. + */ @Fluent public final class HealthReportProperties { /* @@ -46,19 +50,35 @@ public final class HealthReportProperties { @JsonProperty(value = "affectedDefendersPlans") private List affectedDefendersPlans; + /* + * The affected defenders sub plans by unhealthy report + */ + @JsonProperty(value = "affectedDefendersSubPlans") + private List affectedDefendersSubPlans; + + /* + * Additional data for the given health report, this field can include more details on the resource and the health + * scenario. + */ + @JsonProperty(value = "reportAdditionalData", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map reportAdditionalData; + /* * A collection of the issues in the report */ @JsonProperty(value = "issues") private List issues; - /** Creates an instance of HealthReportProperties class. */ + /** + * Creates an instance of HealthReportProperties class. + */ public HealthReportProperties() { } /** * Get the resourceDetails property: The resource details of the health report. - * + * * @return the resourceDetails value. */ public ResourceDetailsAutoGenerated resourceDetails() { @@ -67,7 +87,7 @@ public ResourceDetailsAutoGenerated resourceDetails() { /** * Set the resourceDetails property: The resource details of the health report. - * + * * @param resourceDetails the resourceDetails value to set. * @return the HealthReportProperties object itself. */ @@ -78,7 +98,7 @@ public HealthReportProperties withResourceDetails(ResourceDetailsAutoGenerated r /** * Get the environmentDetails property: The environment details of the resource. - * + * * @return the environmentDetails value. */ public EnvironmentDetails environmentDetails() { @@ -87,7 +107,7 @@ public EnvironmentDetails environmentDetails() { /** * Set the environmentDetails property: The environment details of the resource. - * + * * @param environmentDetails the environmentDetails value to set. * @return the HealthReportProperties object itself. */ @@ -98,7 +118,7 @@ public HealthReportProperties withEnvironmentDetails(EnvironmentDetails environm /** * Get the healthDataClassification property: The classification of the health report. - * + * * @return the healthDataClassification value. */ public HealthDataClassification healthDataClassification() { @@ -107,7 +127,7 @@ public HealthDataClassification healthDataClassification() { /** * Set the healthDataClassification property: The classification of the health report. - * + * * @param healthDataClassification the healthDataClassification value to set. * @return the HealthReportProperties object itself. */ @@ -118,7 +138,7 @@ public HealthReportProperties withHealthDataClassification(HealthDataClassificat /** * Get the status property: The status of the health report. - * + * * @return the status value. */ public StatusAutoGenerated status() { @@ -127,7 +147,7 @@ public StatusAutoGenerated status() { /** * Set the status property: The status of the health report. - * + * * @param status the status value to set. * @return the HealthReportProperties object itself. */ @@ -138,7 +158,7 @@ public HealthReportProperties withStatus(StatusAutoGenerated status) { /** * Get the affectedDefendersPlans property: The affected defenders plans by unhealthy report. - * + * * @return the affectedDefendersPlans value. */ public List affectedDefendersPlans() { @@ -147,7 +167,7 @@ public List affectedDefendersPlans() { /** * Set the affectedDefendersPlans property: The affected defenders plans by unhealthy report. - * + * * @param affectedDefendersPlans the affectedDefendersPlans value to set. * @return the HealthReportProperties object itself. */ @@ -156,9 +176,39 @@ public HealthReportProperties withAffectedDefendersPlans(List affectedDe return this; } + /** + * Get the affectedDefendersSubPlans property: The affected defenders sub plans by unhealthy report. + * + * @return the affectedDefendersSubPlans value. + */ + public List affectedDefendersSubPlans() { + return this.affectedDefendersSubPlans; + } + + /** + * Set the affectedDefendersSubPlans property: The affected defenders sub plans by unhealthy report. + * + * @param affectedDefendersSubPlans the affectedDefendersSubPlans value to set. + * @return the HealthReportProperties object itself. + */ + public HealthReportProperties withAffectedDefendersSubPlans(List affectedDefendersSubPlans) { + this.affectedDefendersSubPlans = affectedDefendersSubPlans; + return this; + } + + /** + * 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() { @@ -167,7 +217,7 @@ public List issues() { /** * Set the issues property: A collection of the issues in the report. - * + * * @param issues the issues value to set. * @return the HealthReportProperties object itself. */ @@ -178,7 +228,7 @@ public HealthReportProperties withIssues(List issues) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index f146e90386f24..675a449f3fd5d 100644 --- 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 @@ -12,7 +12,9 @@ import java.time.OffsetDateTime; import java.util.Map; -/** Information protection policy. */ +/** + * Information protection policy. + */ @Fluent public final class InformationProtectionPolicyInner extends ProxyResource { /* @@ -21,13 +23,15 @@ public final class InformationProtectionPolicyInner extends ProxyResource { @JsonProperty(value = "properties") private InformationProtectionPolicyProperties innerProperties; - /** Creates an instance of InformationProtectionPolicyInner class. */ + /** + * Creates an instance of InformationProtectionPolicyInner class. + */ public InformationProtectionPolicyInner() { } /** * Get the innerProperties property: Information protection policy data. - * + * * @return the innerProperties value. */ private InformationProtectionPolicyProperties innerProperties() { @@ -36,7 +40,7 @@ private InformationProtectionPolicyProperties innerProperties() { /** * Get the lastModifiedUtc property: Describes the last UTC time the policy was modified. - * + * * @return the lastModifiedUtc value. */ public OffsetDateTime lastModifiedUtc() { @@ -45,7 +49,7 @@ public OffsetDateTime lastModifiedUtc() { /** * Get the version property: Describes the version of the policy. - * + * * @return the version value. */ public String version() { @@ -54,7 +58,7 @@ public String version() { /** * Get the labels property: Dictionary of sensitivity labels. - * + * * @return the labels value. */ public Map labels() { @@ -63,7 +67,7 @@ public Map labels() { /** * Set the labels property: Dictionary of sensitivity labels. - * + * * @param labels the labels value to set. * @return the InformationProtectionPolicyInner object itself. */ @@ -77,7 +81,7 @@ public InformationProtectionPolicyInner withLabels(Map /** * Get the informationTypes property: The sensitivity information types. - * + * * @return the informationTypes value. */ public Map informationTypes() { @@ -86,7 +90,7 @@ public Map informationTypes() { /** * Set the informationTypes property: The sensitivity information types. - * + * * @param informationTypes the informationTypes value to set. * @return the InformationProtectionPolicyInner object itself. */ @@ -100,7 +104,7 @@ public InformationProtectionPolicyInner withInformationTypes(Map informationTypes; - /** Creates an instance of InformationProtectionPolicyProperties class. */ + /** + * 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() { @@ -56,7 +60,7 @@ public OffsetDateTime lastModifiedUtc() { /** * Get the version property: Describes the version of the policy. - * + * * @return the version value. */ public String version() { @@ -65,7 +69,7 @@ public String version() { /** * Get the labels property: Dictionary of sensitivity labels. - * + * * @return the labels value. */ public Map labels() { @@ -74,7 +78,7 @@ public Map labels() { /** * Set the labels property: Dictionary of sensitivity labels. - * + * * @param labels the labels value to set. * @return the InformationProtectionPolicyProperties object itself. */ @@ -85,7 +89,7 @@ public InformationProtectionPolicyProperties withLabels(Map informationTypes() { @@ -94,7 +98,7 @@ public Map informationTypes() { /** * Set the informationTypes property: The sensitivity information types. - * + * * @param informationTypes the informationTypes value to set. * @return the InformationProtectionPolicyProperties object itself. */ @@ -105,29 +109,23 @@ public InformationProtectionPolicyProperties withInformationTypes(Map { - if (e != null) { - e.validate(); - } - }); + labels().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); } if (informationTypes() != null) { - informationTypes() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); + informationTypes().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IngestionSettingInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IngestionSettingInner.java deleted file mode 100644 index 6bf368c4d2018..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IngestionSettingInner.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Configures how to correlate scan data and logs with resources associated with the subscription. */ -@Fluent -public final class IngestionSettingInner extends ProxyResource { - /* - * Ingestion setting data - */ - @JsonProperty(value = "properties") - private Object properties; - - /** Creates an instance of IngestionSettingInner class. */ - public IngestionSettingInner() { - } - - /** - * Get the properties property: Ingestion setting data. - * - * @return the properties value. - */ - public Object properties() { - return this.properties; - } - - /** - * Set the properties property: Ingestion setting data. - * - * @param properties the properties value to set. - * @return the IngestionSettingInner object itself. - */ - public IngestionSettingInner withProperties(Object properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IngestionSettingTokenInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IngestionSettingTokenInner.java deleted file mode 100644 index dd95c8c94ce6d..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IngestionSettingTokenInner.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Configures how to correlate scan data and logs with resources associated with the subscription. */ -@Immutable -public final class IngestionSettingTokenInner { - /* - * The token is used for correlating security data and logs with the resources in the subscription. - */ - @JsonProperty(value = "token", access = JsonProperty.Access.WRITE_ONLY) - private String token; - - /** Creates an instance of IngestionSettingTokenInner class. */ - public IngestionSettingTokenInner() { - } - - /** - * Get the token property: The token is used for correlating security data and logs with the resources in the - * subscription. - * - * @return the token value. - */ - public String token() { - return this.token; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} 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 index d6ac39d9089d5..6e0d7744ab16d 100644 --- 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 @@ -14,7 +14,9 @@ import java.util.List; import java.util.Map; -/** Security Solution Aggregated Alert information. */ +/** + * Security Solution Aggregated Alert information. + */ @Fluent public final class IoTSecurityAggregatedAlertInner extends ProxyResource { /* @@ -30,13 +32,15 @@ public final class IoTSecurityAggregatedAlertInner extends ProxyResource { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of IoTSecurityAggregatedAlertInner class. */ + /** + * Creates an instance of IoTSecurityAggregatedAlertInner class. + */ public IoTSecurityAggregatedAlertInner() { } /** * Get the innerProperties property: IoT Security solution aggregated alert details. - * + * * @return the innerProperties value. */ private IoTSecurityAggregatedAlertProperties innerProperties() { @@ -45,7 +49,7 @@ private IoTSecurityAggregatedAlertProperties innerProperties() { /** * Get the tags property: Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -54,7 +58,7 @@ public Map tags() { /** * Set the tags property: Resource tags. - * + * * @param tags the tags value to set. * @return the IoTSecurityAggregatedAlertInner object itself. */ @@ -65,7 +69,7 @@ public IoTSecurityAggregatedAlertInner withTags(Map tags) { /** * Get the alertType property: Name of the alert type. - * + * * @return the alertType value. */ public String alertType() { @@ -74,7 +78,7 @@ public String alertType() { /** * Get the alertDisplayName property: Display name of the alert type. - * + * * @return the alertDisplayName value. */ public String alertDisplayName() { @@ -83,7 +87,7 @@ public String alertDisplayName() { /** * Get the aggregatedDateUtc property: Date of detection. - * + * * @return the aggregatedDateUtc value. */ public LocalDate aggregatedDateUtc() { @@ -92,7 +96,7 @@ public LocalDate aggregatedDateUtc() { /** * Get the vendorName property: Name of the organization that raised the alert. - * + * * @return the vendorName value. */ public String vendorName() { @@ -101,7 +105,7 @@ public String vendorName() { /** * Get the reportedSeverity property: Assessed alert severity. - * + * * @return the reportedSeverity value. */ public ReportedSeverity reportedSeverity() { @@ -110,7 +114,7 @@ public ReportedSeverity reportedSeverity() { /** * Get the remediationSteps property: Recommended steps for remediation. - * + * * @return the remediationSteps value. */ public String remediationSteps() { @@ -119,7 +123,7 @@ public String remediationSteps() { /** * Get the description property: Description of the suspected vulnerability and meaning. - * + * * @return the description value. */ public String description() { @@ -128,7 +132,7 @@ public String description() { /** * Get the count property: Number of alerts occurrences within the aggregated time window. - * + * * @return the count value. */ public Long count() { @@ -137,7 +141,7 @@ public Long count() { /** * Get the effectedResourceType property: Azure resource ID of the resource that received the alerts. - * + * * @return the effectedResourceType value. */ public String effectedResourceType() { @@ -146,7 +150,7 @@ public String effectedResourceType() { /** * Get the systemSource property: The type of the alerted resource (Azure, Non-Azure). - * + * * @return the systemSource value. */ public String systemSource() { @@ -155,7 +159,7 @@ public String systemSource() { /** * Get the actionTaken property: IoT Security solution alert response. - * + * * @return the actionTaken value. */ public String actionTaken() { @@ -164,7 +168,7 @@ public String actionTaken() { /** * Get the logAnalyticsQuery property: Log analytics query for getting the list of affected devices/alerts. - * + * * @return the logAnalyticsQuery value. */ public String logAnalyticsQuery() { @@ -174,7 +178,7 @@ public String 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() { @@ -183,7 +187,7 @@ public List topDevicesLi /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 7413ba8442dbd..98c98aaa7f3b5 100644 --- 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 @@ -11,7 +11,9 @@ import java.time.LocalDate; import java.util.List; -/** IoT Security solution aggregated alert details. */ +/** + * IoT Security solution aggregated alert details. + */ @Immutable public final class IoTSecurityAggregatedAlertProperties { /* @@ -92,13 +94,15 @@ public final class IoTSecurityAggregatedAlertProperties { @JsonProperty(value = "topDevicesList", access = JsonProperty.Access.WRITE_ONLY) private List topDevicesList; - /** Creates an instance of IoTSecurityAggregatedAlertProperties class. */ + /** + * Creates an instance of IoTSecurityAggregatedAlertProperties class. + */ public IoTSecurityAggregatedAlertProperties() { } /** * Get the alertType property: Name of the alert type. - * + * * @return the alertType value. */ public String alertType() { @@ -107,7 +111,7 @@ public String alertType() { /** * Get the alertDisplayName property: Display name of the alert type. - * + * * @return the alertDisplayName value. */ public String alertDisplayName() { @@ -116,7 +120,7 @@ public String alertDisplayName() { /** * Get the aggregatedDateUtc property: Date of detection. - * + * * @return the aggregatedDateUtc value. */ public LocalDate aggregatedDateUtc() { @@ -125,7 +129,7 @@ public LocalDate aggregatedDateUtc() { /** * Get the vendorName property: Name of the organization that raised the alert. - * + * * @return the vendorName value. */ public String vendorName() { @@ -134,7 +138,7 @@ public String vendorName() { /** * Get the reportedSeverity property: Assessed alert severity. - * + * * @return the reportedSeverity value. */ public ReportedSeverity reportedSeverity() { @@ -143,7 +147,7 @@ public ReportedSeverity reportedSeverity() { /** * Get the remediationSteps property: Recommended steps for remediation. - * + * * @return the remediationSteps value. */ public String remediationSteps() { @@ -152,7 +156,7 @@ public String remediationSteps() { /** * Get the description property: Description of the suspected vulnerability and meaning. - * + * * @return the description value. */ public String description() { @@ -161,7 +165,7 @@ public String description() { /** * Get the count property: Number of alerts occurrences within the aggregated time window. - * + * * @return the count value. */ public Long count() { @@ -170,7 +174,7 @@ public Long count() { /** * Get the effectedResourceType property: Azure resource ID of the resource that received the alerts. - * + * * @return the effectedResourceType value. */ public String effectedResourceType() { @@ -179,7 +183,7 @@ public String effectedResourceType() { /** * Get the systemSource property: The type of the alerted resource (Azure, Non-Azure). - * + * * @return the systemSource value. */ public String systemSource() { @@ -188,7 +192,7 @@ public String systemSource() { /** * Get the actionTaken property: IoT Security solution alert response. - * + * * @return the actionTaken value. */ public String actionTaken() { @@ -197,7 +201,7 @@ public String actionTaken() { /** * Get the logAnalyticsQuery property: Log analytics query for getting the list of affected devices/alerts. - * + * * @return the logAnalyticsQuery value. */ public String logAnalyticsQuery() { @@ -207,7 +211,7 @@ public String 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() { @@ -216,7 +220,7 @@ public List topDevicesLi /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 9d9a7c3beb311..ae23b23f9aeaf 100644 --- 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 @@ -11,7 +11,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** IoT Security solution recommendation information. */ +/** + * IoT Security solution recommendation information. + */ @Fluent public final class IoTSecurityAggregatedRecommendationInner extends ProxyResource { /* @@ -27,13 +29,15 @@ public final class IoTSecurityAggregatedRecommendationInner extends ProxyResourc @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of IoTSecurityAggregatedRecommendationInner class. */ + /** + * Creates an instance of IoTSecurityAggregatedRecommendationInner class. + */ public IoTSecurityAggregatedRecommendationInner() { } /** * Get the innerProperties property: Security Solution data. - * + * * @return the innerProperties value. */ private IoTSecurityAggregatedRecommendationProperties innerProperties() { @@ -42,7 +46,7 @@ private IoTSecurityAggregatedRecommendationProperties innerProperties() { /** * Get the tags property: Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -51,7 +55,7 @@ public Map tags() { /** * Set the tags property: Resource tags. - * + * * @param tags the tags value to set. * @return the IoTSecurityAggregatedRecommendationInner object itself. */ @@ -62,7 +66,7 @@ public IoTSecurityAggregatedRecommendationInner withTags(Map tag /** * Get the recommendationName property: Name of the recommendation. - * + * * @return the recommendationName value. */ public String recommendationName() { @@ -71,7 +75,7 @@ public String recommendationName() { /** * Set the recommendationName property: Name of the recommendation. - * + * * @param recommendationName the recommendationName value to set. * @return the IoTSecurityAggregatedRecommendationInner object itself. */ @@ -85,7 +89,7 @@ public IoTSecurityAggregatedRecommendationInner withRecommendationName(String re /** * Get the recommendationDisplayName property: Display name of the recommendation type. - * + * * @return the recommendationDisplayName value. */ public String recommendationDisplayName() { @@ -94,7 +98,7 @@ public String recommendationDisplayName() { /** * Get the description property: Description of the suspected vulnerability and meaning. - * + * * @return the description value. */ public String description() { @@ -103,7 +107,7 @@ public String description() { /** * Get the recommendationTypeId property: Recommendation-type GUID. - * + * * @return the recommendationTypeId value. */ public String recommendationTypeId() { @@ -112,7 +116,7 @@ public String recommendationTypeId() { /** * Get the detectedBy property: Name of the organization that made the recommendation. - * + * * @return the detectedBy value. */ public String detectedBy() { @@ -121,7 +125,7 @@ public String detectedBy() { /** * Get the remediationSteps property: Recommended steps for remediation. - * + * * @return the remediationSteps value. */ public String remediationSteps() { @@ -130,7 +134,7 @@ public String remediationSteps() { /** * Get the reportedSeverity property: Assessed recommendation severity. - * + * * @return the reportedSeverity value. */ public ReportedSeverity reportedSeverity() { @@ -139,7 +143,7 @@ public ReportedSeverity reportedSeverity() { /** * Get the healthyDevices property: Number of healthy devices within the IoT Security solution. - * + * * @return the healthyDevices value. */ public Long healthyDevices() { @@ -148,7 +152,7 @@ public Long healthyDevices() { /** * Get the unhealthyDeviceCount property: Number of unhealthy devices within the IoT Security solution. - * + * * @return the unhealthyDeviceCount value. */ public Long unhealthyDeviceCount() { @@ -157,7 +161,7 @@ public Long unhealthyDeviceCount() { /** * Get the logAnalyticsQuery property: Log analytics query for getting the list of affected devices/alerts. - * + * * @return the logAnalyticsQuery value. */ public String logAnalyticsQuery() { @@ -166,7 +170,7 @@ public String logAnalyticsQuery() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 9ee9660781831..0c1305dc7710f 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.resourcemanager.security.models.ReportedSeverity; import com.fasterxml.jackson.annotation.JsonProperty; -/** IoT Security solution aggregated recommendation information. */ +/** + * IoT Security solution aggregated recommendation information. + */ @Fluent public final class IoTSecurityAggregatedRecommendationProperties { /* @@ -71,13 +73,15 @@ public final class IoTSecurityAggregatedRecommendationProperties { @JsonProperty(value = "logAnalyticsQuery", access = JsonProperty.Access.WRITE_ONLY) private String logAnalyticsQuery; - /** Creates an instance of IoTSecurityAggregatedRecommendationProperties class. */ + /** + * Creates an instance of IoTSecurityAggregatedRecommendationProperties class. + */ public IoTSecurityAggregatedRecommendationProperties() { } /** * Get the recommendationName property: Name of the recommendation. - * + * * @return the recommendationName value. */ public String recommendationName() { @@ -86,7 +90,7 @@ public String recommendationName() { /** * Set the recommendationName property: Name of the recommendation. - * + * * @param recommendationName the recommendationName value to set. * @return the IoTSecurityAggregatedRecommendationProperties object itself. */ @@ -97,7 +101,7 @@ public IoTSecurityAggregatedRecommendationProperties withRecommendationName(Stri /** * Get the recommendationDisplayName property: Display name of the recommendation type. - * + * * @return the recommendationDisplayName value. */ public String recommendationDisplayName() { @@ -106,7 +110,7 @@ public String recommendationDisplayName() { /** * Get the description property: Description of the suspected vulnerability and meaning. - * + * * @return the description value. */ public String description() { @@ -115,7 +119,7 @@ public String description() { /** * Get the recommendationTypeId property: Recommendation-type GUID. - * + * * @return the recommendationTypeId value. */ public String recommendationTypeId() { @@ -124,7 +128,7 @@ public String recommendationTypeId() { /** * Get the detectedBy property: Name of the organization that made the recommendation. - * + * * @return the detectedBy value. */ public String detectedBy() { @@ -133,7 +137,7 @@ public String detectedBy() { /** * Get the remediationSteps property: Recommended steps for remediation. - * + * * @return the remediationSteps value. */ public String remediationSteps() { @@ -142,7 +146,7 @@ public String remediationSteps() { /** * Get the reportedSeverity property: Assessed recommendation severity. - * + * * @return the reportedSeverity value. */ public ReportedSeverity reportedSeverity() { @@ -151,7 +155,7 @@ public ReportedSeverity reportedSeverity() { /** * Get the healthyDevices property: Number of healthy devices within the IoT Security solution. - * + * * @return the healthyDevices value. */ public Long healthyDevices() { @@ -160,7 +164,7 @@ public Long healthyDevices() { /** * Get the unhealthyDeviceCount property: Number of unhealthy devices within the IoT Security solution. - * + * * @return the unhealthyDeviceCount value. */ public Long unhealthyDeviceCount() { @@ -169,7 +173,7 @@ public Long unhealthyDeviceCount() { /** * Get the logAnalyticsQuery property: Log analytics query for getting the list of affected devices/alerts. - * + * * @return the logAnalyticsQuery value. */ public String logAnalyticsQuery() { @@ -178,7 +182,7 @@ public String logAnalyticsQuery() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index fb70db188a5e4..3ed64aca81d3f 100644 --- 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 @@ -14,22 +14,26 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Security analytics of your IoT Security solution. */ +/** + * Security analytics of your IoT Security solution. + */ @Fluent public final class IoTSecuritySolutionAnalyticsModelInner extends ProxyResource { /* - * Security Solution Aggregated Alert data + * Security Solution Aggregated Alert data */ @JsonProperty(value = "properties") private IoTSecuritySolutionAnalyticsModelProperties innerProperties; - /** Creates an instance of IoTSecuritySolutionAnalyticsModelInner class. */ + /** + * Creates an instance of IoTSecuritySolutionAnalyticsModelInner class. + */ public IoTSecuritySolutionAnalyticsModelInner() { } /** * Get the innerProperties property: Security Solution Aggregated Alert data. - * + * * @return the innerProperties value. */ private IoTSecuritySolutionAnalyticsModelProperties innerProperties() { @@ -38,7 +42,7 @@ private IoTSecuritySolutionAnalyticsModelProperties innerProperties() { /** * Get the metrics property: Security analytics of your IoT Security solution. - * + * * @return the metrics value. */ public IoTSeverityMetrics metrics() { @@ -47,7 +51,7 @@ public IoTSeverityMetrics metrics() { /** * Get the unhealthyDeviceCount property: Number of unhealthy devices within your IoT Security solution. - * + * * @return the unhealthyDeviceCount value. */ public Long unhealthyDeviceCount() { @@ -56,7 +60,7 @@ public Long unhealthyDeviceCount() { /** * Get the devicesMetrics property: List of device metrics by the aggregation date. - * + * * @return the devicesMetrics value. */ public List devicesMetrics() { @@ -65,7 +69,7 @@ public List devic /** * Get the topAlertedDevices property: List of the 3 devices with the most alerts. - * + * * @return the topAlertedDevices value. */ public List topAlertedDevices() { @@ -74,12 +78,12 @@ public List topAlertedDevices() { /** * Set the topAlertedDevices property: List of the 3 devices with the most alerts. - * + * * @param topAlertedDevices the topAlertedDevices value to set. * @return the IoTSecuritySolutionAnalyticsModelInner object itself. */ - public IoTSecuritySolutionAnalyticsModelInner withTopAlertedDevices( - List topAlertedDevices) { + public IoTSecuritySolutionAnalyticsModelInner + withTopAlertedDevices(List topAlertedDevices) { if (this.innerProperties() == null) { this.innerProperties = new IoTSecuritySolutionAnalyticsModelProperties(); } @@ -89,7 +93,7 @@ public IoTSecuritySolutionAnalyticsModelInner withTopAlertedDevices( /** * Get the mostPrevalentDeviceAlerts property: List of the 3 most prevalent device alerts. - * + * * @return the mostPrevalentDeviceAlerts value. */ public List mostPrevalentDeviceAlerts() { @@ -98,12 +102,12 @@ public List mostPrevalentDeviceAlerts() { /** * Set the mostPrevalentDeviceAlerts property: List of the 3 most prevalent device alerts. - * + * * @param mostPrevalentDeviceAlerts the mostPrevalentDeviceAlerts value to set. * @return the IoTSecuritySolutionAnalyticsModelInner object itself. */ - public IoTSecuritySolutionAnalyticsModelInner withMostPrevalentDeviceAlerts( - List mostPrevalentDeviceAlerts) { + public IoTSecuritySolutionAnalyticsModelInner + withMostPrevalentDeviceAlerts(List mostPrevalentDeviceAlerts) { if (this.innerProperties() == null) { this.innerProperties = new IoTSecuritySolutionAnalyticsModelProperties(); } @@ -113,7 +117,7 @@ public IoTSecuritySolutionAnalyticsModelInner withMostPrevalentDeviceAlerts( /** * Get the mostPrevalentDeviceRecommendations property: List of the 3 most prevalent device recommendations. - * + * * @return the mostPrevalentDeviceRecommendations value. */ public List mostPrevalentDeviceRecommendations() { @@ -122,7 +126,7 @@ public List mostPrevalentDeviceRecommendations( /** * Set the mostPrevalentDeviceRecommendations property: List of the 3 most prevalent device recommendations. - * + * * @param mostPrevalentDeviceRecommendations the mostPrevalentDeviceRecommendations value to set. * @return the IoTSecuritySolutionAnalyticsModelInner object itself. */ @@ -137,7 +141,7 @@ public IoTSecuritySolutionAnalyticsModelInner withMostPrevalentDeviceRecommendat /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 05ebcd73f079a..5b485603f7539 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of Security analytics of your IoT Security solution. */ +/** + * List of Security analytics of your IoT Security solution. + */ @Fluent public final class IoTSecuritySolutionAnalyticsModelListInner { /* @@ -24,13 +26,15 @@ public final class IoTSecuritySolutionAnalyticsModelListInner { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of IoTSecuritySolutionAnalyticsModelListInner class. */ + /** + * Creates an instance of IoTSecuritySolutionAnalyticsModelListInner class. + */ public IoTSecuritySolutionAnalyticsModelListInner() { } /** * Get the value property: List of Security analytics of your IoT Security solution. - * + * * @return the value value. */ public List value() { @@ -39,7 +43,7 @@ public List value() { /** * Set the value property: List of Security analytics of your IoT Security solution. - * + * * @param value the value value to set. * @return the IoTSecuritySolutionAnalyticsModelListInner object itself. */ @@ -50,7 +54,7 @@ public IoTSecuritySolutionAnalyticsModelListInner withValue(List e.validate()); } 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 index 6ca28aeb9f29a..c43a6fdf5de65 100644 --- 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 @@ -13,7 +13,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Security analytics properties of your IoT Security solution. */ +/** + * Security analytics properties of your IoT Security solution. + */ @Fluent public final class IoTSecuritySolutionAnalyticsModelProperties { /* @@ -52,13 +54,15 @@ public final class IoTSecuritySolutionAnalyticsModelProperties { @JsonProperty(value = "mostPrevalentDeviceRecommendations") private List mostPrevalentDeviceRecommendations; - /** Creates an instance of IoTSecuritySolutionAnalyticsModelProperties class. */ + /** + * Creates an instance of IoTSecuritySolutionAnalyticsModelProperties class. + */ public IoTSecuritySolutionAnalyticsModelProperties() { } /** * Get the metrics property: Security analytics of your IoT Security solution. - * + * * @return the metrics value. */ public IoTSeverityMetrics metrics() { @@ -67,7 +71,7 @@ public IoTSeverityMetrics metrics() { /** * Get the unhealthyDeviceCount property: Number of unhealthy devices within your IoT Security solution. - * + * * @return the unhealthyDeviceCount value. */ public Long unhealthyDeviceCount() { @@ -76,7 +80,7 @@ public Long unhealthyDeviceCount() { /** * Get the devicesMetrics property: List of device metrics by the aggregation date. - * + * * @return the devicesMetrics value. */ public List devicesMetrics() { @@ -85,7 +89,7 @@ public List devic /** * Get the topAlertedDevices property: List of the 3 devices with the most alerts. - * + * * @return the topAlertedDevices value. */ public List topAlertedDevices() { @@ -94,19 +98,19 @@ public List topAlertedDevices() { /** * Set the topAlertedDevices property: List of the 3 devices with the most alerts. - * + * * @param topAlertedDevices the topAlertedDevices value to set. * @return the IoTSecuritySolutionAnalyticsModelProperties object itself. */ - public IoTSecuritySolutionAnalyticsModelProperties withTopAlertedDevices( - List topAlertedDevices) { + public IoTSecuritySolutionAnalyticsModelProperties + withTopAlertedDevices(List topAlertedDevices) { this.topAlertedDevices = topAlertedDevices; return this; } /** * Get the mostPrevalentDeviceAlerts property: List of the 3 most prevalent device alerts. - * + * * @return the mostPrevalentDeviceAlerts value. */ public List mostPrevalentDeviceAlerts() { @@ -115,19 +119,19 @@ public List mostPrevalentDeviceAlerts() { /** * Set the mostPrevalentDeviceAlerts property: List of the 3 most prevalent device alerts. - * + * * @param mostPrevalentDeviceAlerts the mostPrevalentDeviceAlerts value to set. * @return the IoTSecuritySolutionAnalyticsModelProperties object itself. */ - public IoTSecuritySolutionAnalyticsModelProperties withMostPrevalentDeviceAlerts( - List mostPrevalentDeviceAlerts) { + public IoTSecuritySolutionAnalyticsModelProperties + withMostPrevalentDeviceAlerts(List mostPrevalentDeviceAlerts) { this.mostPrevalentDeviceAlerts = mostPrevalentDeviceAlerts; return this; } /** * Get the mostPrevalentDeviceRecommendations property: List of the 3 most prevalent device recommendations. - * + * * @return the mostPrevalentDeviceRecommendations value. */ public List mostPrevalentDeviceRecommendations() { @@ -136,7 +140,7 @@ public List mostPrevalentDeviceRecommendations( /** * Set the mostPrevalentDeviceRecommendations property: List of the 3 most prevalent device recommendations. - * + * * @param mostPrevalentDeviceRecommendations the mostPrevalentDeviceRecommendations value to set. * @return the IoTSecuritySolutionAnalyticsModelProperties object itself. */ @@ -148,7 +152,7 @@ public IoTSecuritySolutionAnalyticsModelProperties withMostPrevalentDeviceRecomm /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 6659bf29c42b7..215dba52bc7ed 100644 --- 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 @@ -19,7 +19,9 @@ import java.util.List; import java.util.Map; -/** IoT Security solution configuration and resource information. */ +/** + * IoT Security solution configuration and resource information. + */ @Fluent public final class IoTSecuritySolutionModelInner extends ProxyResource { /* @@ -47,13 +49,15 @@ public final class IoTSecuritySolutionModelInner extends ProxyResource { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of IoTSecuritySolutionModelInner class. */ + /** + * Creates an instance of IoTSecuritySolutionModelInner class. + */ public IoTSecuritySolutionModelInner() { } /** * Get the location property: The resource location. - * + * * @return the location value. */ public String location() { @@ -62,7 +66,7 @@ public String location() { /** * Set the location property: The resource location. - * + * * @param location the location value to set. * @return the IoTSecuritySolutionModelInner object itself. */ @@ -73,7 +77,7 @@ public IoTSecuritySolutionModelInner withLocation(String location) { /** * Get the innerProperties property: Security Solution data. - * + * * @return the innerProperties value. */ private IoTSecuritySolutionProperties innerProperties() { @@ -82,7 +86,7 @@ private IoTSecuritySolutionProperties innerProperties() { /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { @@ -91,7 +95,7 @@ public SystemData systemData() { /** * Get the tags property: Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -100,7 +104,7 @@ public Map tags() { /** * Set the tags property: Resource tags. - * + * * @param tags the tags value to set. * @return the IoTSecuritySolutionModelInner object itself. */ @@ -111,7 +115,7 @@ public IoTSecuritySolutionModelInner withTags(Map tags) { /** * Get the workspace property: Workspace resource ID. - * + * * @return the workspace value. */ public String workspace() { @@ -120,7 +124,7 @@ public String workspace() { /** * Set the workspace property: Workspace resource ID. - * + * * @param workspace the workspace value to set. * @return the IoTSecuritySolutionModelInner object itself. */ @@ -134,7 +138,7 @@ public IoTSecuritySolutionModelInner withWorkspace(String workspace) { /** * Get the displayName property: Resource display name. - * + * * @return the displayName value. */ public String displayName() { @@ -143,7 +147,7 @@ public String displayName() { /** * Set the displayName property: Resource display name. - * + * * @param displayName the displayName value to set. * @return the IoTSecuritySolutionModelInner object itself. */ @@ -157,7 +161,7 @@ public IoTSecuritySolutionModelInner withDisplayName(String displayName) { /** * Get the status property: Status of the IoT Security solution. - * + * * @return the status value. */ public SecuritySolutionStatus status() { @@ -166,7 +170,7 @@ public SecuritySolutionStatus status() { /** * Set the status property: Status of the IoT Security solution. - * + * * @param status the status value to set. * @return the IoTSecuritySolutionModelInner object itself. */ @@ -180,7 +184,7 @@ public IoTSecuritySolutionModelInner withStatus(SecuritySolutionStatus status) { /** * Get the export property: List of additional options for exporting to workspace data. - * + * * @return the export value. */ public List export() { @@ -189,7 +193,7 @@ public List 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. */ @@ -202,8 +206,9 @@ public IoTSecuritySolutionModelInner withExport(List export) { } /** - * Get the disabledDataSources property: Disabled data sources. Disabling these data sources compromises the system. - * + * Get the disabledDataSources property: Disabled data sources. Disabling these data sources compromises the + * system. + * * @return the disabledDataSources value. */ public List disabledDataSources() { @@ -211,8 +216,9 @@ public List disabledDataSources() { } /** - * Set the disabledDataSources property: Disabled data sources. Disabling these data sources compromises the system. - * + * 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. */ @@ -226,7 +232,7 @@ public IoTSecuritySolutionModelInner withDisabledDataSources(List di /** * Get the iotHubs property: IoT Hub resource IDs. - * + * * @return the iotHubs value. */ public List iotHubs() { @@ -235,7 +241,7 @@ public List iotHubs() { /** * Set the iotHubs property: IoT Hub resource IDs. - * + * * @param iotHubs the iotHubs value to set. * @return the IoTSecuritySolutionModelInner object itself. */ @@ -249,7 +255,7 @@ public IoTSecuritySolutionModelInner withIotHubs(List iotHubs) { /** * Get the userDefinedResources property: Properties of the IoT Security solution's user defined resources. - * + * * @return the userDefinedResources value. */ public UserDefinedResourcesProperties userDefinedResources() { @@ -258,7 +264,7 @@ public UserDefinedResourcesProperties 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. */ @@ -271,9 +277,9 @@ public IoTSecuritySolutionModelInner withUserDefinedResources(UserDefinedResourc } /** - * Get the autoDiscoveredResources property: List of resources that were automatically discovered as relevant to the - * security solution. - * + * Get the autoDiscoveredResources property: List of resources that were automatically discovered as relevant to + * the security solution. + * * @return the autoDiscoveredResources value. */ public List autoDiscoveredResources() { @@ -282,7 +288,7 @@ public List autoDiscoveredResources() { /** * Get the recommendationsConfiguration property: List of the configuration status for each recommendation type. - * + * * @return the recommendationsConfiguration value. */ public List recommendationsConfiguration() { @@ -291,12 +297,12 @@ public List 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) { + public IoTSecuritySolutionModelInner + withRecommendationsConfiguration(List recommendationsConfiguration) { if (this.innerProperties() == null) { this.innerProperties = new IoTSecuritySolutionProperties(); } @@ -306,7 +312,7 @@ public IoTSecuritySolutionModelInner withRecommendationsConfiguration( /** * Get the unmaskedIpLoggingStatus property: Unmasked IP address logging status. - * + * * @return the unmaskedIpLoggingStatus value. */ public UnmaskedIpLoggingStatus unmaskedIpLoggingStatus() { @@ -315,7 +321,7 @@ public UnmaskedIpLoggingStatus unmaskedIpLoggingStatus() { /** * Set the unmaskedIpLoggingStatus property: Unmasked IP address logging status. - * + * * @param unmaskedIpLoggingStatus the unmaskedIpLoggingStatus value to set. * @return the IoTSecuritySolutionModelInner object itself. */ @@ -329,7 +335,7 @@ public IoTSecuritySolutionModelInner withUnmaskedIpLoggingStatus(UnmaskedIpLoggi /** * Get the additionalWorkspaces property: List of additional workspaces. - * + * * @return the additionalWorkspaces value. */ public List additionalWorkspaces() { @@ -338,12 +344,12 @@ public List 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) { + public IoTSecuritySolutionModelInner + withAdditionalWorkspaces(List additionalWorkspaces) { if (this.innerProperties() == null) { this.innerProperties = new IoTSecuritySolutionProperties(); } @@ -353,7 +359,7 @@ public IoTSecuritySolutionModelInner withAdditionalWorkspaces( /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index daddad737073a..b50c1d45301dc 100644 --- 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 @@ -16,7 +16,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Security Solution setting data. */ +/** + * Security Solution setting data. + */ @Fluent public final class IoTSecuritySolutionProperties { /* @@ -85,13 +87,15 @@ public final class IoTSecuritySolutionProperties { @JsonProperty(value = "additionalWorkspaces") private List additionalWorkspaces; - /** Creates an instance of IoTSecuritySolutionProperties class. */ + /** + * Creates an instance of IoTSecuritySolutionProperties class. + */ public IoTSecuritySolutionProperties() { } /** * Get the workspace property: Workspace resource ID. - * + * * @return the workspace value. */ public String workspace() { @@ -100,7 +104,7 @@ public String workspace() { /** * Set the workspace property: Workspace resource ID. - * + * * @param workspace the workspace value to set. * @return the IoTSecuritySolutionProperties object itself. */ @@ -111,7 +115,7 @@ public IoTSecuritySolutionProperties withWorkspace(String workspace) { /** * Get the displayName property: Resource display name. - * + * * @return the displayName value. */ public String displayName() { @@ -120,7 +124,7 @@ public String displayName() { /** * Set the displayName property: Resource display name. - * + * * @param displayName the displayName value to set. * @return the IoTSecuritySolutionProperties object itself. */ @@ -131,7 +135,7 @@ public IoTSecuritySolutionProperties withDisplayName(String displayName) { /** * Get the status property: Status of the IoT Security solution. - * + * * @return the status value. */ public SecuritySolutionStatus status() { @@ -140,7 +144,7 @@ public SecuritySolutionStatus status() { /** * Set the status property: Status of the IoT Security solution. - * + * * @param status the status value to set. * @return the IoTSecuritySolutionProperties object itself. */ @@ -151,7 +155,7 @@ public IoTSecuritySolutionProperties withStatus(SecuritySolutionStatus status) { /** * Get the export property: List of additional options for exporting to workspace data. - * + * * @return the export value. */ public List export() { @@ -160,7 +164,7 @@ public List 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. */ @@ -170,8 +174,9 @@ public IoTSecuritySolutionProperties withExport(List export) { } /** - * Get the disabledDataSources property: Disabled data sources. Disabling these data sources compromises the system. - * + * Get the disabledDataSources property: Disabled data sources. Disabling these data sources compromises the + * system. + * * @return the disabledDataSources value. */ public List disabledDataSources() { @@ -179,8 +184,9 @@ public List disabledDataSources() { } /** - * Set the disabledDataSources property: Disabled data sources. Disabling these data sources compromises the system. - * + * 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. */ @@ -191,7 +197,7 @@ public IoTSecuritySolutionProperties withDisabledDataSources(List di /** * Get the iotHubs property: IoT Hub resource IDs. - * + * * @return the iotHubs value. */ public List iotHubs() { @@ -200,7 +206,7 @@ public List iotHubs() { /** * Set the iotHubs property: IoT Hub resource IDs. - * + * * @param iotHubs the iotHubs value to set. * @return the IoTSecuritySolutionProperties object itself. */ @@ -211,7 +217,7 @@ public IoTSecuritySolutionProperties withIotHubs(List iotHubs) { /** * Get the userDefinedResources property: Properties of the IoT Security solution's user defined resources. - * + * * @return the userDefinedResources value. */ public UserDefinedResourcesProperties userDefinedResources() { @@ -220,7 +226,7 @@ public UserDefinedResourcesProperties 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. */ @@ -230,9 +236,9 @@ public IoTSecuritySolutionProperties withUserDefinedResources(UserDefinedResourc } /** - * Get the autoDiscoveredResources property: List of resources that were automatically discovered as relevant to the - * security solution. - * + * Get the autoDiscoveredResources property: List of resources that were automatically discovered as relevant to + * the security solution. + * * @return the autoDiscoveredResources value. */ public List autoDiscoveredResources() { @@ -241,7 +247,7 @@ public List autoDiscoveredResources() { /** * Get the recommendationsConfiguration property: List of the configuration status for each recommendation type. - * + * * @return the recommendationsConfiguration value. */ public List recommendationsConfiguration() { @@ -250,19 +256,19 @@ public List 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) { + 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() { @@ -271,7 +277,7 @@ public UnmaskedIpLoggingStatus unmaskedIpLoggingStatus() { /** * Set the unmaskedIpLoggingStatus property: Unmasked IP address logging status. - * + * * @param unmaskedIpLoggingStatus the unmaskedIpLoggingStatus value to set. * @return the IoTSecuritySolutionProperties object itself. */ @@ -282,7 +288,7 @@ public IoTSecuritySolutionProperties withUnmaskedIpLoggingStatus(UnmaskedIpLoggi /** * Get the additionalWorkspaces property: List of additional workspaces. - * + * * @return the additionalWorkspaces value. */ public List additionalWorkspaces() { @@ -291,33 +297,29 @@ public List 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) { + 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 - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property displayName in model IoTSecuritySolutionProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property displayName in model IoTSecuritySolutionProperties")); } if (iotHubs() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property iotHubs in model IoTSecuritySolutionProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property iotHubs in model IoTSecuritySolutionProperties")); } if (userDefinedResources() != null) { userDefinedResources().validate(); 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 index 7b307820330e5..9763957454846 100644 --- 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 @@ -11,7 +11,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The JitNetworkAccessPolicy model. */ +/** + * The JitNetworkAccessPolicy model. + */ @Fluent public final class JitNetworkAccessPolicyInner extends ProxyResource { /* @@ -32,13 +34,15 @@ public final class JitNetworkAccessPolicyInner extends ProxyResource { @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) private String location; - /** Creates an instance of JitNetworkAccessPolicyInner class. */ + /** + * Creates an instance of JitNetworkAccessPolicyInner class. + */ public JitNetworkAccessPolicyInner() { } /** * Get the innerProperties property: The properties property. - * + * * @return the innerProperties value. */ private JitNetworkAccessPolicyProperties innerProperties() { @@ -47,7 +51,7 @@ private JitNetworkAccessPolicyProperties innerProperties() { /** * Get the kind property: Kind of the resource. - * + * * @return the kind value. */ public String kind() { @@ -56,7 +60,7 @@ public String kind() { /** * Set the kind property: Kind of the resource. - * + * * @param kind the kind value to set. * @return the JitNetworkAccessPolicyInner object itself. */ @@ -67,7 +71,7 @@ public JitNetworkAccessPolicyInner withKind(String kind) { /** * Get the location property: Location where the resource is stored. - * + * * @return the location value. */ public String location() { @@ -76,7 +80,7 @@ public String location() { /** * Get the virtualMachines property: Configurations for Microsoft.Compute/virtualMachines resource type. - * + * * @return the virtualMachines value. */ public List virtualMachines() { @@ -85,7 +89,7 @@ public List virtualMachines() { /** * Set the virtualMachines property: Configurations for Microsoft.Compute/virtualMachines resource type. - * + * * @param virtualMachines the virtualMachines value to set. * @return the JitNetworkAccessPolicyInner object itself. */ @@ -99,7 +103,7 @@ public JitNetworkAccessPolicyInner withVirtualMachines(List requests() { @@ -108,7 +112,7 @@ public List requests() { /** * Set the requests property: The requests property. - * + * * @param requests the requests value to set. * @return the JitNetworkAccessPolicyInner object itself. */ @@ -122,7 +126,7 @@ public JitNetworkAccessPolicyInner withRequests(List virtualMachines() { @@ -46,19 +50,19 @@ public List 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) { + public JitNetworkAccessPolicyProperties + withVirtualMachines(List virtualMachines) { this.virtualMachines = virtualMachines; return this; } /** * Get the requests property: The requests property. - * + * * @return the requests value. */ public List requests() { @@ -67,7 +71,7 @@ public List requests() { /** * Set the requests property: The requests property. - * + * * @param requests the requests value to set. * @return the JitNetworkAccessPolicyProperties object itself. */ @@ -78,7 +82,7 @@ public JitNetworkAccessPolicyProperties withRequests(List e.validate()); } 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 index 6864965bacb34..9043ec0754389 100644 --- 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 @@ -11,7 +11,9 @@ import java.time.OffsetDateTime; import java.util.List; -/** The JitNetworkAccessRequest model. */ +/** + * The JitNetworkAccessRequest model. + */ @Fluent public final class JitNetworkAccessRequestInner { /* @@ -38,13 +40,15 @@ public final class JitNetworkAccessRequestInner { @JsonProperty(value = "justification") private String justification; - /** Creates an instance of JitNetworkAccessRequestInner class. */ + /** + * Creates an instance of JitNetworkAccessRequestInner class. + */ public JitNetworkAccessRequestInner() { } /** * Get the virtualMachines property: The virtualMachines property. - * + * * @return the virtualMachines value. */ public List virtualMachines() { @@ -53,19 +57,19 @@ public List 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) { + 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() { @@ -74,7 +78,7 @@ public OffsetDateTime 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. */ @@ -85,7 +89,7 @@ public JitNetworkAccessRequestInner withStartTimeUtc(OffsetDateTime startTimeUtc /** * Get the requestor property: The identity of the person who made the request. - * + * * @return the requestor value. */ public String requestor() { @@ -94,7 +98,7 @@ public String 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. */ @@ -105,7 +109,7 @@ public JitNetworkAccessRequestInner withRequestor(String requestor) { /** * Get the justification property: The justification for making the initiate request. - * + * * @return the justification value. */ public String justification() { @@ -114,7 +118,7 @@ public String justification() { /** * Set the justification property: The justification for making the initiate request. - * + * * @param justification the justification value to set. * @return the JitNetworkAccessRequestInner object itself. */ @@ -125,29 +129,23 @@ public JitNetworkAccessRequestInner withJustification(String justification) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (virtualMachines() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property virtualMachines in model JitNetworkAccessRequestInner")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property virtualMachines in model JitNetworkAccessRequestInner")); } else { virtualMachines().forEach(e -> e.validate()); } if (startTimeUtc() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property startTimeUtc in model JitNetworkAccessRequestInner")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property startTimeUtc in model JitNetworkAccessRequestInner")); } if (requestor() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property requestor in model JitNetworkAccessRequestInner")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property requestor in model JitNetworkAccessRequestInner")); } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MalwareScanningProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MalwareScanningProperties.java new file mode 100644 index 0000000000000..fc1926b41e9ea --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MalwareScanningProperties.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.security.models.OperationStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of Malware Scanning. + */ +@Fluent +public final class MalwareScanningProperties { + /* + * Properties of On Upload malware scanning. + */ + @JsonProperty(value = "onUpload") + private OnUploadProperties innerOnUpload; + + /* + * Optional. Resource id of an Event Grid Topic to send scan results to. + */ + @JsonProperty(value = "scanResultsEventGridTopicResourceId") + private String scanResultsEventGridTopicResourceId; + + /* + * Upon failure or partial success. Additional data describing Malware Scanning enable/disable operation. + */ + @JsonProperty(value = "operationStatus", access = JsonProperty.Access.WRITE_ONLY) + private OperationStatus operationStatus; + + /** + * Creates an instance of MalwareScanningProperties class. + */ + public MalwareScanningProperties() { + } + + /** + * Get the innerOnUpload property: Properties of On Upload malware scanning. + * + * @return the innerOnUpload value. + */ + private OnUploadProperties innerOnUpload() { + return this.innerOnUpload; + } + + /** + * Get the scanResultsEventGridTopicResourceId property: Optional. Resource id of an Event Grid Topic to send scan + * results to. + * + * @return the scanResultsEventGridTopicResourceId value. + */ + public String scanResultsEventGridTopicResourceId() { + return this.scanResultsEventGridTopicResourceId; + } + + /** + * Set the scanResultsEventGridTopicResourceId property: Optional. Resource id of an Event Grid Topic to send scan + * results to. + * + * @param scanResultsEventGridTopicResourceId the scanResultsEventGridTopicResourceId value to set. + * @return the MalwareScanningProperties object itself. + */ + public MalwareScanningProperties + withScanResultsEventGridTopicResourceId(String scanResultsEventGridTopicResourceId) { + this.scanResultsEventGridTopicResourceId = scanResultsEventGridTopicResourceId; + return this; + } + + /** + * Get the operationStatus property: Upon failure or partial success. Additional data describing Malware Scanning + * enable/disable operation. + * + * @return the operationStatus value. + */ + public OperationStatus operationStatus() { + return this.operationStatus; + } + + /** + * Get the isEnabled property: Indicates whether On Upload malware scanning should be enabled. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.innerOnUpload() == null ? null : this.innerOnUpload().isEnabled(); + } + + /** + * Set the isEnabled property: Indicates whether On Upload malware scanning should be enabled. + * + * @param isEnabled the isEnabled value to set. + * @return the MalwareScanningProperties object itself. + */ + public MalwareScanningProperties withIsEnabled(Boolean isEnabled) { + if (this.innerOnUpload() == null) { + this.innerOnUpload = new OnUploadProperties(); + } + this.innerOnUpload().withIsEnabled(isEnabled); + return this; + } + + /** + * Get the capGBPerMonth property: Defines the max GB to be scanned per Month. Set to -1 if no capping is needed. + * + * @return the capGBPerMonth value. + */ + public Integer capGBPerMonth() { + return this.innerOnUpload() == null ? null : this.innerOnUpload().capGBPerMonth(); + } + + /** + * Set the capGBPerMonth property: Defines the max GB to be scanned per Month. Set to -1 if no capping is needed. + * + * @param capGBPerMonth the capGBPerMonth value to set. + * @return the MalwareScanningProperties object itself. + */ + public MalwareScanningProperties withCapGBPerMonth(Integer capGBPerMonth) { + if (this.innerOnUpload() == null) { + this.innerOnUpload = new OnUploadProperties(); + } + this.innerOnUpload().withCapGBPerMonth(capGBPerMonth); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerOnUpload() != null) { + innerOnUpload().validate(); + } + if (operationStatus() != null) { + operationStatus().validate(); + } + } +} 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 index bd385f7c835d3..3202212b27991 100644 --- 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 @@ -8,23 +8,29 @@ import com.azure.core.management.ProxyResource; import com.fasterxml.jackson.annotation.JsonProperty; -/** The resource of the configuration or data needed to onboard the machine to MDE. */ +/** + * The resource of the configuration or data needed to onboard the machine to MDE. + */ @Fluent 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 */ @JsonProperty(value = "properties") private MdeOnboardingDataProperties innerProperties; - /** Creates an instance of MdeOnboardingDataInner class. */ + /** + * Creates an instance of MdeOnboardingDataInner class. + */ public 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() { @@ -34,17 +40,17 @@ private MdeOnboardingDataProperties innerProperties() { /** * 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 ? new byte[0] : this.innerProperties().onboardingPackageWindows(); + return this.innerProperties() == null ? EMPTY_BYTE_ARRAY : this.innerProperties().onboardingPackageWindows(); } /** * Set 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. - * + * * @param onboardingPackageWindows the onboardingPackageWindows value to set. * @return the MdeOnboardingDataInner object itself. */ @@ -59,17 +65,17 @@ public MdeOnboardingDataInner withOnboardingPackageWindows(byte[] onboardingPack /** * 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 ? new byte[0] : this.innerProperties().onboardingPackageLinux(); + return this.innerProperties() == null ? EMPTY_BYTE_ARRAY : this.innerProperties().onboardingPackageLinux(); } /** * Set 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. - * + * * @param onboardingPackageLinux the onboardingPackageLinux value to set. * @return the MdeOnboardingDataInner object itself. */ @@ -83,7 +89,7 @@ public MdeOnboardingDataInner withOnboardingPackageLinux(byte[] onboardingPackag /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index b6650c04d95db..5385060ce6a69 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of all MDE onboarding data resources. */ +/** + * List of all MDE onboarding data resources. + */ @Fluent public final class MdeOnboardingDataListInner { /* @@ -17,13 +19,15 @@ public final class MdeOnboardingDataListInner { @JsonProperty(value = "value") private List value; - /** Creates an instance of MdeOnboardingDataListInner class. */ + /** + * Creates an instance of MdeOnboardingDataListInner class. + */ public 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() { @@ -32,7 +36,7 @@ public List value() { /** * Set the value property: List of the resources of the configuration or data needed to onboard the machine to MDE. - * + * * @param value the value value to set. * @return the MdeOnboardingDataListInner object itself. */ @@ -43,7 +47,7 @@ public MdeOnboardingDataListInner withValue(List value) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index b1bae4df584b5..cd5151bb2f884 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.core.util.CoreUtils; import com.fasterxml.jackson.annotation.JsonProperty; -/** Properties of the MDE configuration or data parameter needed to onboard the machine to MDE. */ +/** + * Properties of the MDE configuration or data parameter needed to onboard the machine to MDE. + */ @Fluent public final class MdeOnboardingDataProperties { /* @@ -25,14 +27,16 @@ public final class MdeOnboardingDataProperties { @JsonProperty(value = "onboardingPackageLinux") private byte[] onboardingPackageLinux; - /** Creates an instance of MdeOnboardingDataProperties class. */ + /** + * Creates an instance of MdeOnboardingDataProperties class. + */ public 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() { @@ -42,7 +46,7 @@ public byte[] onboardingPackageWindows() { /** * Set 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. - * + * * @param onboardingPackageWindows the onboardingPackageWindows value to set. * @return the MdeOnboardingDataProperties object itself. */ @@ -54,7 +58,7 @@ public MdeOnboardingDataProperties withOnboardingPackageWindows(byte[] onboardin /** * 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() { @@ -64,7 +68,7 @@ public byte[] onboardingPackageLinux() { /** * Set 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. - * + * * @param onboardingPackageLinux the onboardingPackageLinux value to set. * @return the MdeOnboardingDataProperties object itself. */ @@ -75,7 +79,7 @@ public MdeOnboardingDataProperties withOnboardingPackageLinux(byte[] onboardingP /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OnUploadProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OnUploadProperties.java new file mode 100644 index 0000000000000..ec474144bbd50 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OnUploadProperties.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of On Upload malware scanning. + */ +@Fluent +public final class OnUploadProperties { + /* + * Indicates whether On Upload malware scanning should be enabled. + */ + @JsonProperty(value = "isEnabled") + private Boolean isEnabled; + + /* + * Defines the max GB to be scanned per Month. Set to -1 if no capping is needed. + */ + @JsonProperty(value = "capGBPerMonth") + private Integer capGBPerMonth; + + /** + * Creates an instance of OnUploadProperties class. + */ + public OnUploadProperties() { + } + + /** + * Get the isEnabled property: Indicates whether On Upload malware scanning should be enabled. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * Set the isEnabled property: Indicates whether On Upload malware scanning should be enabled. + * + * @param isEnabled the isEnabled value to set. + * @return the OnUploadProperties object itself. + */ + public OnUploadProperties withIsEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get the capGBPerMonth property: Defines the max GB to be scanned per Month. Set to -1 if no capping is needed. + * + * @return the capGBPerMonth value. + */ + public Integer capGBPerMonth() { + return this.capGBPerMonth; + } + + /** + * Set the capGBPerMonth property: Defines the max GB to be scanned per Month. Set to -1 if no capping is needed. + * + * @param capGBPerMonth the capGBPerMonth value to set. + * @return the OnUploadProperties object itself. + */ + public OnUploadProperties withCapGBPerMonth(Integer capGBPerMonth) { + this.capGBPerMonth = capGBPerMonth; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 index e681d61a3dd22..bb95b9088b5a1 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.resourcemanager.security.models.OperationDisplay; import com.fasterxml.jackson.annotation.JsonProperty; -/** Possible operation in the REST API of Microsoft.Security. */ +/** + * Possible operation in the REST API of Microsoft.Security. + */ @Fluent public final class OperationInner { /* @@ -29,13 +31,15 @@ public final class OperationInner { @JsonProperty(value = "display") private OperationDisplay display; - /** Creates an instance of OperationInner class. */ + /** + * Creates an instance of OperationInner class. + */ public OperationInner() { } /** * Get the name property: Name of the operation. - * + * * @return the name value. */ public String name() { @@ -44,7 +48,7 @@ public String name() { /** * Get the origin property: Where the operation is originated. - * + * * @return the origin value. */ public String origin() { @@ -53,7 +57,7 @@ public String origin() { /** * Get the display property: Security operation display. - * + * * @return the display value. */ public OperationDisplay display() { @@ -62,7 +66,7 @@ public OperationDisplay display() { /** * Set the display property: Security operation display. - * + * * @param display the display value to set. * @return the OperationInner object itself. */ @@ -73,7 +77,7 @@ public OperationInner withDisplay(OperationDisplay display) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationResultAutoGeneratedInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationResultAutoGeneratedInner.java index c4ca79253a776..697a3841200f3 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationResultAutoGeneratedInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationResultAutoGeneratedInner.java @@ -8,7 +8,9 @@ import com.azure.resourcemanager.security.models.OperationResult; import com.fasterxml.jackson.annotation.JsonProperty; -/** Long run operation status of governance rule over a given scope. */ +/** + * Long run operation status of governance rule over a given scope. + */ @Immutable public final class OperationResultAutoGeneratedInner { /* @@ -17,13 +19,15 @@ public final class OperationResultAutoGeneratedInner { @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private OperationResult status; - /** Creates an instance of OperationResultAutoGeneratedInner class. */ + /** + * Creates an instance of OperationResultAutoGeneratedInner class. + */ public OperationResultAutoGeneratedInner() { } /** * Get the status property: The status of the long run operation result of governance rule. - * + * * @return the status value. */ public OperationResult status() { @@ -32,7 +36,7 @@ public OperationResult status() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 new file mode 100644 index 0000000000000..163c04aa5bff2 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationStatusResultInner.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * The current status of an async operation. + */ +@Fluent +public final class OperationStatusResultInner { + /* + * Fully qualified ID for the async operation. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Name of the async operation. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Operation status. + */ + @JsonProperty(value = "status", required = true) + private String status; + + /* + * Percent of the operation that is complete. + */ + @JsonProperty(value = "percentComplete") + private Float percentComplete; + + /* + * The start time of the operation. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * The end time of the operation. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * The operations list. + */ + @JsonProperty(value = "operations") + private List operations; + + /* + * If present, details of the operation error. + */ + @JsonProperty(value = "error") + private ManagementError error; + + /** + * Creates an instance of OperationStatusResultInner class. + */ + public OperationStatusResultInner() { + } + + /** + * Get the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Fully qualified ID for the async operation. + * + * @param id the id value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: Name of the async operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the async operation. + * + * @param name the name value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the status property: Operation status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Operation status. + * + * @param status the status value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + public Float percentComplete() { + return this.percentComplete; + } + + /** + * Set the percentComplete property: Percent of the operation that is complete. + * + * @param percentComplete the percentComplete value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withPercentComplete(Float percentComplete) { + this.percentComplete = percentComplete; + return this; + } + + /** + * Get the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time of the operation. + * + * @param startTime the startTime value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end time of the operation. + * + * @param endTime the endTime value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the operations property: The operations list. + * + * @return the operations value. + */ + public List operations() { + return this.operations; + } + + /** + * Set the operations property: The operations list. + * + * @param operations the operations value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withOperations(List operations) { + this.operations = operations; + return this; + } + + /** + * Get the error property: If present, details of the operation error. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Set the error property: If present, details of the operation error. + * + * @param error the error value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withError(ManagementError error) { + this.error = error; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() == null) { + throw LOGGER.logExceptionAsError( + 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); +} 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 index 99e8664219982..fcb5bbae1b65d 100644 --- 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 @@ -6,8 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +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 com.fasterxml.jackson.annotation.JsonProperty; import java.time.Duration; import java.time.OffsetDateTime; @@ -25,13 +28,15 @@ public final class PricingInner extends ProxyResource { @JsonProperty(value = "properties") private PricingProperties innerProperties; - /** Creates an instance of PricingInner class. */ + /** + * Creates an instance of PricingInner class. + */ public PricingInner() { } /** * Get the innerProperties property: Pricing data. - * + * * @return the innerProperties value. */ private PricingProperties innerProperties() { @@ -39,10 +44,10 @@ private PricingProperties innerProperties() { } /** - * Get the pricingTier property: The pricing tier value. 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. - * + * 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() { @@ -50,10 +55,10 @@ public PricingTier pricingTier() { } /** - * Set the pricingTier property: The pricing tier value. 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. - * + * 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. */ @@ -66,9 +71,11 @@ public PricingInner withPricingTier(PricingTier pricingTier) { } /** - * 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. - * + * 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() { @@ -76,9 +83,11 @@ public String 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. - * + * 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. */ @@ -93,7 +102,7 @@ public PricingInner withSubPlan(String subPlan) { /** * 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() { @@ -103,7 +112,7 @@ public Duration 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() { @@ -111,28 +120,73 @@ public OffsetDateTime enablementTime() { } /** - * 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. + * 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 Boolean deprecated() { - return this.innerProperties() == null ? null : this.innerProperties().deprecated(); + public Enforce enforce() { + return this.innerProperties() == null ? null : this.innerProperties().enforce(); } /** - * 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. + * 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 List replacedBy() { - return this.innerProperties() == null ? null : this.innerProperties().replacedBy(); + 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() { @@ -141,7 +195,7 @@ public List 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. */ @@ -153,9 +207,29 @@ public PricingInner withExtensions(List 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() { 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 index 51b2670b30a29..89e92c08ec658 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of pricing configurations response. */ +/** + * List of pricing configurations response. + */ @Fluent public final class PricingListInner { /* @@ -18,13 +20,15 @@ public final class PricingListInner { @JsonProperty(value = "value", required = true) private List value; - /** Creates an instance of PricingListInner class. */ + /** + * Creates an instance of PricingListInner class. + */ public PricingListInner() { } /** * Get the value property: List of pricing configurations. - * + * * @return the value value. */ public List value() { @@ -33,7 +37,7 @@ public List value() { /** * Set the value property: List of pricing configurations. - * + * * @param value the value value to set. * @return the PricingListInner object itself. */ @@ -44,14 +48,13 @@ public PricingListInner withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model PricingListInner")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model PricingListInner")); } else { value().forEach(e -> e.validate()); } 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 index 681894d02f723..e3cd403183f80 100644 --- 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 @@ -6,26 +6,33 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +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 com.fasterxml.jackson.annotation.JsonProperty; import java.time.Duration; import java.time.OffsetDateTime; import java.util.List; -/** Pricing properties for the relevant scope. */ +/** + * Pricing properties for the relevant scope. + */ @Fluent public final class PricingProperties { /* - * The pricing tier value. 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. + * 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. */ @JsonProperty(value = "pricingTier", required = true) 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. + * 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. */ @JsonProperty(value = "subPlan") private String subPlan; @@ -43,6 +50,47 @@ public final class PricingProperties { @JsonProperty(value = "enablementTime", access = JsonProperty.Access.WRITE_ONLY) 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. + */ + @JsonProperty(value = "enforce") + 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. + */ + @JsonProperty(value = "inherited", access = JsonProperty.Access.WRITE_ONLY) + private Inherited inherited; + + /* + * The id of the scope inherited from. "Null" if not inherited. This field is only available for resource-level + * pricing. + */ + @JsonProperty(value = "inheritedFrom", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "resourcesCoverageStatus", access = JsonProperty.Access.WRITE_ONLY) + private ResourcesCoverageStatus resourcesCoverageStatus; + + /* + * Optional. List of extensions offered under a plan. + */ + @JsonProperty(value = "extensions") + private List extensions; + /* * Optional. True if the plan is deprecated. If there are replacing plans they will appear in `replacedBy` property */ @@ -55,21 +103,17 @@ public final class PricingProperties { @JsonProperty(value = "replacedBy", access = JsonProperty.Access.WRITE_ONLY) private List replacedBy; - /* - * Optional. List of extensions offered under a plan. + /** + * Creates an instance of PricingProperties class. */ - @JsonProperty(value = "extensions") - private List extensions; - - /** Creates an instance of PricingProperties class. */ public PricingProperties() { } /** - * Get the pricingTier property: The pricing tier value. 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. - * + * 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() { @@ -77,10 +121,10 @@ public PricingTier pricingTier() { } /** - * Set the pricingTier property: The pricing tier value. 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. - * + * 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. */ @@ -90,9 +134,11 @@ public PricingProperties withPricingTier(PricingTier pricingTier) { } /** - * 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. - * + * 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() { @@ -100,9 +146,11 @@ public String 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. - * + * 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. */ @@ -114,7 +162,7 @@ public PricingProperties withSubPlan(String subPlan) { /** * 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() { @@ -124,7 +172,7 @@ public Duration 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() { @@ -132,28 +180,70 @@ public OffsetDateTime enablementTime() { } /** - * 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. + * 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 Boolean deprecated() { - return this.deprecated; + public Enforce enforce() { + return this.enforce; } /** - * 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. + * 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 List replacedBy() { - return this.replacedBy; + 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() { @@ -162,7 +252,7 @@ public List 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. */ @@ -171,16 +261,35 @@ public PricingProperties withExtensions(List 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 - .logExceptionAsError( - new IllegalArgumentException("Missing required property pricingTier in model PricingProperties")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property pricingTier in model PricingProperties")); } if (extensions() != null) { extensions().forEach(e -> e.validate()); 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 index 308a6f823cecc..f954272f06623 100644 --- 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 @@ -9,7 +9,9 @@ import com.azure.resourcemanager.security.models.State; import com.fasterxml.jackson.annotation.JsonProperty; -/** Regulatory compliance assessment details and state. */ +/** + * Regulatory compliance assessment details and state. + */ @Fluent public final class RegulatoryComplianceAssessmentInner extends ProxyResource { /* @@ -18,13 +20,15 @@ public final class RegulatoryComplianceAssessmentInner extends ProxyResource { @JsonProperty(value = "properties") private RegulatoryComplianceAssessmentProperties innerProperties; - /** Creates an instance of RegulatoryComplianceAssessmentInner class. */ + /** + * Creates an instance of RegulatoryComplianceAssessmentInner class. + */ public RegulatoryComplianceAssessmentInner() { } /** * Get the innerProperties property: Regulatory compliance assessment data. - * + * * @return the innerProperties value. */ private RegulatoryComplianceAssessmentProperties innerProperties() { @@ -33,7 +37,7 @@ private RegulatoryComplianceAssessmentProperties innerProperties() { /** * Get the description property: The description of the regulatory compliance assessment. - * + * * @return the description value. */ public String description() { @@ -42,7 +46,7 @@ public String description() { /** * Get the assessmentType property: The expected type of assessment contained in the AssessmentDetailsLink. - * + * * @return the assessmentType value. */ public String assessmentType() { @@ -52,7 +56,7 @@ public String 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() { @@ -61,7 +65,7 @@ public String assessmentDetailsLink() { /** * Get the state property: Aggregative state based on the assessment's scanned resources states. - * + * * @return the state value. */ public State state() { @@ -70,7 +74,7 @@ public State state() { /** * Set the state property: Aggregative state based on the assessment's scanned resources states. - * + * * @param state the state value to set. * @return the RegulatoryComplianceAssessmentInner object itself. */ @@ -84,7 +88,7 @@ public RegulatoryComplianceAssessmentInner withState(State state) { /** * Get the passedResources property: The given assessment's related resources count with passed state. - * + * * @return the passedResources value. */ public Integer passedResources() { @@ -93,7 +97,7 @@ public Integer passedResources() { /** * Get the failedResources property: The given assessment's related resources count with failed state. - * + * * @return the failedResources value. */ public Integer failedResources() { @@ -102,7 +106,7 @@ public Integer failedResources() { /** * Get the skippedResources property: The given assessment's related resources count with skipped state. - * + * * @return the skippedResources value. */ public Integer skippedResources() { @@ -111,7 +115,7 @@ public Integer skippedResources() { /** * Get the unsupportedResources property: The given assessment's related resources count with unsupported state. - * + * * @return the unsupportedResources value. */ public Integer unsupportedResources() { @@ -120,7 +124,7 @@ public Integer unsupportedResources() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 71a2f73ca1518..693742fff1107 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.resourcemanager.security.models.State; import com.fasterxml.jackson.annotation.JsonProperty; -/** Regulatory compliance assessment data. */ +/** + * Regulatory compliance assessment data. + */ @Fluent public final class RegulatoryComplianceAssessmentProperties { /* @@ -59,13 +61,15 @@ public final class RegulatoryComplianceAssessmentProperties { @JsonProperty(value = "unsupportedResources", access = JsonProperty.Access.WRITE_ONLY) private Integer unsupportedResources; - /** Creates an instance of RegulatoryComplianceAssessmentProperties class. */ + /** + * Creates an instance of RegulatoryComplianceAssessmentProperties class. + */ public RegulatoryComplianceAssessmentProperties() { } /** * Get the description property: The description of the regulatory compliance assessment. - * + * * @return the description value. */ public String description() { @@ -74,7 +78,7 @@ public String description() { /** * Get the assessmentType property: The expected type of assessment contained in the AssessmentDetailsLink. - * + * * @return the assessmentType value. */ public String assessmentType() { @@ -84,7 +88,7 @@ public String 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() { @@ -93,7 +97,7 @@ public String assessmentDetailsLink() { /** * Get the state property: Aggregative state based on the assessment's scanned resources states. - * + * * @return the state value. */ public State state() { @@ -102,7 +106,7 @@ public State state() { /** * Set the state property: Aggregative state based on the assessment's scanned resources states. - * + * * @param state the state value to set. * @return the RegulatoryComplianceAssessmentProperties object itself. */ @@ -113,7 +117,7 @@ public RegulatoryComplianceAssessmentProperties withState(State state) { /** * Get the passedResources property: The given assessment's related resources count with passed state. - * + * * @return the passedResources value. */ public Integer passedResources() { @@ -122,7 +126,7 @@ public Integer passedResources() { /** * Get the failedResources property: The given assessment's related resources count with failed state. - * + * * @return the failedResources value. */ public Integer failedResources() { @@ -131,7 +135,7 @@ public Integer failedResources() { /** * Get the skippedResources property: The given assessment's related resources count with skipped state. - * + * * @return the skippedResources value. */ public Integer skippedResources() { @@ -140,7 +144,7 @@ public Integer skippedResources() { /** * Get the unsupportedResources property: The given assessment's related resources count with unsupported state. - * + * * @return the unsupportedResources value. */ public Integer unsupportedResources() { @@ -149,7 +153,7 @@ public Integer unsupportedResources() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 44b3715c5fc67..b92479007f613 100644 --- 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 @@ -9,7 +9,9 @@ import com.azure.resourcemanager.security.models.State; import com.fasterxml.jackson.annotation.JsonProperty; -/** Regulatory compliance control details and state. */ +/** + * Regulatory compliance control details and state. + */ @Fluent public final class RegulatoryComplianceControlInner extends ProxyResource { /* @@ -18,13 +20,15 @@ public final class RegulatoryComplianceControlInner extends ProxyResource { @JsonProperty(value = "properties") private RegulatoryComplianceControlProperties innerProperties; - /** Creates an instance of RegulatoryComplianceControlInner class. */ + /** + * Creates an instance of RegulatoryComplianceControlInner class. + */ public RegulatoryComplianceControlInner() { } /** * Get the innerProperties property: Regulatory compliance control data. - * + * * @return the innerProperties value. */ private RegulatoryComplianceControlProperties innerProperties() { @@ -33,7 +37,7 @@ private RegulatoryComplianceControlProperties innerProperties() { /** * Get the description property: The description of the regulatory compliance control. - * + * * @return the description value. */ public String description() { @@ -42,7 +46,7 @@ public String description() { /** * Get the state property: Aggregative state based on the control's supported assessments states. - * + * * @return the state value. */ public State state() { @@ -51,7 +55,7 @@ public State state() { /** * Set the state property: Aggregative state based on the control's supported assessments states. - * + * * @param state the state value to set. * @return the RegulatoryComplianceControlInner object itself. */ @@ -66,7 +70,7 @@ public RegulatoryComplianceControlInner withState(State 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() { @@ -76,7 +80,7 @@ public Integer 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() { @@ -86,7 +90,7 @@ public Integer 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() { @@ -95,7 +99,7 @@ public Integer skippedAssessments() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index fc016649b89ab..07fd3539ba945 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.resourcemanager.security.models.State; import com.fasterxml.jackson.annotation.JsonProperty; -/** Regulatory compliance control data. */ +/** + * Regulatory compliance control data. + */ @Fluent public final class RegulatoryComplianceControlProperties { /* @@ -41,13 +43,15 @@ public final class RegulatoryComplianceControlProperties { @JsonProperty(value = "skippedAssessments", access = JsonProperty.Access.WRITE_ONLY) private Integer skippedAssessments; - /** Creates an instance of RegulatoryComplianceControlProperties class. */ + /** + * Creates an instance of RegulatoryComplianceControlProperties class. + */ public RegulatoryComplianceControlProperties() { } /** * Get the description property: The description of the regulatory compliance control. - * + * * @return the description value. */ public String description() { @@ -56,7 +60,7 @@ public String description() { /** * Get the state property: Aggregative state based on the control's supported assessments states. - * + * * @return the state value. */ public State state() { @@ -65,7 +69,7 @@ public State state() { /** * Set the state property: Aggregative state based on the control's supported assessments states. - * + * * @param state the state value to set. * @return the RegulatoryComplianceControlProperties object itself. */ @@ -77,7 +81,7 @@ public RegulatoryComplianceControlProperties withState(State 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() { @@ -87,7 +91,7 @@ public Integer 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() { @@ -97,7 +101,7 @@ public Integer 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() { @@ -106,7 +110,7 @@ public Integer skippedAssessments() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 462389336ec01..cb2a3663524d6 100644 --- 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 @@ -9,7 +9,9 @@ import com.azure.resourcemanager.security.models.State; import com.fasterxml.jackson.annotation.JsonProperty; -/** Regulatory compliance standard details and state. */ +/** + * Regulatory compliance standard details and state. + */ @Fluent public final class RegulatoryComplianceStandardInner extends ProxyResource { /* @@ -18,13 +20,15 @@ public final class RegulatoryComplianceStandardInner extends ProxyResource { @JsonProperty(value = "properties") private RegulatoryComplianceStandardProperties innerProperties; - /** Creates an instance of RegulatoryComplianceStandardInner class. */ + /** + * Creates an instance of RegulatoryComplianceStandardInner class. + */ public RegulatoryComplianceStandardInner() { } /** * Get the innerProperties property: Regulatory compliance standard data. - * + * * @return the innerProperties value. */ private RegulatoryComplianceStandardProperties innerProperties() { @@ -33,7 +37,7 @@ private RegulatoryComplianceStandardProperties innerProperties() { /** * Get the state property: Aggregative state based on the standard's supported controls states. - * + * * @return the state value. */ public State state() { @@ -42,7 +46,7 @@ public State state() { /** * Set the state property: Aggregative state based on the standard's supported controls states. - * + * * @param state the state value to set. * @return the RegulatoryComplianceStandardInner object itself. */ @@ -57,7 +61,7 @@ public RegulatoryComplianceStandardInner withState(State 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() { @@ -67,7 +71,7 @@ public Integer 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() { @@ -77,7 +81,7 @@ public Integer 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() { @@ -87,7 +91,7 @@ public Integer 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() { @@ -96,7 +100,7 @@ public Integer unsupportedControls() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index a70b722ae82ff..399380675aaca 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.resourcemanager.security.models.State; import com.fasterxml.jackson.annotation.JsonProperty; -/** Regulatory compliance standard data. */ +/** + * Regulatory compliance standard data. + */ @Fluent public final class RegulatoryComplianceStandardProperties { /* @@ -42,13 +44,15 @@ public final class RegulatoryComplianceStandardProperties { @JsonProperty(value = "unsupportedControls", access = JsonProperty.Access.WRITE_ONLY) private Integer unsupportedControls; - /** Creates an instance of RegulatoryComplianceStandardProperties class. */ + /** + * Creates an instance of RegulatoryComplianceStandardProperties class. + */ public RegulatoryComplianceStandardProperties() { } /** * Get the state property: Aggregative state based on the standard's supported controls states. - * + * * @return the state value. */ public State state() { @@ -57,7 +61,7 @@ public State state() { /** * Set the state property: Aggregative state based on the standard's supported controls states. - * + * * @param state the state value to set. * @return the RegulatoryComplianceStandardProperties object itself. */ @@ -69,7 +73,7 @@ public RegulatoryComplianceStandardProperties withState(State 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() { @@ -79,7 +83,7 @@ public Integer 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() { @@ -89,7 +93,7 @@ public Integer 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() { @@ -99,7 +103,7 @@ public Integer 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() { @@ -108,7 +112,7 @@ public Integer unsupportedControls() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 2737512d54422..7ccd3cff0ea88 100644 --- 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 @@ -9,7 +9,9 @@ import com.azure.resourcemanager.security.models.RuleResultsProperties; import com.fasterxml.jackson.annotation.JsonProperty; -/** Rule results. */ +/** + * Rule results. + */ @Fluent public final class RuleResultsInner extends ProxyResource { /* @@ -18,13 +20,15 @@ public final class RuleResultsInner extends ProxyResource { @JsonProperty(value = "properties") private RuleResultsProperties properties; - /** Creates an instance of RuleResultsInner class. */ + /** + * Creates an instance of RuleResultsInner class. + */ public RuleResultsInner() { } /** * Get the properties property: Rule results properties. - * + * * @return the properties value. */ public RuleResultsProperties properties() { @@ -33,7 +37,7 @@ public RuleResultsProperties properties() { /** * Set the properties property: Rule results properties. - * + * * @param properties the properties value to set. * @return the RuleResultsInner object itself. */ @@ -44,7 +48,7 @@ public RuleResultsInner withProperties(RuleResultsProperties properties) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 2463dd2b01fa4..ea3f8d28ad6b5 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** A list of rules results. */ +/** + * A list of rules results. + */ @Fluent public final class RulesResultsInner { /* @@ -17,13 +19,15 @@ public final class RulesResultsInner { @JsonProperty(value = "value") private List value; - /** Creates an instance of RulesResultsInner class. */ + /** + * Creates an instance of RulesResultsInner class. + */ public RulesResultsInner() { } /** * Get the value property: List of rule results. - * + * * @return the value value. */ public List value() { @@ -32,7 +36,7 @@ public List value() { /** * Set the value property: List of rule results. - * + * * @param value the value value to set. * @return the RulesResultsInner object itself. */ @@ -43,7 +47,7 @@ public RulesResultsInner withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanInner.java index 55dba8acba1da..72374ef25f0f5 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanInner.java @@ -9,7 +9,9 @@ import com.azure.resourcemanager.security.models.ScanProperties; import com.fasterxml.jackson.annotation.JsonProperty; -/** A vulnerability assessment scan record. */ +/** + * A vulnerability assessment scan record. + */ @Fluent public final class ScanInner extends ProxyResource { /* @@ -18,13 +20,15 @@ public final class ScanInner extends ProxyResource { @JsonProperty(value = "properties") private ScanProperties properties; - /** Creates an instance of ScanInner class. */ + /** + * Creates an instance of ScanInner class. + */ public ScanInner() { } /** * Get the properties property: A vulnerability assessment scan record properties. - * + * * @return the properties value. */ public ScanProperties properties() { @@ -33,7 +37,7 @@ public ScanProperties properties() { /** * Set the properties property: A vulnerability assessment scan record properties. - * + * * @param properties the properties value to set. * @return the ScanInner object itself. */ @@ -44,7 +48,7 @@ public ScanInner withProperties(ScanProperties properties) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 2878009933cd9..b43faa716bd60 100644 --- 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 @@ -9,7 +9,9 @@ import com.azure.resourcemanager.security.models.ScanResultProperties; import com.fasterxml.jackson.annotation.JsonProperty; -/** A vulnerability assessment scan result for a single rule. */ +/** + * A vulnerability assessment scan result for a single rule. + */ @Fluent public final class ScanResultInner extends ProxyResource { /* @@ -18,13 +20,15 @@ public final class ScanResultInner extends ProxyResource { @JsonProperty(value = "properties") private ScanResultProperties properties; - /** Creates an instance of ScanResultInner class. */ + /** + * Creates an instance of ScanResultInner class. + */ public ScanResultInner() { } /** * Get the properties property: A vulnerability assessment scan result properties for a single rule. - * + * * @return the properties value. */ public ScanResultProperties properties() { @@ -33,7 +37,7 @@ public ScanResultProperties properties() { /** * Set the properties property: A vulnerability assessment scan result properties for a single rule. - * + * * @param properties the properties value to set. * @return the ScanResultInner object itself. */ @@ -44,7 +48,7 @@ public ScanResultInner withProperties(ScanResultProperties properties) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanResultsInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanResultsInner.java index 5a1807b5830cc..90d05e1ce0c1f 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanResultsInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanResultsInner.java @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** A list of vulnerability assessment scan results. */ +/** + * A list of vulnerability assessment scan results. + */ @Fluent public final class ScanResultsInner { /* @@ -17,13 +19,15 @@ public final class ScanResultsInner { @JsonProperty(value = "value") private List value; - /** Creates an instance of ScanResultsInner class. */ + /** + * Creates an instance of ScanResultsInner class. + */ public ScanResultsInner() { } /** * Get the value property: List of vulnerability assessment scan results. - * + * * @return the value value. */ public List value() { @@ -32,7 +36,7 @@ public List value() { /** * Set the value property: List of vulnerability assessment scan results. - * + * * @param value the value value to set. * @return the ScanResultsInner object itself. */ @@ -43,7 +47,7 @@ public ScanResultsInner withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScansInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScansInner.java index 18b1d47cef6ac..250deedf95ac4 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScansInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScansInner.java @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** A list of vulnerability assessment scan records. */ +/** + * A list of vulnerability assessment scan records. + */ @Fluent public final class ScansInner { /* @@ -17,13 +19,15 @@ public final class ScansInner { @JsonProperty(value = "value") private List value; - /** Creates an instance of ScansInner class. */ + /** + * Creates an instance of ScansInner class. + */ public ScansInner() { } /** * Get the value property: List of vulnerability assessment scan records. - * + * * @return the value value. */ public List value() { @@ -32,7 +36,7 @@ public List value() { /** * Set the value property: List of vulnerability assessment scan records. - * + * * @param value the value value to set. * @return the ScansInner object itself. */ @@ -43,7 +47,7 @@ public ScansInner withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 86bc7f839e8f2..3189d73d24038 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** Calculation result data. */ +/** + * Calculation result data. + */ @Immutable public final class ScoreDetails { /* @@ -28,13 +30,15 @@ public final class ScoreDetails { @JsonProperty(value = "percentage", access = JsonProperty.Access.WRITE_ONLY) private Double percentage; - /** Creates an instance of ScoreDetails class. */ + /** + * Creates an instance of ScoreDetails class. + */ public ScoreDetails() { } /** * Get the max property: Maximum score available. - * + * * @return the max value. */ public Integer max() { @@ -43,7 +47,7 @@ public Integer max() { /** * Get the current property: Current score. - * + * * @return the current value. */ public Double current() { @@ -53,7 +57,7 @@ public Double 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() { @@ -62,7 +66,7 @@ public Double percentage() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 01753634ece23..f667855532f8d 100644 --- 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 @@ -11,7 +11,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Information about the security control. */ +/** + * Information about the security control. + */ @Immutable public final class SecureScoreControlDefinitionItemInner extends ProxyResource { /* @@ -20,13 +22,15 @@ public final class SecureScoreControlDefinitionItemInner extends ProxyResource { @JsonProperty(value = "properties") private SecureScoreControlDefinitionItemProperties innerProperties; - /** Creates an instance of SecureScoreControlDefinitionItemInner class. */ + /** + * Creates an instance of SecureScoreControlDefinitionItemInner class. + */ public SecureScoreControlDefinitionItemInner() { } /** * Get the innerProperties property: Security Control Definition Properties. - * + * * @return the innerProperties value. */ private SecureScoreControlDefinitionItemProperties innerProperties() { @@ -35,7 +39,7 @@ private SecureScoreControlDefinitionItemProperties innerProperties() { /** * Get the displayName property: User friendly display name of the control. - * + * * @return the displayName value. */ public String displayName() { @@ -44,7 +48,7 @@ public String displayName() { /** * Get the description property: User friendly description of the control. - * + * * @return the description value. */ public String description() { @@ -53,7 +57,7 @@ public String description() { /** * Get the maxScore property: Maximum control score (0..10). - * + * * @return the maxScore value. */ public Integer maxScore() { @@ -62,7 +66,7 @@ public Integer maxScore() { /** * Get the source property: Source object from which the control was created. - * + * * @return the source value. */ public SecureScoreControlDefinitionSource source() { @@ -72,7 +76,7 @@ public SecureScoreControlDefinitionSource source() { /** * Get the assessmentDefinitions property: Array of assessments metadata IDs that are included in this security * control. - * + * * @return the assessmentDefinitions value. */ public List assessmentDefinitions() { @@ -81,7 +85,7 @@ public List assessmentDefinitions() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 85b8e148b797f..86186c34049b9 100644 --- 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 @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Security Control Definition Properties. */ +/** + * Security Control Definition Properties. + */ @Immutable public final class SecureScoreControlDefinitionItemProperties { /* @@ -43,13 +45,15 @@ public final class SecureScoreControlDefinitionItemProperties { @JsonProperty(value = "assessmentDefinitions", access = JsonProperty.Access.WRITE_ONLY) private List assessmentDefinitions; - /** Creates an instance of SecureScoreControlDefinitionItemProperties class. */ + /** + * Creates an instance of SecureScoreControlDefinitionItemProperties class. + */ public SecureScoreControlDefinitionItemProperties() { } /** * Get the displayName property: User friendly display name of the control. - * + * * @return the displayName value. */ public String displayName() { @@ -58,7 +62,7 @@ public String displayName() { /** * Get the description property: User friendly description of the control. - * + * * @return the description value. */ public String description() { @@ -67,7 +71,7 @@ public String description() { /** * Get the maxScore property: Maximum control score (0..10). - * + * * @return the maxScore value. */ public Integer maxScore() { @@ -76,7 +80,7 @@ public Integer maxScore() { /** * Get the source property: Source object from which the control was created. - * + * * @return the source value. */ public SecureScoreControlDefinitionSource source() { @@ -86,7 +90,7 @@ public SecureScoreControlDefinitionSource source() { /** * Get the assessmentDefinitions property: Array of assessments metadata IDs that are included in this security * control. - * + * * @return the assessmentDefinitions value. */ public List assessmentDefinitions() { @@ -95,7 +99,7 @@ public List assessmentDefinitions() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index bb6d92135d582..14ddcbb0eab4a 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.core.management.ProxyResource; import com.fasterxml.jackson.annotation.JsonProperty; -/** Details of the security control, its score, and the health status of the relevant resources. */ +/** + * Details of the security control, its score, and the health status of the relevant resources. + */ @Fluent public final class SecureScoreControlDetailsInner extends ProxyResource { /* @@ -17,13 +19,15 @@ public final class SecureScoreControlDetailsInner extends ProxyResource { @JsonProperty(value = "properties") private SecureScoreControlScoreDetailsInner innerProperties; - /** Creates an instance of SecureScoreControlDetailsInner class. */ + /** + * Creates an instance of SecureScoreControlDetailsInner class. + */ public SecureScoreControlDetailsInner() { } /** * Get the innerProperties property: Calculation result data in control level. - * + * * @return the innerProperties value. */ private SecureScoreControlScoreDetailsInner innerProperties() { @@ -32,7 +36,7 @@ private SecureScoreControlScoreDetailsInner innerProperties() { /** * Get the displayName property: User friendly display name of the control. - * + * * @return the displayName value. */ public String displayName() { @@ -41,7 +45,7 @@ public String displayName() { /** * Get the healthyResourceCount property: Number of healthy resources in the control. - * + * * @return the healthyResourceCount value. */ public Integer healthyResourceCount() { @@ -50,7 +54,7 @@ public Integer healthyResourceCount() { /** * Get the unhealthyResourceCount property: Number of unhealthy resources in the control. - * + * * @return the unhealthyResourceCount value. */ public Integer unhealthyResourceCount() { @@ -59,7 +63,7 @@ public Integer unhealthyResourceCount() { /** * Get the notApplicableResourceCount property: Number of not applicable resources in the control. - * + * * @return the notApplicableResourceCount value. */ public Integer notApplicableResourceCount() { @@ -69,7 +73,7 @@ public Integer 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() { @@ -78,7 +82,7 @@ public Long weight() { /** * Get the definition property: Information about the security control. - * + * * @return the definition value. */ public SecureScoreControlDefinitionItemInner definition() { @@ -87,7 +91,7 @@ public SecureScoreControlDefinitionItemInner definition() { /** * Set the definition property: Information about the security control. - * + * * @param definition the definition value to set. * @return the SecureScoreControlDetailsInner object itself. */ @@ -101,7 +105,7 @@ public SecureScoreControlDetailsInner withDefinition(SecureScoreControlDefinitio /** * Get the max property: Maximum score available. - * + * * @return the max value. */ public Integer max() { @@ -110,7 +114,7 @@ public Integer max() { /** * Get the current property: Current score. - * + * * @return the current value. */ public Double current() { @@ -120,7 +124,7 @@ public Double 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() { @@ -129,7 +133,7 @@ public Double percentage() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 2b4dc29cf1f47..af4f558bfa4d1 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Calculation result data in control level. */ +/** + * Calculation result data in control level. + */ @Fluent public final class SecureScoreControlScoreDetailsInner { /* @@ -53,13 +55,15 @@ public final class SecureScoreControlScoreDetailsInner { @JsonProperty(value = "definition") private SecureScoreControlDefinitionItemInner definition; - /** Creates an instance of SecureScoreControlScoreDetailsInner class. */ + /** + * Creates an instance of SecureScoreControlScoreDetailsInner class. + */ public SecureScoreControlScoreDetailsInner() { } /** * Get the displayName property: User friendly display name of the control. - * + * * @return the displayName value. */ public String displayName() { @@ -68,7 +72,7 @@ public String displayName() { /** * Get the innerScore property: Actual score object for the control. - * + * * @return the innerScore value. */ private ScoreDetails innerScore() { @@ -77,7 +81,7 @@ private ScoreDetails innerScore() { /** * Get the healthyResourceCount property: Number of healthy resources in the control. - * + * * @return the healthyResourceCount value. */ public Integer healthyResourceCount() { @@ -86,7 +90,7 @@ public Integer healthyResourceCount() { /** * Get the unhealthyResourceCount property: Number of unhealthy resources in the control. - * + * * @return the unhealthyResourceCount value. */ public Integer unhealthyResourceCount() { @@ -95,7 +99,7 @@ public Integer unhealthyResourceCount() { /** * Get the notApplicableResourceCount property: Number of not applicable resources in the control. - * + * * @return the notApplicableResourceCount value. */ public Integer notApplicableResourceCount() { @@ -105,7 +109,7 @@ public Integer 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() { @@ -114,7 +118,7 @@ public Long weight() { /** * Get the definition property: Information about the security control. - * + * * @return the definition value. */ public SecureScoreControlDefinitionItemInner definition() { @@ -123,7 +127,7 @@ public SecureScoreControlDefinitionItemInner definition() { /** * Set the definition property: Information about the security control. - * + * * @param definition the definition value to set. * @return the SecureScoreControlScoreDetailsInner object itself. */ @@ -134,7 +138,7 @@ public SecureScoreControlScoreDetailsInner withDefinition(SecureScoreControlDefi /** * Get the max property: Maximum score available. - * + * * @return the max value. */ public Integer max() { @@ -143,7 +147,7 @@ public Integer max() { /** * Get the current property: Current score. - * + * * @return the current value. */ public Double current() { @@ -153,7 +157,7 @@ public Double 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() { @@ -162,7 +166,7 @@ public Double percentage() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index c0a9ae5164559..92e59606bbe85 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.core.management.ProxyResource; import com.fasterxml.jackson.annotation.JsonProperty; -/** Secure score item data model. */ +/** + * Secure score item data model. + */ @Immutable public final class SecureScoreItemInner extends ProxyResource { /* @@ -17,13 +19,15 @@ public final class SecureScoreItemInner extends ProxyResource { @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) private SecureScoreItemProperties innerProperties; - /** Creates an instance of SecureScoreItemInner class. */ + /** + * Creates an instance of SecureScoreItemInner class. + */ public SecureScoreItemInner() { } /** * Get the innerProperties property: Secure score item. - * + * * @return the innerProperties value. */ private SecureScoreItemProperties innerProperties() { @@ -32,7 +36,7 @@ private SecureScoreItemProperties innerProperties() { /** * Get the displayName property: The initiative’s name. - * + * * @return the displayName value. */ public String displayName() { @@ -42,7 +46,7 @@ public String 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() { @@ -51,7 +55,7 @@ public Long weight() { /** * Get the max property: Maximum score available. - * + * * @return the max value. */ public Integer max() { @@ -60,7 +64,7 @@ public Integer max() { /** * Get the current property: Current score. - * + * * @return the current value. */ public Double current() { @@ -70,7 +74,7 @@ public Double 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() { @@ -79,7 +83,7 @@ public Double percentage() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 889361f4149e3..ea45787bafa58 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** Describes properties of a calculated secure score. */ +/** + * Describes properties of a calculated secure score. + */ @Immutable public final class SecureScoreItemProperties { /* @@ -29,13 +31,15 @@ public final class SecureScoreItemProperties { @JsonProperty(value = "weight", access = JsonProperty.Access.WRITE_ONLY) private Long weight; - /** Creates an instance of SecureScoreItemProperties class. */ + /** + * Creates an instance of SecureScoreItemProperties class. + */ public SecureScoreItemProperties() { } /** * Get the displayName property: The initiative’s name. - * + * * @return the displayName value. */ public String displayName() { @@ -44,7 +48,7 @@ public String displayName() { /** * Get the innerScore property: score object. - * + * * @return the innerScore value. */ private ScoreDetails innerScore() { @@ -54,7 +58,7 @@ private ScoreDetails 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() { @@ -63,7 +67,7 @@ public Long weight() { /** * Get the max property: Maximum score available. - * + * * @return the max value. */ public Integer max() { @@ -72,7 +76,7 @@ public Integer max() { /** * Get the current property: Current score. - * + * * @return the current value. */ public Double current() { @@ -82,7 +86,7 @@ public Double 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() { @@ -91,7 +95,7 @@ public Double percentage() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataProperties.java index d2452d561791e..5904ba31260b7 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataProperties.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataProperties.java @@ -16,7 +16,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Describes properties of an assessment metadata. */ +/** + * Describes properties of an assessment metadata. + */ @Fluent public class SecurityAssessmentMetadataProperties { /* @@ -92,13 +94,15 @@ public class SecurityAssessmentMetadataProperties { @JsonProperty(value = "partnerData") private SecurityAssessmentMetadataPartnerData partnerData; - /** Creates an instance of SecurityAssessmentMetadataProperties class. */ + /** + * Creates an instance of SecurityAssessmentMetadataProperties class. + */ public SecurityAssessmentMetadataProperties() { } /** * Get the displayName property: User friendly display name of the assessment. - * + * * @return the displayName value. */ public String displayName() { @@ -107,7 +111,7 @@ public String displayName() { /** * Set the displayName property: User friendly display name of the assessment. - * + * * @param displayName the displayName value to set. * @return the SecurityAssessmentMetadataProperties object itself. */ @@ -119,7 +123,7 @@ public SecurityAssessmentMetadataProperties withDisplayName(String displayName) /** * Get the policyDefinitionId property: Azure resource ID of the policy definition that turns this assessment * calculation on. - * + * * @return the policyDefinitionId value. */ public String policyDefinitionId() { @@ -128,7 +132,7 @@ public String policyDefinitionId() { /** * Get the description property: Human readable description of the assessment. - * + * * @return the description value. */ public String description() { @@ -137,7 +141,7 @@ public String description() { /** * Set the description property: Human readable description of the assessment. - * + * * @param description the description value to set. * @return the SecurityAssessmentMetadataProperties object itself. */ @@ -149,7 +153,7 @@ public SecurityAssessmentMetadataProperties withDescription(String description) /** * Get the remediationDescription property: Human readable description of what you should do to mitigate this * security issue. - * + * * @return the remediationDescription value. */ public String remediationDescription() { @@ -159,7 +163,7 @@ public String 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 SecurityAssessmentMetadataProperties object itself. */ @@ -170,7 +174,7 @@ public SecurityAssessmentMetadataProperties withRemediationDescription(String re /** * Get the categories property: The categories property. - * + * * @return the categories value. */ public List categories() { @@ -179,7 +183,7 @@ public List categories() { /** * Set the categories property: The categories property. - * + * * @param categories the categories value to set. * @return the SecurityAssessmentMetadataProperties object itself. */ @@ -190,7 +194,7 @@ public SecurityAssessmentMetadataProperties withCategories(List cate /** * Get the severity property: The severity level of the assessment. - * + * * @return the severity value. */ public Severity severity() { @@ -199,7 +203,7 @@ public Severity severity() { /** * Set the severity property: The severity level of the assessment. - * + * * @param severity the severity value to set. * @return the SecurityAssessmentMetadataProperties object itself. */ @@ -210,7 +214,7 @@ public SecurityAssessmentMetadataProperties withSeverity(Severity severity) { /** * Get the userImpact property: The user impact of the assessment. - * + * * @return the userImpact value. */ public UserImpact userImpact() { @@ -219,7 +223,7 @@ public UserImpact userImpact() { /** * Set the userImpact property: The user impact of the assessment. - * + * * @param userImpact the userImpact value to set. * @return the SecurityAssessmentMetadataProperties object itself. */ @@ -230,7 +234,7 @@ public SecurityAssessmentMetadataProperties withUserImpact(UserImpact userImpact /** * Get the implementationEffort property: The implementation effort required to remediate this assessment. - * + * * @return the implementationEffort value. */ public ImplementationEffort implementationEffort() { @@ -239,7 +243,7 @@ public ImplementationEffort implementationEffort() { /** * Set the implementationEffort property: The implementation effort required to remediate this assessment. - * + * * @param implementationEffort the implementationEffort value to set. * @return the SecurityAssessmentMetadataProperties object itself. */ @@ -250,7 +254,7 @@ public SecurityAssessmentMetadataProperties withImplementationEffort(Implementat /** * Get the threats property: The threats property. - * + * * @return the threats value. */ public List threats() { @@ -259,7 +263,7 @@ public List threats() { /** * Set the threats property: The threats property. - * + * * @param threats the threats value to set. * @return the SecurityAssessmentMetadataProperties object itself. */ @@ -270,7 +274,7 @@ public SecurityAssessmentMetadataProperties withThreats(List threats) { /** * Get the preview property: True if this assessment is in preview release status. - * + * * @return the preview value. */ public Boolean preview() { @@ -279,7 +283,7 @@ public Boolean preview() { /** * Set the preview property: True if this assessment is in preview release status. - * + * * @param preview the preview value to set. * @return the SecurityAssessmentMetadataProperties object itself. */ @@ -291,7 +295,7 @@ public SecurityAssessmentMetadataProperties withPreview(Boolean preview) { /** * 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() { @@ -301,7 +305,7 @@ public AssessmentType 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 SecurityAssessmentMetadataProperties object itself. */ @@ -312,7 +316,7 @@ public SecurityAssessmentMetadataProperties withAssessmentType(AssessmentType as /** * Get the partnerData property: Describes the partner that created the assessment. - * + * * @return the partnerData value. */ public SecurityAssessmentMetadataPartnerData partnerData() { @@ -321,7 +325,7 @@ public SecurityAssessmentMetadataPartnerData partnerData() { /** * Set the partnerData property: Describes the partner that created the assessment. - * + * * @param partnerData the partnerData value to set. * @return the SecurityAssessmentMetadataProperties object itself. */ @@ -332,27 +336,21 @@ public SecurityAssessmentMetadataProperties withPartnerData(SecurityAssessmentMe /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (displayName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property displayName in model SecurityAssessmentMetadataProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property displayName in model SecurityAssessmentMetadataProperties")); } if (severity() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property severity in model SecurityAssessmentMetadataProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property severity in model SecurityAssessmentMetadataProperties")); } if (assessmentType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property assessmentType in model SecurityAssessmentMetadataProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property assessmentType in model SecurityAssessmentMetadataProperties")); } if (partnerData() != null) { partnerData().validate(); 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 index eb080f0c54c3f..3d30e4db62099 100644 --- 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 @@ -18,7 +18,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Describes properties of an assessment metadata response. */ +/** + * Describes properties of an assessment metadata response. + */ @Fluent public final class SecurityAssessmentMetadataPropertiesResponse extends SecurityAssessmentMetadataProperties { /* @@ -45,13 +47,15 @@ public final class SecurityAssessmentMetadataPropertiesResponse extends Security @JsonProperty(value = "techniques") private List techniques; - /** Creates an instance of SecurityAssessmentMetadataPropertiesResponse class. */ + /** + * Creates an instance of SecurityAssessmentMetadataPropertiesResponse class. + */ public SecurityAssessmentMetadataPropertiesResponse() { } /** * Get the publishDates property: The publishDates property. - * + * * @return the publishDates value. */ public SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates() { @@ -60,19 +64,19 @@ public SecurityAssessmentMetadataPropertiesResponsePublishDates 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) { + public SecurityAssessmentMetadataPropertiesResponse + withPublishDates(SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates) { this.publishDates = publishDates; return this; } /** * Get the plannedDeprecationDate property: The plannedDeprecationDate property. - * + * * @return the plannedDeprecationDate value. */ public String plannedDeprecationDate() { @@ -81,7 +85,7 @@ public String plannedDeprecationDate() { /** * Set the plannedDeprecationDate property: The plannedDeprecationDate property. - * + * * @param plannedDeprecationDate the plannedDeprecationDate value to set. * @return the SecurityAssessmentMetadataPropertiesResponse object itself. */ @@ -92,7 +96,7 @@ public SecurityAssessmentMetadataPropertiesResponse withPlannedDeprecationDate(S /** * Get the tactics property: The tactics property. - * + * * @return the tactics value. */ public List tactics() { @@ -101,7 +105,7 @@ public List tactics() { /** * Set the tactics property: The tactics property. - * + * * @param tactics the tactics value to set. * @return the SecurityAssessmentMetadataPropertiesResponse object itself. */ @@ -112,7 +116,7 @@ public SecurityAssessmentMetadataPropertiesResponse withTactics(List ta /** * Get the techniques property: The techniques property. - * + * * @return the techniques value. */ public List techniques() { @@ -121,7 +125,7 @@ public List techniques() { /** * Set the techniques property: The techniques property. - * + * * @param techniques the techniques value to set. * @return the SecurityAssessmentMetadataPropertiesResponse object itself. */ @@ -130,88 +134,110 @@ public SecurityAssessmentMetadataPropertiesResponse withTechniques(List categories) { super.withCategories(categories); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SecurityAssessmentMetadataPropertiesResponse withSeverity(Severity severity) { super.withSeverity(severity); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SecurityAssessmentMetadataPropertiesResponse withUserImpact(UserImpact userImpact) { super.withUserImpact(userImpact); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override - public SecurityAssessmentMetadataPropertiesResponse withImplementationEffort( - ImplementationEffort implementationEffort) { + public SecurityAssessmentMetadataPropertiesResponse + withImplementationEffort(ImplementationEffort implementationEffort) { super.withImplementationEffort(implementationEffort); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SecurityAssessmentMetadataPropertiesResponse withThreats(List threats) { super.withThreats(threats); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SecurityAssessmentMetadataPropertiesResponse withPreview(Boolean preview) { super.withPreview(preview); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SecurityAssessmentMetadataPropertiesResponse withAssessmentType(AssessmentType assessmentType) { super.withAssessmentType(assessmentType); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override - public SecurityAssessmentMetadataPropertiesResponse withPartnerData( - SecurityAssessmentMetadataPartnerData partnerData) { + public SecurityAssessmentMetadataPropertiesResponse + withPartnerData(SecurityAssessmentMetadataPartnerData partnerData) { super.withPartnerData(partnerData); return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 1167a0a33df64..eb0cb48a1e91d 100644 --- 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 @@ -19,7 +19,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Security assessment metadata response. */ +/** + * Security assessment metadata response. + */ @Fluent public final class SecurityAssessmentMetadataResponseInner extends ProxyResource { /* @@ -28,13 +30,15 @@ public final class SecurityAssessmentMetadataResponseInner extends ProxyResource @JsonProperty(value = "properties") private SecurityAssessmentMetadataPropertiesResponse innerProperties; - /** Creates an instance of SecurityAssessmentMetadataResponseInner class. */ + /** + * 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() { @@ -43,7 +47,7 @@ private SecurityAssessmentMetadataPropertiesResponse innerProperties() { /** * Get the publishDates property: The publishDates property. - * + * * @return the publishDates value. */ public SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates() { @@ -52,12 +56,12 @@ public SecurityAssessmentMetadataPropertiesResponsePublishDates 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) { + public SecurityAssessmentMetadataResponseInner + withPublishDates(SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates) { if (this.innerProperties() == null) { this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); } @@ -67,7 +71,7 @@ public SecurityAssessmentMetadataResponseInner withPublishDates( /** * Get the plannedDeprecationDate property: The plannedDeprecationDate property. - * + * * @return the plannedDeprecationDate value. */ public String plannedDeprecationDate() { @@ -76,7 +80,7 @@ public String plannedDeprecationDate() { /** * Set the plannedDeprecationDate property: The plannedDeprecationDate property. - * + * * @param plannedDeprecationDate the plannedDeprecationDate value to set. * @return the SecurityAssessmentMetadataResponseInner object itself. */ @@ -90,7 +94,7 @@ public SecurityAssessmentMetadataResponseInner withPlannedDeprecationDate(String /** * Get the tactics property: The tactics property. - * + * * @return the tactics value. */ public List tactics() { @@ -99,7 +103,7 @@ public List tactics() { /** * Set the tactics property: The tactics property. - * + * * @param tactics the tactics value to set. * @return the SecurityAssessmentMetadataResponseInner object itself. */ @@ -113,7 +117,7 @@ public SecurityAssessmentMetadataResponseInner withTactics(List tactics /** * Get the techniques property: The techniques property. - * + * * @return the techniques value. */ public List techniques() { @@ -122,7 +126,7 @@ public List techniques() { /** * Set the techniques property: The techniques property. - * + * * @param techniques the techniques value to set. * @return the SecurityAssessmentMetadataResponseInner object itself. */ @@ -136,7 +140,7 @@ public SecurityAssessmentMetadataResponseInner withTechniques(List t /** * Get the displayName property: User friendly display name of the assessment. - * + * * @return the displayName value. */ public String displayName() { @@ -145,7 +149,7 @@ public String displayName() { /** * Set the displayName property: User friendly display name of the assessment. - * + * * @param displayName the displayName value to set. * @return the SecurityAssessmentMetadataResponseInner object itself. */ @@ -160,7 +164,7 @@ public SecurityAssessmentMetadataResponseInner withDisplayName(String displayNam /** * Get the policyDefinitionId property: Azure resource ID of the policy definition that turns this assessment * calculation on. - * + * * @return the policyDefinitionId value. */ public String policyDefinitionId() { @@ -169,7 +173,7 @@ public String policyDefinitionId() { /** * Get the description property: Human readable description of the assessment. - * + * * @return the description value. */ public String description() { @@ -178,7 +182,7 @@ public String description() { /** * Set the description property: Human readable description of the assessment. - * + * * @param description the description value to set. * @return the SecurityAssessmentMetadataResponseInner object itself. */ @@ -193,7 +197,7 @@ public SecurityAssessmentMetadataResponseInner withDescription(String descriptio /** * Get the remediationDescription property: Human readable description of what you should do to mitigate this * security issue. - * + * * @return the remediationDescription value. */ public String remediationDescription() { @@ -203,7 +207,7 @@ public String 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. */ @@ -217,7 +221,7 @@ public SecurityAssessmentMetadataResponseInner withRemediationDescription(String /** * Get the categories property: The categories property. - * + * * @return the categories value. */ public List categories() { @@ -226,7 +230,7 @@ public List categories() { /** * Set the categories property: The categories property. - * + * * @param categories the categories value to set. * @return the SecurityAssessmentMetadataResponseInner object itself. */ @@ -240,7 +244,7 @@ public SecurityAssessmentMetadataResponseInner withCategories(List c /** * Get the severity property: The severity level of the assessment. - * + * * @return the severity value. */ public Severity severity() { @@ -249,7 +253,7 @@ public Severity severity() { /** * Set the severity property: The severity level of the assessment. - * + * * @param severity the severity value to set. * @return the SecurityAssessmentMetadataResponseInner object itself. */ @@ -263,7 +267,7 @@ public SecurityAssessmentMetadataResponseInner withSeverity(Severity severity) { /** * Get the userImpact property: The user impact of the assessment. - * + * * @return the userImpact value. */ public UserImpact userImpact() { @@ -272,7 +276,7 @@ public UserImpact userImpact() { /** * Set the userImpact property: The user impact of the assessment. - * + * * @param userImpact the userImpact value to set. * @return the SecurityAssessmentMetadataResponseInner object itself. */ @@ -286,7 +290,7 @@ public SecurityAssessmentMetadataResponseInner withUserImpact(UserImpact userImp /** * Get the implementationEffort property: The implementation effort required to remediate this assessment. - * + * * @return the implementationEffort value. */ public ImplementationEffort implementationEffort() { @@ -295,7 +299,7 @@ public ImplementationEffort 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. */ @@ -309,7 +313,7 @@ public SecurityAssessmentMetadataResponseInner withImplementationEffort(Implemen /** * Get the threats property: The threats property. - * + * * @return the threats value. */ public List threats() { @@ -318,7 +322,7 @@ public List threats() { /** * Set the threats property: The threats property. - * + * * @param threats the threats value to set. * @return the SecurityAssessmentMetadataResponseInner object itself. */ @@ -332,7 +336,7 @@ public SecurityAssessmentMetadataResponseInner withThreats(List threats /** * Get the preview property: True if this assessment is in preview release status. - * + * * @return the preview value. */ public Boolean preview() { @@ -341,7 +345,7 @@ public Boolean 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. */ @@ -356,7 +360,7 @@ public SecurityAssessmentMetadataResponseInner withPreview(Boolean preview) { /** * 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() { @@ -366,7 +370,7 @@ public AssessmentType 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. */ @@ -380,7 +384,7 @@ public SecurityAssessmentMetadataResponseInner withAssessmentType(AssessmentType /** * Get the partnerData property: Describes the partner that created the assessment. - * + * * @return the partnerData value. */ public SecurityAssessmentMetadataPartnerData partnerData() { @@ -389,7 +393,7 @@ public SecurityAssessmentMetadataPartnerData partnerData() { /** * Set the partnerData property: Describes the partner that created the assessment. - * + * * @param partnerData the partnerData value to set. * @return the SecurityAssessmentMetadataResponseInner object itself. */ @@ -403,7 +407,7 @@ public SecurityAssessmentMetadataResponseInner withPartnerData(SecurityAssessmen /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index d5d7b67530e43..7c76f5f704f87 100644 --- 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 @@ -13,7 +13,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** Describes properties of an assessment. */ +/** + * Describes properties of an assessment. + */ @Fluent public final class SecurityAssessmentProperties extends SecurityAssessmentPropertiesBase { /* @@ -22,13 +24,15 @@ public final class SecurityAssessmentProperties extends SecurityAssessmentProper @JsonProperty(value = "status", required = true) private AssessmentStatus status; - /** Creates an instance of SecurityAssessmentProperties class. */ + /** + * Creates an instance of SecurityAssessmentProperties class. + */ public SecurityAssessmentProperties() { } /** * Get the status property: The result of the assessment. - * + * * @return the status value. */ public AssessmentStatus status() { @@ -37,7 +41,7 @@ public AssessmentStatus status() { /** * Set the status property: The result of the assessment. - * + * * @param status the status value to set. * @return the SecurityAssessmentProperties object itself. */ @@ -46,28 +50,36 @@ public SecurityAssessmentProperties withStatus(AssessmentStatus status) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SecurityAssessmentProperties withResourceDetails(ResourceDetails resourceDetails) { super.withResourceDetails(resourceDetails); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SecurityAssessmentProperties withAdditionalData(Map additionalData) { super.withAdditionalData(additionalData); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SecurityAssessmentProperties withMetadata(SecurityAssessmentMetadataProperties metadata) { super.withMetadata(metadata); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SecurityAssessmentProperties withPartnersData(SecurityAssessmentPartnerData partnersData) { super.withPartnersData(partnersData); @@ -76,17 +88,15 @@ public SecurityAssessmentProperties withPartnersData(SecurityAssessmentPartnerDa /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (status() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property status in model SecurityAssessmentProperties")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property status in model SecurityAssessmentProperties")); } else { status().validate(); } 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 index 9c4c6cdec8b2a..7847eb919414d 100644 --- 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 @@ -13,7 +13,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** Describes properties of an assessment. */ +/** + * Describes properties of an assessment. + */ @Fluent public final class SecurityAssessmentPropertiesResponse extends SecurityAssessmentPropertiesBase { /* @@ -22,13 +24,15 @@ public final class SecurityAssessmentPropertiesResponse extends SecurityAssessme @JsonProperty(value = "status", required = true) private AssessmentStatusResponse status; - /** Creates an instance of SecurityAssessmentPropertiesResponse class. */ + /** + * Creates an instance of SecurityAssessmentPropertiesResponse class. + */ public SecurityAssessmentPropertiesResponse() { } /** * Get the status property: The result of the assessment. - * + * * @return the status value. */ public AssessmentStatusResponse status() { @@ -37,7 +41,7 @@ public AssessmentStatusResponse status() { /** * Set the status property: The result of the assessment. - * + * * @param status the status value to set. * @return the SecurityAssessmentPropertiesResponse object itself. */ @@ -46,28 +50,36 @@ public SecurityAssessmentPropertiesResponse withStatus(AssessmentStatusResponse return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SecurityAssessmentPropertiesResponse withResourceDetails(ResourceDetails resourceDetails) { super.withResourceDetails(resourceDetails); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SecurityAssessmentPropertiesResponse withAdditionalData(Map additionalData) { super.withAdditionalData(additionalData); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SecurityAssessmentPropertiesResponse withMetadata(SecurityAssessmentMetadataProperties metadata) { super.withMetadata(metadata); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SecurityAssessmentPropertiesResponse withPartnersData(SecurityAssessmentPartnerData partnersData) { super.withPartnersData(partnersData); @@ -76,17 +88,15 @@ public SecurityAssessmentPropertiesResponse withPartnersData(SecurityAssessmentP /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (status() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property status in model SecurityAssessmentPropertiesResponse")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property status in model SecurityAssessmentPropertiesResponse")); } else { status().validate(); } 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 index f3579b78ef478..4400e64eb587a 100644 --- 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 @@ -13,7 +13,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** Security assessment on a resource - response format. */ +/** + * Security assessment on a resource - response format. + */ @Fluent public final class SecurityAssessmentResponseInner extends ProxyResource { /* @@ -22,13 +24,15 @@ public final class SecurityAssessmentResponseInner extends ProxyResource { @JsonProperty(value = "properties") private SecurityAssessmentPropertiesResponse innerProperties; - /** Creates an instance of SecurityAssessmentResponseInner class. */ + /** + * Creates an instance of SecurityAssessmentResponseInner class. + */ public SecurityAssessmentResponseInner() { } /** * Get the innerProperties property: Describes properties of an assessment. - * + * * @return the innerProperties value. */ private SecurityAssessmentPropertiesResponse innerProperties() { @@ -37,7 +41,7 @@ private SecurityAssessmentPropertiesResponse innerProperties() { /** * Get the status property: The result of the assessment. - * + * * @return the status value. */ public AssessmentStatusResponse status() { @@ -46,7 +50,7 @@ public AssessmentStatusResponse status() { /** * Set the status property: The result of the assessment. - * + * * @param status the status value to set. * @return the SecurityAssessmentResponseInner object itself. */ @@ -60,7 +64,7 @@ public SecurityAssessmentResponseInner withStatus(AssessmentStatusResponse statu /** * Get the resourceDetails property: Details of the resource that was assessed. - * + * * @return the resourceDetails value. */ public ResourceDetails resourceDetails() { @@ -69,7 +73,7 @@ public ResourceDetails resourceDetails() { /** * Set the resourceDetails property: Details of the resource that was assessed. - * + * * @param resourceDetails the resourceDetails value to set. * @return the SecurityAssessmentResponseInner object itself. */ @@ -83,7 +87,7 @@ public SecurityAssessmentResponseInner withResourceDetails(ResourceDetails resou /** * Get the displayName property: User friendly display name of the assessment. - * + * * @return the displayName value. */ public String displayName() { @@ -92,7 +96,7 @@ public String displayName() { /** * Get the additionalData property: Additional data regarding the assessment. - * + * * @return the additionalData value. */ public Map additionalData() { @@ -101,7 +105,7 @@ public Map additionalData() { /** * Set the additionalData property: Additional data regarding the assessment. - * + * * @param additionalData the additionalData value to set. * @return the SecurityAssessmentResponseInner object itself. */ @@ -115,7 +119,7 @@ public SecurityAssessmentResponseInner withAdditionalData(Map ad /** * Get the links property: Links relevant to the assessment. - * + * * @return the links value. */ public AssessmentLinks links() { @@ -124,7 +128,7 @@ public AssessmentLinks links() { /** * Get the metadata property: Describes properties of an assessment metadata. - * + * * @return the metadata value. */ public SecurityAssessmentMetadataProperties metadata() { @@ -133,7 +137,7 @@ public SecurityAssessmentMetadataProperties metadata() { /** * Set the metadata property: Describes properties of an assessment metadata. - * + * * @param metadata the metadata value to set. * @return the SecurityAssessmentResponseInner object itself. */ @@ -147,7 +151,7 @@ public SecurityAssessmentResponseInner withMetadata(SecurityAssessmentMetadataPr /** * Get the partnersData property: Data regarding 3rd party partner integration. - * + * * @return the partnersData value. */ public SecurityAssessmentPartnerData partnersData() { @@ -156,7 +160,7 @@ public SecurityAssessmentPartnerData partnersData() { /** * Set the partnersData property: Data regarding 3rd party partner integration. - * + * * @param partnersData the partnersData value to set. * @return the SecurityAssessmentResponseInner object itself. */ @@ -170,7 +174,7 @@ public SecurityAssessmentResponseInner withPartnersData(SecurityAssessmentPartne /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index a58a7ab73eb4f..3c61bfdcb3083 100644 --- 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 @@ -15,7 +15,9 @@ import java.util.List; import java.util.Map; -/** The security connector resource. */ +/** + * The security connector resource. + */ @Fluent public final class SecurityConnectorInner extends Resource { /* @@ -30,13 +32,15 @@ public final class SecurityConnectorInner extends Resource { @JsonProperty(value = "properties") private SecurityConnectorProperties innerProperties; - /** Creates an instance of SecurityConnectorInner class. */ + /** + * Creates an instance of SecurityConnectorInner class. + */ public SecurityConnectorInner() { } /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { @@ -45,21 +49,25 @@ public SystemData systemData() { /** * Get the innerProperties property: Security connector data. - * + * * @return the innerProperties value. */ private SecurityConnectorProperties innerProperties() { return this.innerProperties; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SecurityConnectorInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public SecurityConnectorInner withTags(Map tags) { super.withTags(tags); @@ -69,7 +77,7 @@ public SecurityConnectorInner withTags(Map tags) { /** * 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() { @@ -79,7 +87,7 @@ public String 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. */ @@ -94,7 +102,7 @@ public SecurityConnectorInner withHierarchyIdentifier(String hierarchyIdentifier /** * 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() { @@ -103,7 +111,7 @@ public OffsetDateTime hierarchyIdentifierTrialEndDate() { /** * Get the environmentName property: The multi cloud resource's cloud name. - * + * * @return the environmentName value. */ public CloudName environmentName() { @@ -112,7 +120,7 @@ public CloudName environmentName() { /** * Set the environmentName property: The multi cloud resource's cloud name. - * + * * @param environmentName the environmentName value to set. * @return the SecurityConnectorInner object itself. */ @@ -126,7 +134,7 @@ public SecurityConnectorInner withEnvironmentName(CloudName environmentName) { /** * Get the offerings property: A collection of offerings for the security connector. - * + * * @return the offerings value. */ public List offerings() { @@ -135,7 +143,7 @@ public List 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. */ @@ -149,7 +157,7 @@ public SecurityConnectorInner withOfferings(List offerings) { /** * Get the environmentData property: The security connector environment data. - * + * * @return the environmentData value. */ public EnvironmentData environmentData() { @@ -158,7 +166,7 @@ public EnvironmentData environmentData() { /** * Set the environmentData property: The security connector environment data. - * + * * @param environmentData the environmentData value to set. * @return the SecurityConnectorInner object itself. */ @@ -172,7 +180,7 @@ public SecurityConnectorInner withEnvironmentData(EnvironmentData environmentDat /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index df14a0076cf6b..914b410bbf871 100644 --- 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 @@ -12,7 +12,9 @@ import java.time.OffsetDateTime; import java.util.List; -/** A set of properties that defines the security connector configuration. */ +/** + * A set of properties that defines the security connector configuration. + */ @Fluent public final class SecurityConnectorProperties { /* @@ -47,14 +49,16 @@ public final class SecurityConnectorProperties { @JsonProperty(value = "environmentData") private EnvironmentData environmentData; - /** Creates an instance of SecurityConnectorProperties class. */ + /** + * 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() { @@ -64,7 +68,7 @@ public String 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. */ @@ -76,7 +80,7 @@ public SecurityConnectorProperties withHierarchyIdentifier(String hierarchyIdent /** * 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() { @@ -85,7 +89,7 @@ public OffsetDateTime hierarchyIdentifierTrialEndDate() { /** * Get the environmentName property: The multi cloud resource's cloud name. - * + * * @return the environmentName value. */ public CloudName environmentName() { @@ -94,7 +98,7 @@ public CloudName environmentName() { /** * Set the environmentName property: The multi cloud resource's cloud name. - * + * * @param environmentName the environmentName value to set. * @return the SecurityConnectorProperties object itself. */ @@ -105,7 +109,7 @@ public SecurityConnectorProperties withEnvironmentName(CloudName environmentName /** * Get the offerings property: A collection of offerings for the security connector. - * + * * @return the offerings value. */ public List offerings() { @@ -114,7 +118,7 @@ public List 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. */ @@ -125,7 +129,7 @@ public SecurityConnectorProperties withOfferings(List offerings) /** * Get the environmentData property: The security connector environment data. - * + * * @return the environmentData value. */ public EnvironmentData environmentData() { @@ -134,7 +138,7 @@ public EnvironmentData environmentData() { /** * Set the environmentData property: The security connector environment data. - * + * * @param environmentData the environmentData value to set. * @return the SecurityConnectorProperties object itself. */ @@ -145,7 +149,7 @@ public SecurityConnectorProperties withEnvironmentData(EnvironmentData environme /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 0606139e3bf25..c8e234311656e 100644 --- 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 @@ -6,11 +6,14 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesAlertNotifications; +import com.azure.resourcemanager.security.models.NotificationsSource; import com.azure.resourcemanager.security.models.SecurityContactPropertiesNotificationsByRole; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; -/** Contact details and configurations for notifications coming from Microsoft Defender for Cloud. */ +/** + * Contact details and configurations for notifications coming from Microsoft Defender for Cloud. + */ @Fluent public final class SecurityContactInner extends ProxyResource { /* @@ -19,13 +22,15 @@ public final class SecurityContactInner extends ProxyResource { @JsonProperty(value = "properties") private SecurityContactProperties innerProperties; - /** Creates an instance of SecurityContactInner class. */ + /** + * Creates an instance of SecurityContactInner class. + */ public SecurityContactInner() { } /** * Get the innerProperties property: Security contact data. - * + * * @return the innerProperties value. */ private SecurityContactProperties innerProperties() { @@ -35,7 +40,7 @@ private SecurityContactProperties innerProperties() { /** * 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() { @@ -45,7 +50,7 @@ public String 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. */ @@ -59,7 +64,7 @@ public SecurityContactInner withEmails(String emails) { /** * Get the phone property: The security contact's phone number. - * + * * @return the phone value. */ public String phone() { @@ -68,7 +73,7 @@ public String phone() { /** * Set the phone property: The security contact's phone number. - * + * * @param phone the phone value to set. * @return the SecurityContactInner object itself. */ @@ -81,32 +86,55 @@ public SecurityContactInner withPhone(String phone) { } /** - * Get the alertNotifications property: Defines whether to send email notifications about new security alerts. - * - * @return the alertNotifications value. + * 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 SecurityContactPropertiesAlertNotifications alertNotifications() { - return this.innerProperties() == null ? null : this.innerProperties().alertNotifications(); + public List notificationsSources() { + return this.innerProperties() == null ? null : this.innerProperties().notificationsSources(); } /** - * Set the alertNotifications property: Defines whether to send email notifications about new security alerts. - * - * @param alertNotifications the alertNotifications value to set. + * 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 withAlertNotifications(SecurityContactPropertiesAlertNotifications alertNotifications) { + public SecurityContactInner withNotificationsSources(List notificationsSources) { if (this.innerProperties() == null) { this.innerProperties = new SecurityContactProperties(); } - this.innerProperties().withAlertNotifications(alertNotifications); + 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() { @@ -116,12 +144,12 @@ public SecurityContactPropertiesNotificationsByRole 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) { + public SecurityContactInner + withNotificationsByRole(SecurityContactPropertiesNotificationsByRole notificationsByRole) { if (this.innerProperties() == null) { this.innerProperties = new SecurityContactProperties(); } @@ -131,7 +159,7 @@ public SecurityContactInner withNotificationsByRole( /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 34c16a792122a..068536412e208 100644 --- 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 @@ -5,11 +5,14 @@ package com.azure.resourcemanager.security.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesAlertNotifications; +import com.azure.resourcemanager.security.models.NotificationsSource; import com.azure.resourcemanager.security.models.SecurityContactPropertiesNotificationsByRole; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; -/** Describes security contact properties. */ +/** + * Describes security contact properties. + */ @Fluent public final class SecurityContactProperties { /* @@ -26,10 +29,16 @@ public final class SecurityContactProperties { private String phone; /* - * Defines whether to send email notifications about new security alerts + * Indicates whether the security contact is enabled. */ - @JsonProperty(value = "alertNotifications") - private SecurityContactPropertiesAlertNotifications alertNotifications; + @JsonProperty(value = "isEnabled") + private Boolean isEnabled; + + /* + * A collection of sources types which evaluate the email notification. + */ + @JsonProperty(value = "notificationsSources") + private List notificationsSources; /* * Defines whether to send email notifications from Microsoft Defender for Cloud to persons with specific RBAC @@ -38,14 +47,16 @@ public final class SecurityContactProperties { @JsonProperty(value = "notificationsByRole") private SecurityContactPropertiesNotificationsByRole notificationsByRole; - /** Creates an instance of SecurityContactProperties class. */ + /** + * 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() { @@ -55,7 +66,7 @@ public String 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. */ @@ -66,7 +77,7 @@ public SecurityContactProperties withEmails(String emails) { /** * Get the phone property: The security contact's phone number. - * + * * @return the phone value. */ public String phone() { @@ -75,7 +86,7 @@ public String phone() { /** * Set the phone property: The security contact's phone number. - * + * * @param phone the phone value to set. * @return the SecurityContactProperties object itself. */ @@ -85,30 +96,49 @@ public SecurityContactProperties withPhone(String phone) { } /** - * Get the alertNotifications property: Defines whether to send email notifications about new security alerts. - * - * @return the alertNotifications value. + * 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 SecurityContactPropertiesAlertNotifications alertNotifications() { - return this.alertNotifications; + public List notificationsSources() { + return this.notificationsSources; } /** - * Set the alertNotifications property: Defines whether to send email notifications about new security alerts. - * - * @param alertNotifications the alertNotifications value to set. + * 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 withAlertNotifications( - SecurityContactPropertiesAlertNotifications alertNotifications) { - this.alertNotifications = alertNotifications; + 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() { @@ -118,24 +148,24 @@ public SecurityContactPropertiesNotificationsByRole 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) { + 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 (alertNotifications() != null) { - alertNotifications().validate(); + if (notificationsSources() != null) { + notificationsSources().forEach(e -> e.validate()); } if (notificationsByRole() != null) { notificationsByRole().validate(); 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 index 74c332b17887d..f879cf9eb6b7e 100644 --- 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 @@ -9,7 +9,9 @@ import com.azure.resourcemanager.security.models.Identity; import com.fasterxml.jackson.annotation.JsonProperty; -/** Security operator under a given subscription and pricing. */ +/** + * Security operator under a given subscription and pricing. + */ @Fluent public final class SecurityOperatorInner extends ProxyResource { /* @@ -18,13 +20,15 @@ public final class SecurityOperatorInner extends ProxyResource { @JsonProperty(value = "identity") private Identity identity; - /** Creates an instance of SecurityOperatorInner class. */ + /** + * Creates an instance of SecurityOperatorInner class. + */ public SecurityOperatorInner() { } /** * Get the identity property: Identity for the resource. - * + * * @return the identity value. */ public Identity identity() { @@ -33,7 +37,7 @@ public Identity identity() { /** * Set the identity property: Identity for the resource. - * + * * @param identity the identity value to set. * @return the SecurityOperatorInner object itself. */ @@ -44,7 +48,7 @@ public SecurityOperatorInner withIdentity(Identity identity) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityOperatorListInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityOperatorListInner.java index de1c00d24b3b8..196d2f65dfd18 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityOperatorListInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityOperatorListInner.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of SecurityOperator response. */ +/** + * List of SecurityOperator response. + */ @Fluent public final class SecurityOperatorListInner { /* @@ -18,13 +20,15 @@ public final class SecurityOperatorListInner { @JsonProperty(value = "value", required = true) private List value; - /** Creates an instance of SecurityOperatorListInner class. */ + /** + * Creates an instance of SecurityOperatorListInner class. + */ public SecurityOperatorListInner() { } /** * Get the value property: List of SecurityOperator configurations. - * + * * @return the value value. */ public List value() { @@ -33,7 +37,7 @@ public List value() { /** * Set the value property: List of SecurityOperator configurations. - * + * * @param value the value value to set. * @return the SecurityOperatorListInner object itself. */ @@ -44,14 +48,13 @@ public SecurityOperatorListInner withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model SecurityOperatorListInner")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model SecurityOperatorListInner")); } else { value().forEach(e -> e.validate()); } 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 index 8428e621636df..062b8b0c2c1bd 100644 --- 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 @@ -10,7 +10,9 @@ import com.azure.resourcemanager.security.models.SecurityFamily; import com.fasterxml.jackson.annotation.JsonProperty; -/** The SecuritySolution model. */ +/** + * The SecuritySolution model. + */ @Fluent public final class SecuritySolutionInner extends ProxyResource { /* @@ -25,13 +27,15 @@ public final class SecuritySolutionInner extends ProxyResource { @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) private String location; - /** Creates an instance of SecuritySolutionInner class. */ + /** + * Creates an instance of SecuritySolutionInner class. + */ public SecuritySolutionInner() { } /** * Get the innerProperties property: The properties property. - * + * * @return the innerProperties value. */ private SecuritySolutionProperties innerProperties() { @@ -40,7 +44,7 @@ private SecuritySolutionProperties innerProperties() { /** * Get the location property: Location where the resource is stored. - * + * * @return the location value. */ public String location() { @@ -49,7 +53,7 @@ public String location() { /** * Get the securityFamily property: The security family of the security solution. - * + * * @return the securityFamily value. */ public SecurityFamily securityFamily() { @@ -58,7 +62,7 @@ public SecurityFamily securityFamily() { /** * Set the securityFamily property: The security family of the security solution. - * + * * @param securityFamily the securityFamily value to set. * @return the SecuritySolutionInner object itself. */ @@ -72,7 +76,7 @@ public SecuritySolutionInner withSecurityFamily(SecurityFamily securityFamily) { /** * Get the provisioningState property: The security family provisioning State. - * + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { @@ -81,7 +85,7 @@ public ProvisioningState provisioningState() { /** * Set the provisioningState property: The security family provisioning State. - * + * * @param provisioningState the provisioningState value to set. * @return the SecuritySolutionInner object itself. */ @@ -95,7 +99,7 @@ public SecuritySolutionInner withProvisioningState(ProvisioningState provisionin /** * Get the template property: The security solutions' template. - * + * * @return the template value. */ public String template() { @@ -104,7 +108,7 @@ public String template() { /** * Set the template property: The security solutions' template. - * + * * @param template the template value to set. * @return the SecuritySolutionInner object itself. */ @@ -118,7 +122,7 @@ public SecuritySolutionInner withTemplate(String template) { /** * Get the protectionStatus property: The security solutions' status. - * + * * @return the protectionStatus value. */ public String protectionStatus() { @@ -127,7 +131,7 @@ public String protectionStatus() { /** * Set the protectionStatus property: The security solutions' status. - * + * * @param protectionStatus the protectionStatus value to set. * @return the SecuritySolutionInner object itself. */ @@ -141,7 +145,7 @@ public SecuritySolutionInner withProtectionStatus(String protectionStatus) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index bc67143e9d6f4..6ade9eea2f7d5 100644 --- 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 @@ -10,7 +10,9 @@ import com.azure.resourcemanager.security.models.SecurityFamily; import com.fasterxml.jackson.annotation.JsonProperty; -/** The SecuritySolutionProperties model. */ +/** + * The SecuritySolutionProperties model. + */ @Fluent public final class SecuritySolutionProperties { /* @@ -37,13 +39,15 @@ public final class SecuritySolutionProperties { @JsonProperty(value = "protectionStatus", required = true) private String protectionStatus; - /** Creates an instance of SecuritySolutionProperties class. */ + /** + * Creates an instance of SecuritySolutionProperties class. + */ public SecuritySolutionProperties() { } /** * Get the securityFamily property: The security family of the security solution. - * + * * @return the securityFamily value. */ public SecurityFamily securityFamily() { @@ -52,7 +56,7 @@ public SecurityFamily securityFamily() { /** * Set the securityFamily property: The security family of the security solution. - * + * * @param securityFamily the securityFamily value to set. * @return the SecuritySolutionProperties object itself. */ @@ -63,7 +67,7 @@ public SecuritySolutionProperties withSecurityFamily(SecurityFamily securityFami /** * Get the provisioningState property: The security family provisioning State. - * + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { @@ -72,7 +76,7 @@ public ProvisioningState provisioningState() { /** * Set the provisioningState property: The security family provisioning State. - * + * * @param provisioningState the provisioningState value to set. * @return the SecuritySolutionProperties object itself. */ @@ -83,7 +87,7 @@ public SecuritySolutionProperties withProvisioningState(ProvisioningState provis /** * Get the template property: The security solutions' template. - * + * * @return the template value. */ public String template() { @@ -92,7 +96,7 @@ public String template() { /** * Set the template property: The security solutions' template. - * + * * @param template the template value to set. * @return the SecuritySolutionProperties object itself. */ @@ -103,7 +107,7 @@ public SecuritySolutionProperties withTemplate(String template) { /** * Get the protectionStatus property: The security solutions' status. - * + * * @return the protectionStatus value. */ public String protectionStatus() { @@ -112,7 +116,7 @@ public String protectionStatus() { /** * Set the protectionStatus property: The security solutions' status. - * + * * @param protectionStatus the protectionStatus value to set. * @return the SecuritySolutionProperties object itself. */ @@ -123,33 +127,25 @@ public SecuritySolutionProperties withProtectionStatus(String protectionStatus) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (securityFamily() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property securityFamily in model SecuritySolutionProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property securityFamily in model SecuritySolutionProperties")); } if (provisioningState() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property provisioningState in model SecuritySolutionProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property provisioningState in model SecuritySolutionProperties")); } if (template() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property template in model SecuritySolutionProperties")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property template in model SecuritySolutionProperties")); } if (protectionStatus() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property protectionStatus in model SecuritySolutionProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property protectionStatus in model SecuritySolutionProperties")); } } 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 index be2aebaf7be45..812ad1b2dbce7 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The SecuritySolutionsReferenceDataList model. */ +/** + * The SecuritySolutionsReferenceDataList model. + */ @Fluent public final class SecuritySolutionsReferenceDataListInner { /* @@ -18,13 +20,15 @@ public final class SecuritySolutionsReferenceDataListInner { @JsonProperty(value = "value") private List value; - /** Creates an instance of SecuritySolutionsReferenceDataListInner class. */ + /** + * Creates an instance of SecuritySolutionsReferenceDataListInner class. + */ public SecuritySolutionsReferenceDataListInner() { } /** * Get the value property: The value property. - * + * * @return the value value. */ public List value() { @@ -33,7 +37,7 @@ public List value() { /** * Set the value property: The value property. - * + * * @param value the value value to set. * @return the SecuritySolutionsReferenceDataListInner object itself. */ @@ -44,7 +48,7 @@ public SecuritySolutionsReferenceDataListInner withValue(List value; - /** Creates an instance of ServerVulnerabilityAssessmentsListInner class. */ + /** + * Creates an instance of ServerVulnerabilityAssessmentsListInner class. + */ public ServerVulnerabilityAssessmentsListInner() { } /** * Get the value property: The value property. - * + * * @return the value value. */ public List value() { @@ -32,7 +36,7 @@ public List value() { /** * Set the value property: The value property. - * + * * @param value the value value to set. * @return the ServerVulnerabilityAssessmentsListInner object itself. */ @@ -43,7 +47,7 @@ public ServerVulnerabilityAssessmentsListInner withValue(List topologyResources() { @@ -68,7 +72,7 @@ public List topologyResources() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index daa7e08a00259..f224815c47107 100644 --- 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 @@ -10,7 +10,9 @@ import java.time.OffsetDateTime; import java.util.List; -/** The TopologyResourceProperties model. */ +/** + * The TopologyResourceProperties model. + */ @Immutable public final class TopologyResourceProperties { /* @@ -25,13 +27,15 @@ public final class TopologyResourceProperties { @JsonProperty(value = "topologyResources", access = JsonProperty.Access.WRITE_ONLY) private List topologyResources; - /** Creates an instance of TopologyResourceProperties class. */ + /** + * Creates an instance of TopologyResourceProperties class. + */ public TopologyResourceProperties() { } /** * Get the calculatedDateTime property: The UTC time on which the topology was calculated. - * + * * @return the calculatedDateTime value. */ public OffsetDateTime calculatedDateTime() { @@ -40,7 +44,7 @@ public OffsetDateTime calculatedDateTime() { /** * Get the topologyResources property: Azure resources which are part of this topology resource. - * + * * @return the topologyResources value. */ public List topologyResources() { @@ -49,7 +53,7 @@ public List topologyResources() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index f2bf349d65c32..f8585aed96b89 100644 --- 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 @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Update Security Solution setting data. */ +/** + * Update Security Solution setting data. + */ @Fluent public final class UpdateIoTSecuritySolutionProperties { /* @@ -25,13 +27,15 @@ public final class UpdateIoTSecuritySolutionProperties { @JsonProperty(value = "recommendationsConfiguration") private List recommendationsConfiguration; - /** Creates an instance of UpdateIoTSecuritySolutionProperties class. */ + /** + * 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() { @@ -40,19 +44,19 @@ public UserDefinedResourcesProperties 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) { + 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() { @@ -61,19 +65,19 @@ public List 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) { + 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() { 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 index d6be77efcba1a..cc8dd71e1fbd5 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.core.management.ProxyResource; import com.fasterxml.jackson.annotation.JsonProperty; -/** Configures where to store the OMS agent data for workspaces under a scope. */ +/** + * Configures where to store the OMS agent data for workspaces under a scope. + */ @Fluent public final class WorkspaceSettingInner extends ProxyResource { /* @@ -17,13 +19,15 @@ public final class WorkspaceSettingInner extends ProxyResource { @JsonProperty(value = "properties") private WorkspaceSettingProperties innerProperties; - /** Creates an instance of WorkspaceSettingInner class. */ + /** + * Creates an instance of WorkspaceSettingInner class. + */ public WorkspaceSettingInner() { } /** * Get the innerProperties property: Workspace setting data. - * + * * @return the innerProperties value. */ private WorkspaceSettingProperties innerProperties() { @@ -32,7 +36,7 @@ private WorkspaceSettingProperties innerProperties() { /** * Get the workspaceId property: The full Azure ID of the workspace to save the data in. - * + * * @return the workspaceId value. */ public String workspaceId() { @@ -41,7 +45,7 @@ public String 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. */ @@ -54,9 +58,9 @@ public WorkspaceSettingInner withWorkspaceId(String workspaceId) { } /** - * 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. - * + * 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() { @@ -64,9 +68,9 @@ public String 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. - * + * 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. */ @@ -80,7 +84,7 @@ public WorkspaceSettingInner withScope(String scope) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 4b9e5b362af56..3a142a2ce6fe9 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** Workspace setting data. */ +/** + * Workspace setting data. + */ @Fluent public final class WorkspaceSettingProperties { /* @@ -24,13 +26,15 @@ public final class WorkspaceSettingProperties { @JsonProperty(value = "scope", required = true) private String scope; - /** Creates an instance of WorkspaceSettingProperties class. */ + /** + * 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() { @@ -39,7 +43,7 @@ public String 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. */ @@ -49,9 +53,9 @@ public WorkspaceSettingProperties withWorkspaceId(String workspaceId) { } /** - * 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. - * + * 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() { @@ -59,9 +63,9 @@ public String 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. - * + * 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. */ @@ -72,21 +76,17 @@ public WorkspaceSettingProperties withScope(String scope) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (workspaceId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property workspaceId in model WorkspaceSettingProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property workspaceId in model WorkspaceSettingProperties")); } if (scope() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property scope in model WorkspaceSettingProperties")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property scope in model WorkspaceSettingProperties")); } } 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 index c572ad42092cf..f1e5e652b0f2a 100644 --- 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 @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the inner data models for SecurityCenter. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * Package containing the inner data models for SecurityCenter. + * API spec for Microsoft.Security (Azure Security Center) 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 index e13426491bd08..3de5e22988091 100644 --- 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 @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the service clients for SecurityCenter. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * Package containing the service clients for SecurityCenter. + * API spec for Microsoft.Security (Azure Security Center) resource provider. */ package com.azure.resourcemanager.security.fluent; diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlGroupImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlGroupImpl.java index dac890dface45..d3f0626e89a5a 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlGroupImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlGroupImpl.java @@ -19,10 +19,8 @@ import java.util.Collections; import java.util.List; -public final class AdaptiveApplicationControlGroupImpl - implements AdaptiveApplicationControlGroup, - AdaptiveApplicationControlGroup.Definition, - AdaptiveApplicationControlGroup.Update { +public final class AdaptiveApplicationControlGroupImpl implements AdaptiveApplicationControlGroup, + AdaptiveApplicationControlGroup.Definition, AdaptiveApplicationControlGroup.Update { private AdaptiveApplicationControlGroupInner innerObject; private final com.azure.resourcemanager.security.SecurityManager serviceManager; @@ -116,27 +114,19 @@ public AdaptiveApplicationControlGroupImpl withExistingLocation(String ascLocati } public AdaptiveApplicationControlGroup create() { - this.innerObject = - serviceManager - .serviceClient() - .getAdaptiveApplicationControls() - .putWithResponse(ascLocation, groupName, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getAdaptiveApplicationControls() + .putWithResponse(ascLocation, groupName, this.innerModel(), Context.NONE).getValue(); return this; } public AdaptiveApplicationControlGroup create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getAdaptiveApplicationControls() - .putWithResponse(ascLocation, groupName, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getAdaptiveApplicationControls() + .putWithResponse(ascLocation, groupName, this.innerModel(), context).getValue(); return this; } - AdaptiveApplicationControlGroupImpl( - String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { + AdaptiveApplicationControlGroupImpl(String name, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = new AdaptiveApplicationControlGroupInner(); this.serviceManager = serviceManager; this.groupName = name; @@ -147,51 +137,34 @@ public AdaptiveApplicationControlGroupImpl update() { } public AdaptiveApplicationControlGroup apply() { - this.innerObject = - serviceManager - .serviceClient() - .getAdaptiveApplicationControls() - .putWithResponse(ascLocation, groupName, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getAdaptiveApplicationControls() + .putWithResponse(ascLocation, groupName, this.innerModel(), Context.NONE).getValue(); return this; } public AdaptiveApplicationControlGroup apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getAdaptiveApplicationControls() - .putWithResponse(ascLocation, groupName, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getAdaptiveApplicationControls() + .putWithResponse(ascLocation, groupName, this.innerModel(), context).getValue(); return this; } - AdaptiveApplicationControlGroupImpl( - AdaptiveApplicationControlGroupInner innerObject, + AdaptiveApplicationControlGroupImpl(AdaptiveApplicationControlGroupInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.ascLocation = Utils.getValueFromIdByName(innerObject.id(), "locations"); - this.groupName = Utils.getValueFromIdByName(innerObject.id(), "applicationWhitelistings"); + this.ascLocation = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "locations"); + this.groupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "applicationWhitelistings"); } public AdaptiveApplicationControlGroup refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getAdaptiveApplicationControls() - .getWithResponse(ascLocation, groupName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getAdaptiveApplicationControls() + .getWithResponse(ascLocation, groupName, Context.NONE).getValue(); return this; } public AdaptiveApplicationControlGroup refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getAdaptiveApplicationControls() - .getWithResponse(ascLocation, groupName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getAdaptiveApplicationControls() + .getWithResponse(ascLocation, groupName, context).getValue(); return this; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlGroupsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlGroupsImpl.java index ed7a53c75298f..346368a857814 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlGroupsImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlGroupsImpl.java @@ -17,8 +17,7 @@ public final class AdaptiveApplicationControlGroupsImpl implements AdaptiveAppli private final com.azure.resourcemanager.security.SecurityManager serviceManager; - AdaptiveApplicationControlGroupsImpl( - AdaptiveApplicationControlGroupsInner innerObject, + AdaptiveApplicationControlGroupsImpl(AdaptiveApplicationControlGroupsInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -27,12 +26,9 @@ public final class AdaptiveApplicationControlGroupsImpl implements AdaptiveAppli public List value() { List inner = this.innerModel().value(); if (inner != null) { - return Collections - .unmodifiableList( - inner - .stream() - .map(inner1 -> new AdaptiveApplicationControlGroupImpl(inner1, this.manager())) - .collect(Collectors.toList())); + return Collections.unmodifiableList( + inner.stream().map(inner1 -> new AdaptiveApplicationControlGroupImpl(inner1, this.manager())) + .collect(Collectors.toList())); } else { return Collections.emptyList(); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlsClientImpl.java index f5377cd34583c..fd7da17576c09 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlsClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlsClientImpl.java @@ -29,24 +29,28 @@ import com.azure.resourcemanager.security.fluent.models.AdaptiveApplicationControlGroupsInner; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in AdaptiveApplicationControlsClient. */ +/** + * An instance of this class provides access to all the operations defined in AdaptiveApplicationControlsClient. + */ public final class AdaptiveApplicationControlsClientImpl implements AdaptiveApplicationControlsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final AdaptiveApplicationControlsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityCenterImpl client; /** * Initializes an instance of AdaptiveApplicationControlsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ AdaptiveApplicationControlsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - AdaptiveApplicationControlsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(AdaptiveApplicationControlsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -57,109 +61,77 @@ public final class AdaptiveApplicationControlsClientImpl implements AdaptiveAppl @Host("{$host}") @ServiceInterface(name = "SecurityCenterAdapti") public interface AdaptiveApplicationControlsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/applicationWhitelistings") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, @QueryParam("includePathRecommendations") Boolean includePathRecommendations, - @QueryParam("summary") Boolean summary, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("summary") Boolean summary, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @PathParam("groupName") String groupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("ascLocation") String ascLocation, + @PathParam("groupName") String groupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> put( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @PathParam("groupName") String groupName, - @QueryParam("api-version") String apiVersion, + Mono> put(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("ascLocation") String ascLocation, + @PathParam("groupName") String groupName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") AdaptiveApplicationControlGroupInner body, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @PathParam("groupName") String groupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("ascLocation") String ascLocation, + @PathParam("groupName") String groupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); } /** * Gets a list of application control machine groups for the subscription. - * + * * @param includePathRecommendations Include the policy rules. * @param summary Return output in a summarized form. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of application control machine groups for the subscription along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - Boolean includePathRecommendations, Boolean summary) { + private Mono> + listWithResponseAsync(Boolean includePathRecommendations, Boolean summary) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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(), - this.client.getSubscriptionId(), - apiVersion, - includePathRecommendations, - summary, - accept, - context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, + includePathRecommendations, summary, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets a list of application control machine groups for the subscription. - * + * * @param includePathRecommendations Include the policy rules. * @param summary Return output in a summarized form. * @param context The context to associate with this operation. @@ -167,44 +139,33 @@ private Mono> listWithResponseAs * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of application control machine groups for the subscription along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - Boolean includePathRecommendations, Boolean summary, Context context) { + private Mono> + listWithResponseAsync(Boolean includePathRecommendations, Boolean summary, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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(), - this.client.getSubscriptionId(), - apiVersion, - includePathRecommendations, - summary, - accept, - context); + return service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, + includePathRecommendations, summary, accept, context); } /** * Gets a list of application control machine groups 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 application control machine groups for the subscription on successful completion of {@link - * Mono}. + * @return a list of application control machine groups for the subscription on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listAsync() { @@ -216,7 +177,7 @@ private Mono listAsync() { /** * Gets a list of application control machine groups for the subscription. - * + * * @param includePathRecommendations Include the policy rules. * @param summary Return output in a summarized form. * @param context The context to associate with this operation. @@ -226,14 +187,14 @@ private Mono listAsync() { * @return a list of application control machine groups for the subscription along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse( - Boolean includePathRecommendations, Boolean summary, Context context) { + public Response listWithResponse(Boolean includePathRecommendations, + Boolean summary, Context context) { return listWithResponseAsync(includePathRecommendations, summary, context).block(); } /** * Gets a list of application control machine groups 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 application control machine groups for the subscription. @@ -247,30 +208,26 @@ public AdaptiveApplicationControlGroupsInner list() { /** * Gets an application control VM/server group. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param groupName Name of an application control machine group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 application control VM/server group along with {@link Response} on successful completion of {@link - * Mono}. + * @return an application control VM/server group along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String ascLocation, String groupName) { + private Mono> getWithResponseAsync(String ascLocation, + String groupName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -281,47 +238,34 @@ private Mono> getWithResponseAsyn final String apiVersion = "2020-01-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - ascLocation, - groupName, - apiVersion, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), ascLocation, + groupName, apiVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets an application control VM/server group. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param groupName Name of an application control machine group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 application control VM/server group along with {@link Response} on successful completion of {@link - * Mono}. + * @return an application control VM/server group along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String ascLocation, String groupName, Context context) { + private Mono> getWithResponseAsync(String ascLocation, + String groupName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -332,22 +276,15 @@ private Mono> getWithResponseAsyn final String apiVersion = "2020-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - ascLocation, - groupName, - apiVersion, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), ascLocation, groupName, + apiVersion, accept, context); } /** * Gets an application control VM/server group. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param groupName Name of an application control machine group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -361,9 +298,9 @@ private Mono getAsync(String ascLocation, /** * Gets an application control VM/server group. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param groupName Name of an application control machine group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -372,16 +309,16 @@ private Mono getAsync(String ascLocation, * @return an application control VM/server group along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String ascLocation, String groupName, Context context) { + public Response getWithResponse(String ascLocation, String groupName, + Context context) { return getWithResponseAsync(ascLocation, groupName, context).block(); } /** * Gets an application control VM/server group. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param groupName Name of an application control machine group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -395,9 +332,9 @@ public AdaptiveApplicationControlGroupInner get(String ascLocation, String group /** * Update an application control machine group. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param groupName Name of an application control machine group. * @param body The body parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -406,19 +343,15 @@ public AdaptiveApplicationControlGroupInner get(String ascLocation, String group * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> putWithResponseAsync( - String ascLocation, String groupName, AdaptiveApplicationControlGroupInner body) { + private Mono> putWithResponseAsync(String ascLocation, + String groupName, AdaptiveApplicationControlGroupInner body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -434,26 +367,16 @@ private Mono> putWithResponseAsyn final String apiVersion = "2020-01-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .put( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - ascLocation, - groupName, - apiVersion, - body, - accept, - context)) + .withContext(context -> service.put(this.client.getEndpoint(), this.client.getSubscriptionId(), ascLocation, + groupName, apiVersion, body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update an application control machine group. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param groupName Name of an application control machine group. * @param body The body parameter. * @param context The context to associate with this operation. @@ -463,19 +386,15 @@ private Mono> putWithResponseAsyn * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> putWithResponseAsync( - String ascLocation, String groupName, AdaptiveApplicationControlGroupInner body, Context context) { + private Mono> putWithResponseAsync(String ascLocation, + String groupName, AdaptiveApplicationControlGroupInner body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -491,23 +410,15 @@ private Mono> putWithResponseAsyn final String apiVersion = "2020-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .put( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - ascLocation, - groupName, - apiVersion, - body, - accept, - context); + return service.put(this.client.getEndpoint(), this.client.getSubscriptionId(), ascLocation, groupName, + apiVersion, body, accept, context); } /** * Update an application control machine group. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param groupName Name of an application control machine group. * @param body The body parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -516,16 +427,16 @@ private Mono> putWithResponseAsyn * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono putAsync( - String ascLocation, String groupName, AdaptiveApplicationControlGroupInner body) { + private Mono putAsync(String ascLocation, String groupName, + AdaptiveApplicationControlGroupInner body) { return putWithResponseAsync(ascLocation, groupName, body).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Update an application control machine group. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param groupName Name of an application control machine group. * @param body The body parameter. * @param context The context to associate with this operation. @@ -535,16 +446,16 @@ private Mono putAsync( * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response putWithResponse( - String ascLocation, String groupName, AdaptiveApplicationControlGroupInner body, Context context) { + public Response putWithResponse(String ascLocation, String groupName, + AdaptiveApplicationControlGroupInner body, Context context) { return putWithResponseAsync(ascLocation, groupName, body, context).block(); } /** * Update an application control machine group. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param groupName Name of an application control machine group. * @param body The body parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -553,16 +464,16 @@ public Response putWithResponse( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AdaptiveApplicationControlGroupInner put( - String ascLocation, String groupName, AdaptiveApplicationControlGroupInner body) { + public AdaptiveApplicationControlGroupInner put(String ascLocation, String groupName, + AdaptiveApplicationControlGroupInner body) { return putWithResponse(ascLocation, groupName, body, Context.NONE).getValue(); } /** * Delete an application control machine group. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param groupName Name of an application control machine group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -572,16 +483,12 @@ public AdaptiveApplicationControlGroupInner put( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String ascLocation, String groupName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -592,25 +499,16 @@ private Mono> deleteWithResponseAsync(String ascLocation, String final String apiVersion = "2020-01-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - ascLocation, - groupName, - apiVersion, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + ascLocation, groupName, apiVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete an application control machine group. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param groupName Name of an application control machine group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -621,16 +519,12 @@ private Mono> deleteWithResponseAsync(String ascLocation, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String ascLocation, String groupName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -641,22 +535,15 @@ private Mono> deleteWithResponseAsync(String ascLocation, String final String apiVersion = "2020-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - ascLocation, - groupName, - apiVersion, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), ascLocation, groupName, + apiVersion, accept, context); } /** * Delete an application control machine group. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param groupName Name of an application control machine group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -670,9 +557,9 @@ private Mono deleteAsync(String ascLocation, String groupName) { /** * Delete an application control machine group. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param groupName Name of an application control machine group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -687,9 +574,9 @@ public Response deleteWithResponse(String ascLocation, String groupName, C /** * Delete an application control machine group. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param groupName Name of an application control machine group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlsImpl.java index df7f0426fc39a..624149443b067 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlsImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlsImpl.java @@ -22,22 +22,18 @@ public final class AdaptiveApplicationControlsImpl implements AdaptiveApplicatio private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public AdaptiveApplicationControlsImpl( - AdaptiveApplicationControlsClient innerClient, + public AdaptiveApplicationControlsImpl(AdaptiveApplicationControlsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response listWithResponse( - Boolean includePathRecommendations, Boolean summary, Context context) { - Response inner = - this.serviceClient().listWithResponse(includePathRecommendations, summary, context); + public Response listWithResponse(Boolean includePathRecommendations, + Boolean summary, Context context) { + Response inner + = this.serviceClient().listWithResponse(includePathRecommendations, summary, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new AdaptiveApplicationControlGroupsImpl(inner.getValue(), this.manager())); } else { return null; @@ -53,15 +49,12 @@ public AdaptiveApplicationControlGroups list() { } } - public Response getWithResponse( - String ascLocation, String groupName, Context context) { - Response inner = - this.serviceClient().getWithResponse(ascLocation, groupName, context); + public Response getWithResponse(String ascLocation, String groupName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(ascLocation, groupName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new AdaptiveApplicationControlGroupImpl(inner.getValue(), this.manager())); } else { return null; @@ -86,85 +79,57 @@ public void deleteByResourceGroup(String ascLocation, String groupName) { } public AdaptiveApplicationControlGroup getById(String id) { - String ascLocation = Utils.getValueFromIdByName(id, "locations"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); } - String groupName = Utils.getValueFromIdByName(id, "applicationWhitelistings"); + String groupName = ResourceManagerUtils.getValueFromIdByName(id, "applicationWhitelistings"); if (groupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'applicationWhitelistings'.", - id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'applicationWhitelistings'.", id))); } return this.getWithResponse(ascLocation, groupName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String ascLocation = Utils.getValueFromIdByName(id, "locations"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); } - String groupName = Utils.getValueFromIdByName(id, "applicationWhitelistings"); + String groupName = ResourceManagerUtils.getValueFromIdByName(id, "applicationWhitelistings"); if (groupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'applicationWhitelistings'.", - id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'applicationWhitelistings'.", id))); } return this.getWithResponse(ascLocation, groupName, context); } public void deleteById(String id) { - String ascLocation = Utils.getValueFromIdByName(id, "locations"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); } - String groupName = Utils.getValueFromIdByName(id, "applicationWhitelistings"); + String groupName = ResourceManagerUtils.getValueFromIdByName(id, "applicationWhitelistings"); if (groupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'applicationWhitelistings'.", - id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'applicationWhitelistings'.", id))); } this.deleteByResourceGroupWithResponse(ascLocation, groupName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { - String ascLocation = Utils.getValueFromIdByName(id, "locations"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); } - String groupName = Utils.getValueFromIdByName(id, "applicationWhitelistings"); + String groupName = ResourceManagerUtils.getValueFromIdByName(id, "applicationWhitelistings"); if (groupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'applicationWhitelistings'.", - id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'applicationWhitelistings'.", id))); } return this.deleteByResourceGroupWithResponse(ascLocation, groupName, context); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveNetworkHardeningImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveNetworkHardeningImpl.java index c07af0ebfddca..b2b9dd401a10d 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveNetworkHardeningImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveNetworkHardeningImpl.java @@ -17,8 +17,8 @@ public final class AdaptiveNetworkHardeningImpl implements AdaptiveNetworkHarden private final com.azure.resourcemanager.security.SecurityManager serviceManager; - AdaptiveNetworkHardeningImpl( - AdaptiveNetworkHardeningInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + AdaptiveNetworkHardeningImpl(AdaptiveNetworkHardeningInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveNetworkHardeningsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveNetworkHardeningsClientImpl.java index 923dc53de886f..0379942ede44b 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveNetworkHardeningsClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveNetworkHardeningsClientImpl.java @@ -38,24 +38,28 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in AdaptiveNetworkHardeningsClient. */ +/** + * An instance of this class provides access to all the operations defined in AdaptiveNetworkHardeningsClient. + */ public final class AdaptiveNetworkHardeningsClientImpl implements AdaptiveNetworkHardeningsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final AdaptiveNetworkHardeningsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityCenterImpl client; /** * Initializes an instance of AdaptiveNetworkHardeningsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ AdaptiveNetworkHardeningsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - AdaptiveNetworkHardeningsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(AdaptiveNetworkHardeningsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -66,97 +70,77 @@ public final class AdaptiveNetworkHardeningsClientImpl implements AdaptiveNetwor @Host("{$host}") @ServiceInterface(name = "SecurityCenterAdapti") public interface AdaptiveNetworkHardeningsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByExtendedResource( - @HostParam("$host") String endpoint, + Mono> listByExtendedResource(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceNamespace") String resourceNamespace, - @PathParam("resourceType") String resourceType, - @PathParam("resourceName") String resourceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceNamespace") String resourceNamespace, @PathParam("resourceType") String resourceType, + @PathParam("resourceName") String resourceName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceNamespace") String resourceNamespace, - @PathParam("resourceType") String resourceType, + @PathParam("resourceNamespace") String resourceNamespace, @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, @PathParam("adaptiveNetworkHardeningResourceName") String adaptiveNetworkHardeningResourceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}/{adaptiveNetworkHardeningEnforceAction}") - @ExpectedResponses({200, 202}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}/{adaptiveNetworkHardeningEnforceAction}") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> enforce( - @HostParam("$host") String endpoint, + Mono>> enforce(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceNamespace") String resourceNamespace, - @PathParam("resourceType") String resourceType, + @PathParam("resourceNamespace") String resourceNamespace, @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, @PathParam("adaptiveNetworkHardeningResourceName") String adaptiveNetworkHardeningResourceName, @PathParam("adaptiveNetworkHardeningEnforceAction") String adaptiveNetworkHardeningEnforceAction, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") AdaptiveNetworkHardeningEnforceRequest body, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByExtendedResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName 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 Adaptive Network Hardenings resources in scope of an extended resource along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return a list of Adaptive Network Hardenings resources in scope of an extended resource along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByExtendedResourceSinglePageAsync( 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -176,35 +160,18 @@ private Mono> listByExtendedResourc final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .listByExtendedResource( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + context -> service.listByExtendedResource(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, resourceNamespace, resourceType, resourceName, apiVersion, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -212,23 +179,19 @@ private Mono> listByExtendedResourc * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Adaptive Network Hardenings resources in scope of an extended resource along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return a list of Adaptive Network Hardenings resources in scope of an extended resource along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByExtendedResourceSinglePageAsync( 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -248,32 +211,17 @@ private Mono> listByExtendedResourc final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByExtendedResource( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByExtendedResource(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + resourceNamespace, resourceType, resourceName, apiVersion, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -281,22 +229,20 @@ private Mono> listByExtendedResourc * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of Adaptive Network Hardenings resources in scope of an extended resource as paginated response - * with {@link PagedFlux}. + * with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByExtendedResourceAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - return new PagedFlux<>( - () -> - listByExtendedResourceSinglePageAsync(resourceGroupName, resourceNamespace, resourceType, resourceName), - nextLink -> listByExtendedResourceNextSinglePageAsync(nextLink)); + private PagedFlux listByExtendedResourceAsync(String resourceGroupName, + String resourceNamespace, String resourceType, String resourceName) { + return new PagedFlux<>(() -> listByExtendedResourceSinglePageAsync(resourceGroupName, resourceNamespace, + resourceType, resourceName), nextLink -> listByExtendedResourceNextSinglePageAsync(nextLink)); } /** * Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -305,23 +251,21 @@ private PagedFlux listByExtendedResourceAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of Adaptive Network Hardenings resources in scope of an extended resource as paginated response - * with {@link PagedFlux}. + * with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByExtendedResourceAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - return new PagedFlux<>( - () -> - listByExtendedResourceSinglePageAsync( - resourceGroupName, resourceNamespace, resourceType, resourceName, context), + private PagedFlux listByExtendedResourceAsync(String resourceGroupName, + String resourceNamespace, String resourceType, String resourceName, Context context) { + return new PagedFlux<>(() -> listByExtendedResourceSinglePageAsync(resourceGroupName, resourceNamespace, + resourceType, resourceName, context), nextLink -> listByExtendedResourceNextSinglePageAsync(nextLink, context)); } /** * Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -329,20 +273,20 @@ private PagedFlux listByExtendedResourceAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of Adaptive Network Hardenings resources in scope of an extended resource as paginated response - * with {@link PagedIterable}. + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { + public PagedIterable listByExtendedResource(String resourceGroupName, + String resourceNamespace, String resourceType, String resourceName) { return new PagedIterable<>( listByExtendedResourceAsync(resourceGroupName, resourceNamespace, resourceType, resourceName)); } /** * Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -351,20 +295,20 @@ public PagedIterable listByExtendedResource( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of Adaptive Network Hardenings resources in scope of an extended resource as paginated response - * with {@link PagedIterable}. + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { + public PagedIterable listByExtendedResource(String resourceGroupName, + String resourceNamespace, String resourceType, String resourceName, Context context) { return new PagedIterable<>( listByExtendedResourceAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, context)); } /** * Gets a single Adaptive Network Hardening resource. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -373,26 +317,19 @@ public PagedIterable listByExtendedResource( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single Adaptive Network Hardening resource along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, + private Mono> getWithResponseAsync(String resourceGroupName, + String resourceNamespace, String resourceType, String resourceName, String adaptiveNetworkHardeningResourceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -409,36 +346,23 @@ private Mono> getWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } if (adaptiveNetworkHardeningResourceName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter adaptiveNetworkHardeningResourceName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter adaptiveNetworkHardeningResourceName 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(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - apiVersion, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, + apiVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets a single Adaptive Network Hardening resource. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -448,27 +372,19 @@ private Mono> getWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single Adaptive Network Hardening resource along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, + private Mono> getWithResponseAsync(String resourceGroupName, + String resourceNamespace, String resourceType, String resourceName, String adaptiveNetworkHardeningResourceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -485,33 +401,22 @@ private Mono> getWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } if (adaptiveNetworkHardeningResourceName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter adaptiveNetworkHardeningResourceName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter adaptiveNetworkHardeningResourceName 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(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - apiVersion, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, apiVersion, accept, + context); } /** * Gets a single Adaptive Network Hardening resource. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -522,22 +427,17 @@ private Mono> getWithResponseAsync( * @return a single Adaptive Network Hardening resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName) { - return getWithResponseAsync( - resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono getAsync(String resourceGroupName, String resourceNamespace, + String resourceType, String resourceName, String adaptiveNetworkHardeningResourceName) { + return getWithResponseAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, + adaptiveNetworkHardeningResourceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets a single Adaptive Network Hardening resource. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -549,28 +449,17 @@ private Mono getAsync( * @return a single Adaptive Network Hardening resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - Context context) { - return getWithResponseAsync( - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - context) - .block(); + public Response getWithResponse(String resourceGroupName, String resourceNamespace, + String resourceType, String resourceName, String adaptiveNetworkHardeningResourceName, Context context) { + return getWithResponseAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, + adaptiveNetworkHardeningResourceName, context).block(); } /** * Gets a single Adaptive Network Hardening resource. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -581,27 +470,17 @@ public Response getWithResponse( * @return a single Adaptive Network Hardening resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AdaptiveNetworkHardeningInner get( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName) { - return getWithResponse( - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - Context.NONE) - .getValue(); + public AdaptiveNetworkHardeningInner get(String resourceGroupName, String resourceNamespace, String resourceType, + String resourceName, String adaptiveNetworkHardeningResourceName) { + return getWithResponse(resourceGroupName, resourceNamespace, resourceType, resourceName, + adaptiveNetworkHardeningResourceName, Context.NONE).getValue(); } /** * Enforces the given rules on the NSG(s) listed in the request. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -613,24 +492,16 @@ public AdaptiveNetworkHardeningInner get( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> enforceWithResponseAsync( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, + private Mono>> enforceWithResponseAsync(String resourceGroupName, + String resourceNamespace, String resourceType, String resourceName, String adaptiveNetworkHardeningResourceName, AdaptiveNetworkHardeningEnforceRequest body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -647,10 +518,8 @@ private Mono>> enforceWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } if (adaptiveNetworkHardeningResourceName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter adaptiveNetworkHardeningResourceName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter adaptiveNetworkHardeningResourceName is required and cannot be null.")); } if (body == null) { return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); @@ -661,30 +530,17 @@ private Mono>> enforceWithResponseAsync( final String apiVersion = "2020-01-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .enforce( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - adaptiveNetworkHardeningEnforceAction, - apiVersion, - body, - accept, - context)) + .withContext(context -> service.enforce(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, + adaptiveNetworkHardeningEnforceAction, apiVersion, body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Enforces the given rules on the NSG(s) listed in the request. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -697,25 +553,16 @@ private Mono>> enforceWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> enforceWithResponseAsync( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body, - Context context) { + private Mono>> enforceWithResponseAsync(String resourceGroupName, + String resourceNamespace, String resourceType, String resourceName, String adaptiveNetworkHardeningResourceName, + AdaptiveNetworkHardeningEnforceRequest body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -732,10 +579,8 @@ private Mono>> enforceWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } if (adaptiveNetworkHardeningResourceName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter adaptiveNetworkHardeningResourceName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter adaptiveNetworkHardeningResourceName is required and cannot be null.")); } if (body == null) { return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); @@ -746,27 +591,16 @@ private Mono>> enforceWithResponseAsync( final String apiVersion = "2020-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .enforce( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - adaptiveNetworkHardeningEnforceAction, - apiVersion, - body, - accept, - context); + return service.enforce(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, + adaptiveNetworkHardeningEnforceAction, apiVersion, body, accept, context); } /** * Enforces the given rules on the NSG(s) listed in the request. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -778,32 +612,20 @@ private Mono>> enforceWithResponseAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginEnforceAsync( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, + private PollerFlux, Void> beginEnforceAsync(String resourceGroupName, String resourceNamespace, + String resourceType, String resourceName, String adaptiveNetworkHardeningResourceName, AdaptiveNetworkHardeningEnforceRequest body) { - Mono>> mono = - enforceWithResponseAsync( - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - body); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + Mono>> mono = enforceWithResponseAsync(resourceGroupName, resourceNamespace, + resourceType, resourceName, adaptiveNetworkHardeningResourceName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Enforces the given rules on the NSG(s) listed in the request. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -816,34 +638,21 @@ private PollerFlux, Void> beginEnforceAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginEnforceAsync( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body, - Context context) { + private PollerFlux, Void> beginEnforceAsync(String resourceGroupName, String resourceNamespace, + String resourceType, String resourceName, String adaptiveNetworkHardeningResourceName, + AdaptiveNetworkHardeningEnforceRequest body, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - enforceWithResponseAsync( - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - body, - context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono = enforceWithResponseAsync(resourceGroupName, resourceNamespace, + resourceType, resourceName, adaptiveNetworkHardeningResourceName, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Enforces the given rules on the NSG(s) listed in the request. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -855,29 +664,18 @@ private PollerFlux, Void> beginEnforceAsync( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginEnforce( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, + public SyncPoller, Void> beginEnforce(String resourceGroupName, String resourceNamespace, + String resourceType, String resourceName, String adaptiveNetworkHardeningResourceName, AdaptiveNetworkHardeningEnforceRequest body) { - return this - .beginEnforceAsync( - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - body) - .getSyncPoller(); + return this.beginEnforceAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, + adaptiveNetworkHardeningResourceName, body).getSyncPoller(); } /** * Enforces the given rules on the NSG(s) listed in the request. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -890,31 +688,18 @@ public SyncPoller, Void> beginEnforce( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginEnforce( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body, - Context context) { - return this - .beginEnforceAsync( - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - body, - context) - .getSyncPoller(); + public SyncPoller, Void> beginEnforce(String resourceGroupName, String resourceNamespace, + String resourceType, String resourceName, String adaptiveNetworkHardeningResourceName, + AdaptiveNetworkHardeningEnforceRequest body, Context context) { + return this.beginEnforceAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, + adaptiveNetworkHardeningResourceName, body, context).getSyncPoller(); } /** * Enforces the given rules on the NSG(s) listed in the request. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -926,29 +711,17 @@ public SyncPoller, Void> beginEnforce( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono enforceAsync( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body) { - return beginEnforceAsync( - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - body) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono enforceAsync(String resourceGroupName, String resourceNamespace, String resourceType, + String resourceName, String adaptiveNetworkHardeningResourceName, AdaptiveNetworkHardeningEnforceRequest body) { + return beginEnforceAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, + adaptiveNetworkHardeningResourceName, body).last().flatMap(this.client::getLroFinalResultOrError); } /** * Enforces the given rules on the NSG(s) listed in the request. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -961,31 +734,18 @@ private Mono enforceAsync( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono enforceAsync( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body, + private Mono enforceAsync(String resourceGroupName, String resourceNamespace, String resourceType, + String resourceName, String adaptiveNetworkHardeningResourceName, AdaptiveNetworkHardeningEnforceRequest body, Context context) { - return beginEnforceAsync( - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - body, - context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + return beginEnforceAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, + adaptiveNetworkHardeningResourceName, body, context).last().flatMap(this.client::getLroFinalResultOrError); } /** * Enforces the given rules on the NSG(s) listed in the request. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -996,28 +756,17 @@ private Mono enforceAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void enforce( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body) { - enforceAsync( - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - body) - .block(); + public void enforce(String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, + String adaptiveNetworkHardeningResourceName, AdaptiveNetworkHardeningEnforceRequest body) { + enforceAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, + adaptiveNetworkHardeningResourceName, body).block(); } /** * Enforces the given rules on the NSG(s) listed in the request. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -1029,100 +778,70 @@ public void enforce( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void enforce( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body, - Context context) { - enforceAsync( - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - body, - context) - .block(); + public void enforce(String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, + String adaptiveNetworkHardeningResourceName, AdaptiveNetworkHardeningEnforceRequest body, Context context) { + enforceAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, + adaptiveNetworkHardeningResourceName, body, context).block(); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 response for ListAdaptiveNetworkHardenings API service call along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByExtendedResourceNextSinglePageAsync( - String nextLink) { + private Mono> + listByExtendedResourceNextSinglePageAsync(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.")); + 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.listByExtendedResourceNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new 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 - *

The nextLink parameter. + * + * The nextLink 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 response for ListAdaptiveNetworkHardenings API service call along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByExtendedResourceNextSinglePageAsync( - String nextLink, Context context) { + private Mono> + listByExtendedResourceNextSinglePageAsync(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.")); + 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 - .listByExtendedResourceNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByExtendedResourceNext(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/AdaptiveNetworkHardeningsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveNetworkHardeningsImpl.java index afcb58db5f239..3d5efda8cf105 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveNetworkHardeningsImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveNetworkHardeningsImpl.java @@ -22,74 +22,42 @@ public final class AdaptiveNetworkHardeningsImpl implements AdaptiveNetworkHarde private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public AdaptiveNetworkHardeningsImpl( - AdaptiveNetworkHardeningsClient innerClient, + public AdaptiveNetworkHardeningsImpl(AdaptiveNetworkHardeningsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - PagedIterable inner = - this - .serviceClient() - .listByExtendedResource(resourceGroupName, resourceNamespace, resourceType, resourceName); - return Utils.mapPage(inner, inner1 -> new AdaptiveNetworkHardeningImpl(inner1, this.manager())); + public PagedIterable listByExtendedResource(String resourceGroupName, + String resourceNamespace, String resourceType, String resourceName) { + PagedIterable inner = this.serviceClient() + .listByExtendedResource(resourceGroupName, resourceNamespace, resourceType, resourceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AdaptiveNetworkHardeningImpl(inner1, this.manager())); } - public PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - PagedIterable inner = - this - .serviceClient() - .listByExtendedResource(resourceGroupName, resourceNamespace, resourceType, resourceName, context); - return Utils.mapPage(inner, inner1 -> new AdaptiveNetworkHardeningImpl(inner1, this.manager())); + public PagedIterable listByExtendedResource(String resourceGroupName, + String resourceNamespace, String resourceType, String resourceName, Context context) { + PagedIterable inner = this.serviceClient() + .listByExtendedResource(resourceGroupName, resourceNamespace, resourceType, resourceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AdaptiveNetworkHardeningImpl(inner1, this.manager())); } - public Response getWithResponse( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - Context context) { - Response inner = - this - .serviceClient() - .getWithResponse( - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - context); + public Response getWithResponse(String resourceGroupName, String resourceNamespace, + String resourceType, String resourceName, String adaptiveNetworkHardeningResourceName, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceGroupName, + resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new AdaptiveNetworkHardeningImpl(inner.getValue(), this.manager())); } else { return null; } } - public AdaptiveNetworkHardening get( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName) { - AdaptiveNetworkHardeningInner inner = - this - .serviceClient() - .get( - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName); + public AdaptiveNetworkHardening get(String resourceGroupName, String resourceNamespace, String resourceType, + String resourceName, String adaptiveNetworkHardeningResourceName) { + AdaptiveNetworkHardeningInner inner = this.serviceClient().get(resourceGroupName, resourceNamespace, + resourceType, resourceName, adaptiveNetworkHardeningResourceName); if (inner != null) { return new AdaptiveNetworkHardeningImpl(inner, this.manager()); } else { @@ -97,42 +65,16 @@ public AdaptiveNetworkHardening get( } } - public void enforce( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body) { - this - .serviceClient() - .enforce( - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - body); + public void enforce(String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, + String adaptiveNetworkHardeningResourceName, AdaptiveNetworkHardeningEnforceRequest body) { + this.serviceClient().enforce(resourceGroupName, resourceNamespace, resourceType, resourceName, + adaptiveNetworkHardeningResourceName, body); } - public void enforce( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body, - Context context) { - this - .serviceClient() - .enforce( - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - body, - context); + public void enforce(String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, + String adaptiveNetworkHardeningResourceName, AdaptiveNetworkHardeningEnforceRequest body, Context context) { + this.serviceClient().enforce(resourceGroupName, resourceNamespace, resourceType, resourceName, + adaptiveNetworkHardeningResourceName, body, context); } private AdaptiveNetworkHardeningsClient serviceClient() { 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 index 42c6609f6803d..320725dcb85b4 100644 --- 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 @@ -14,8 +14,7 @@ public final class AdvancedThreatProtectionSettingImpl private final com.azure.resourcemanager.security.SecurityManager serviceManager; - AdvancedThreatProtectionSettingImpl( - AdvancedThreatProtectionSettingInner innerObject, + AdvancedThreatProtectionSettingImpl(AdvancedThreatProtectionSettingInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -53,22 +52,14 @@ public AdvancedThreatProtectionSettingImpl withExistingResourceId(String resourc } public AdvancedThreatProtectionSetting create() { - this.innerObject = - serviceManager - .serviceClient() - .getAdvancedThreatProtections() - .createWithResponse(resourceId, this.innerModel(), Context.NONE) - .getValue(); + 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(); + this.innerObject = serviceManager.serviceClient().getAdvancedThreatProtections() + .createWithResponse(resourceId, this.innerModel(), context).getValue(); return this; } @@ -78,22 +69,14 @@ public AdvancedThreatProtectionSetting create(Context context) { } public AdvancedThreatProtectionSetting refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getAdvancedThreatProtections() - .getWithResponse(resourceId, Context.NONE) - .getValue(); + 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(); + this.innerObject = serviceManager.serviceClient().getAdvancedThreatProtections() + .getWithResponse(resourceId, context).getValue(); 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 index 1efa34e343b03..d9251b4a74748 100644 --- 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 @@ -27,24 +27,28 @@ 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. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final AdvancedThreatProtectionsService service; - /** The service client containing this operation class. */ + /** + * 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.service = RestProxy.create(AdvancedThreatProtectionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -55,49 +59,42 @@ public final class AdvancedThreatProtectionsClientImpl implements AdvancedThreat @Host("{$host}") @ServiceInterface(name = "SecurityCenterAdvanc") public interface AdvancedThreatProtectionsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("settingName") String settingName, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("settingName") String settingName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Put("/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, + Mono> create(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam(value = "resourceId", encoded = true) String resourceId, @PathParam("settingName") String settingName, @BodyParam("application/json") AdvancedThreatProtectionSettingInner advancedThreatProtectionSetting, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); } /** * Gets the Advanced Threat Protection settings for the specified resource. - * + * * @param resourceId The 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}. + * 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.")); + 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.")); @@ -113,23 +110,21 @@ private Mono> getWithResponseAsyn /** * Gets the Advanced Threat Protection settings for the specified resource. - * + * * @param resourceId The 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}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceId, Context context) { + 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.")); + 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.")); @@ -143,13 +138,13 @@ private Mono> getWithResponseAsyn /** * Gets the Advanced Threat Protection settings for the specified resource. - * + * * @param resourceId The 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}. + * @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) { @@ -158,7 +153,7 @@ private Mono getAsync(String resourceId) { /** * Gets the Advanced Threat Protection settings for the specified resource. - * + * * @param resourceId The identifier of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -173,7 +168,7 @@ public Response getWithResponse(String res /** * Gets the Advanced Threat Protection settings for the specified resource. - * + * * @param resourceId The identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -187,32 +182,28 @@ public AdvancedThreatProtectionSettingInner get(String resourceId) { /** * Creates or updates the Advanced Threat Protection settings on a specified resource. - * + * * @param resourceId The 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}. + * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter advancedThreatProtectionSetting is required and cannot be null.")); } else { advancedThreatProtectionSetting.validate(); } @@ -220,49 +211,36 @@ private Mono> createWithResponseA final String settingName = "current"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - apiVersion, - resourceId, - settingName, - advancedThreatProtectionSetting, - accept, - context)) + .withContext(context -> service.create(this.client.getEndpoint(), apiVersion, resourceId, settingName, + advancedThreatProtectionSetting, accept, 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 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}. + * @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) { + 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.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter advancedThreatProtectionSetting is required and cannot be null.")); } else { advancedThreatProtectionSetting.validate(); } @@ -270,20 +248,13 @@ private Mono> createWithResponseA final String settingName = "current"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - apiVersion, - resourceId, - settingName, - advancedThreatProtectionSetting, - accept, - context); + return service.create(this.client.getEndpoint(), apiVersion, resourceId, settingName, + advancedThreatProtectionSetting, accept, context); } /** * Creates or updates the Advanced Threat Protection settings on a specified resource. - * + * * @param resourceId The identifier of the resource. * @param advancedThreatProtectionSetting Advanced Threat Protection Settings. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -292,15 +263,15 @@ private Mono> createWithResponseA * @return the Advanced Threat Protection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceId, AdvancedThreatProtectionSettingInner advancedThreatProtectionSetting) { + 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 identifier of the resource. * @param advancedThreatProtectionSetting Advanced Threat Protection Settings. * @param context The context to associate with this operation. @@ -310,14 +281,14 @@ private Mono createAsync( * @return the Advanced Threat Protection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceId, AdvancedThreatProtectionSettingInner advancedThreatProtectionSetting, Context context) { + 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 identifier of the resource. * @param advancedThreatProtectionSetting Advanced Threat Protection Settings. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -326,8 +297,8 @@ public Response createWithResponse( * @return the Advanced Threat Protection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AdvancedThreatProtectionSettingInner create( - String resourceId, AdvancedThreatProtectionSettingInner advancedThreatProtectionSetting) { + 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 index 90cde665e7882..f16d95c1fbe21 100644 --- 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 @@ -20,21 +20,17 @@ public final class AdvancedThreatProtectionsImpl implements AdvancedThreatProtec private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public AdvancedThreatProtectionsImpl( - AdvancedThreatProtectionsClient innerClient, + 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); + Response inner + = this.serviceClient().getWithResponse(resourceId, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new AdvancedThreatProtectionSettingImpl(inner.getValue(), this.manager())); } else { return null; @@ -51,33 +47,21 @@ public AdvancedThreatProtectionSetting get(String resourceId) { } public AdvancedThreatProtectionSetting getById(String id) { - String resourceId = - Utils - .getValueFromIdByParameterName( - id, - "/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}", - "resourceId"); + 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))); + 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 = - Utils - .getValueFromIdByParameterName( - id, - "/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}", - "resourceId"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); } return this.getWithResponse(resourceId, context); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsClientImpl.java index f24350eb7d52c..3aabd1ad5c278 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsClientImpl.java @@ -38,17 +38,23 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in AlertsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final AlertsService service; - /** The service client containing this operation class. */ + /** + * 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) { @@ -63,257 +69,175 @@ public final class AlertsClientImpl implements AlertsClient { @Host("{$host}") @ServiceInterface(name = "SecurityCenterAlerts") public interface AlertsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/alerts") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/alerts") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @HeaderParam("Accept") String accept, + Mono> listByResourceGroup(@HostParam("$host") 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"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSubscriptionLevelByRegion( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @HeaderParam("Accept") String accept, - Context context); + Mono> listSubscriptionLevelByRegion(@HostParam("$host") 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listResourceGroupLevelByRegion( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @PathParam("resourceGroupName") String resourceGroupName, - @HeaderParam("Accept") String accept, - Context context); + Mono> listResourceGroupLevelByRegion(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("ascLocation") String ascLocation, @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getSubscriptionLevel( - @HostParam("$host") 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}") - @ExpectedResponses({200}) + Mono> getSubscriptionLevel(@HostParam("$host") 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getResourceGroupLevel( - @HostParam("$host") 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"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss") - @ExpectedResponses({204}) + Mono> getResourceGroupLevel(@HostParam("$host") 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" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss") + @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateSubscriptionLevelStateToDismiss( - @HostParam("$host") 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"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve") - @ExpectedResponses({204}) + Mono> updateSubscriptionLevelStateToDismiss(@HostParam("$host") 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" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve") + @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateSubscriptionLevelStateToResolve( - @HostParam("$host") 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"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate") - @ExpectedResponses({204}) + Mono> updateSubscriptionLevelStateToResolve(@HostParam("$host") 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" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate") + @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateSubscriptionLevelStateToActivate( - @HostParam("$host") 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"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/inProgress") - @ExpectedResponses({204}) + Mono> updateSubscriptionLevelStateToActivate(@HostParam("$host") 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" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/inProgress") + @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateSubscriptionLevelStateToInProgress( - @HostParam("$host") 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"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve") - @ExpectedResponses({204}) + Mono> updateSubscriptionLevelStateToInProgress(@HostParam("$host") 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" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve") + @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateResourceGroupLevelStateToResolve( - @HostParam("$host") 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"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss") - @ExpectedResponses({204}) + Mono> updateResourceGroupLevelStateToResolve(@HostParam("$host") 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" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss") + @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateResourceGroupLevelStateToDismiss( - @HostParam("$host") 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"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate") - @ExpectedResponses({204}) + Mono> updateResourceGroupLevelStateToDismiss(@HostParam("$host") 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" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate") + @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateResourceGroupLevelStateToActivate( - @HostParam("$host") 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"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/inProgress") - @ExpectedResponses({204}) + Mono> updateResourceGroupLevelStateToActivate(@HostParam("$host") 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" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/inProgress") + @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateResourceGroupLevelStateToInProgress( - @HostParam("$host") 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"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate") - @ExpectedResponses({202}) + Mono> updateResourceGroupLevelStateToInProgress(@HostParam("$host") 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" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate") + @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> simulate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> simulate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("ascLocation") String ascLocation, @BodyParam("application/json") AlertSimulatorRequestBody alertSimulatorRequestBody, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listSubscriptionLevelByRegionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listResourceGroupLevelByRegionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context 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 along with {@link PagedResponse} on successful completion of {@link Mono}. @@ -321,39 +245,26 @@ Mono> listResourceGroupLevelByRegionNext( @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)) + .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. @@ -363,36 +274,24 @@ private Mono> listSinglePageAsync() { @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)); + 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}. @@ -404,7 +303,7 @@ private PagedFlux 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. @@ -413,13 +312,13 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, 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}. @@ -431,7 +330,7 @@ public 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 ManagementException thrown if the request is rejected by server. @@ -445,9 +344,9 @@ public PagedIterable list(Context context) { /** * List all the alerts that are associated with the resource group. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -456,16 +355,12 @@ public PagedIterable list(Context context) { @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -474,33 +369,18 @@ private Mono> listByResourceGroupSinglePageAsync(Strin 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)) + .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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -508,19 +388,15 @@ private Mono> listByResourceGroupSinglePageAsync(Strin * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -530,29 +406,17 @@ private Mono> listByResourceGroupSinglePageAsync( 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)); + .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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -560,16 +424,15 @@ private Mono> listByResourceGroupSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -578,16 +441,15 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupName) */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -600,9 +462,9 @@ public PagedIterable listByResourceGroup(String resourceGroupName) { /** * List all the alerts that are associated with the resource group. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -616,9 +478,9 @@ public PagedIterable listByResourceGroup(String resourceGroupName, C /** * 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. + * 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. @@ -627,16 +489,12 @@ public PagedIterable listByResourceGroup(String resourceGroupName, C @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -644,33 +502,18 @@ private Mono> listSubscriptionLevelByRegionSinglePageA 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)) + .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. + * 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. @@ -678,19 +521,15 @@ private Mono> listSubscriptionLevelByRegionSinglePageA * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -699,24 +538,17 @@ private Mono> listSubscriptionLevelByRegionSinglePageA 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)); + .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. + * 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. @@ -724,16 +556,15 @@ private Mono> listSubscriptionLevelByRegionSinglePageA */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listSubscriptionLevelByRegionAsync(String ascLocation) { - return new PagedFlux<>( - () -> listSubscriptionLevelByRegionSinglePageAsync(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. + * 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. @@ -742,16 +573,15 @@ private PagedFlux listSubscriptionLevelByRegionAsync(String ascLocat */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listSubscriptionLevelByRegionAsync(String ascLocation, Context context) { - return new PagedFlux<>( - () -> listSubscriptionLevelByRegionSinglePageAsync(ascLocation, 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. + * 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. @@ -764,9 +594,9 @@ public PagedIterable listSubscriptionLevelByRegion(String ascLocatio /** * 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. + * 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. @@ -780,30 +610,26 @@ public PagedIterable listSubscriptionLevelByRegion(String ascLocatio /** * 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. + * locations. * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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) { + private Mono> listResourceGroupLevelByRegionSinglePageAsync(String ascLocation, + String resourceGroupName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -815,36 +641,20 @@ private Mono> listResourceGroupLevelByRegionSinglePage final String apiVersion = "2022-01-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listResourceGroupLevelByRegion( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - resourceGroupName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listResourceGroupLevelByRegion(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), ascLocation, 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 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. + * locations. * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -852,19 +662,15 @@ private Mono> listResourceGroupLevelByRegionSinglePage * @return list of security alerts along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listResourceGroupLevelByRegionSinglePageAsync( - String ascLocation, String resourceGroupName, Context context) { + private Mono> listResourceGroupLevelByRegionSinglePageAsync(String ascLocation, + String resourceGroupName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -877,32 +683,19 @@ private Mono> listResourceGroupLevelByRegionSinglePage final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listResourceGroupLevelByRegion( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - resourceGroupName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listResourceGroupLevelByRegion(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + ascLocation, 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 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. + * locations. * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -910,18 +703,17 @@ private Mono> listResourceGroupLevelByRegionSinglePage */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listResourceGroupLevelByRegionAsync(String ascLocation, String resourceGroupName) { - return new PagedFlux<>( - () -> listResourceGroupLevelByRegionSinglePageAsync(ascLocation, 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. + * locations. * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -929,8 +721,8 @@ private PagedFlux listResourceGroupLevelByRegionAsync(String ascLoca * @return list of security alerts as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listResourceGroupLevelByRegionAsync( - String ascLocation, String resourceGroupName, Context context) { + private PagedFlux listResourceGroupLevelByRegionAsync(String ascLocation, String resourceGroupName, + Context context) { return new PagedFlux<>( () -> listResourceGroupLevelByRegionSinglePageAsync(ascLocation, resourceGroupName, context), nextLink -> listResourceGroupLevelByRegionNextSinglePageAsync(nextLink, context)); @@ -938,11 +730,11 @@ private PagedFlux listResourceGroupLevelByRegionAsync( /** * 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. + * locations. * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -955,11 +747,11 @@ public PagedIterable listResourceGroupLevelByRegion(String ascLocati /** * 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. + * locations. * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -967,36 +759,32 @@ public PagedIterable listResourceGroupLevelByRegion(String ascLocati * @return list of security alerts as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listResourceGroupLevelByRegion( - String ascLocation, String resourceGroupName, Context context) { + public PagedIterable listResourceGroupLevelByRegion(String ascLocation, String resourceGroupName, + Context context) { return new PagedIterable<>(listResourceGroupLevelByRegionAsync(ascLocation, resourceGroupName, 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. + * 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}. + * {@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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -1007,47 +795,34 @@ private Mono> getSubscriptionLevelWithResponseAsync(String 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)) + .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. + * 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSubscriptionLevelWithResponseAsync( - String ascLocation, String alertName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -1058,22 +833,15 @@ private Mono> getSubscriptionLevelWithResponseAsync( 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); + 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. + * 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. @@ -1088,9 +856,9 @@ private Mono getSubscriptionLevelAsync(String ascLocation, String al /** * 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. + * 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. @@ -1099,16 +867,16 @@ private Mono getSubscriptionLevelAsync(String ascLocation, String al * @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) { + 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. + * 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. @@ -1122,32 +890,28 @@ public AlertInner getSubscriptionLevel(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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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}. + * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1162,50 +926,36 @@ private Mono> getResourceGroupLevelWithResponseAsync( 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)) + .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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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}. + * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1220,67 +970,59 @@ private Mono> getResourceGroupLevelWithResponseAsync( 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); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getResourceGroupLevelAsync( - String resourceGroupName, String ascLocation, String alertName) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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}. + * @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) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1294,9 +1036,9 @@ public AlertInner getResourceGroupLevel(String resourceGroupName, String ascLoca /** * Update the alert's state. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1304,19 +1046,15 @@ public AlertInner getResourceGroupLevel(String resourceGroupName, String ascLoca * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSubscriptionLevelStateToDismissWithResponseAsync( - String ascLocation, String alertName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -1327,25 +1065,16 @@ private Mono> updateSubscriptionLevelStateToDismissWithResponseAs final String apiVersion = "2022-01-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .updateSubscriptionLevelStateToDismiss( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - alertName, - accept, - context)) + .withContext(context -> service.updateSubscriptionLevelStateToDismiss(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), ascLocation, alertName, accept, 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. + * 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. @@ -1354,19 +1083,15 @@ private Mono> updateSubscriptionLevelStateToDismissWithResponseAs * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSubscriptionLevelStateToDismissWithResponseAsync( - String ascLocation, String alertName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -1377,22 +1102,15 @@ private Mono> updateSubscriptionLevelStateToDismissWithResponseAs final String apiVersion = "2022-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .updateSubscriptionLevelStateToDismiss( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - alertName, - accept, - context); + return service.updateSubscriptionLevelStateToDismiss(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), ascLocation, alertName, accept, context); } /** * Update the alert's state. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1407,9 +1125,9 @@ private Mono updateSubscriptionLevelStateToDismissAsync(String ascLocation /** * Update the alert's state. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1418,16 +1136,16 @@ private Mono updateSubscriptionLevelStateToDismissAsync(String ascLocation * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateSubscriptionLevelStateToDismissWithResponse( - String ascLocation, String alertName, Context context) { + 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. + * 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. @@ -1440,9 +1158,9 @@ public void updateSubscriptionLevelStateToDismiss(String ascLocation, String ale /** * Update the alert's state. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1450,19 +1168,15 @@ public void updateSubscriptionLevelStateToDismiss(String ascLocation, String ale * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSubscriptionLevelStateToResolveWithResponseAsync( - String ascLocation, String alertName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -1473,25 +1187,16 @@ private Mono> updateSubscriptionLevelStateToResolveWithResponseAs final String apiVersion = "2022-01-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .updateSubscriptionLevelStateToResolve( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - alertName, - accept, - context)) + .withContext(context -> service.updateSubscriptionLevelStateToResolve(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), ascLocation, alertName, accept, 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. + * 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. @@ -1500,19 +1205,15 @@ private Mono> updateSubscriptionLevelStateToResolveWithResponseAs * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSubscriptionLevelStateToResolveWithResponseAsync( - String ascLocation, String alertName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -1523,22 +1224,15 @@ private Mono> updateSubscriptionLevelStateToResolveWithResponseAs final String apiVersion = "2022-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .updateSubscriptionLevelStateToResolve( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - alertName, - accept, - context); + return service.updateSubscriptionLevelStateToResolve(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), ascLocation, alertName, accept, context); } /** * Update the alert's state. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1553,9 +1247,9 @@ private Mono updateSubscriptionLevelStateToResolveAsync(String ascLocation /** * Update the alert's state. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1564,16 +1258,16 @@ private Mono updateSubscriptionLevelStateToResolveAsync(String ascLocation * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateSubscriptionLevelStateToResolveWithResponse( - String ascLocation, String alertName, Context context) { + 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. + * 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. @@ -1586,9 +1280,9 @@ public void updateSubscriptionLevelStateToResolve(String ascLocation, String ale /** * Update the alert's state. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1596,19 +1290,15 @@ public void updateSubscriptionLevelStateToResolve(String ascLocation, String ale * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSubscriptionLevelStateToActivateWithResponseAsync( - String ascLocation, String alertName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -1619,25 +1309,16 @@ private Mono> updateSubscriptionLevelStateToActivateWithResponseA final String apiVersion = "2022-01-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .updateSubscriptionLevelStateToActivate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - alertName, - accept, - context)) + .withContext(context -> service.updateSubscriptionLevelStateToActivate(this.client.getEndpoint(), + apiVersion, this.client.getSubscriptionId(), ascLocation, alertName, accept, 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. + * 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. @@ -1646,19 +1327,15 @@ private Mono> updateSubscriptionLevelStateToActivateWithResponseA * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSubscriptionLevelStateToActivateWithResponseAsync( - String ascLocation, String alertName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -1669,22 +1346,15 @@ private Mono> updateSubscriptionLevelStateToActivateWithResponseA final String apiVersion = "2022-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .updateSubscriptionLevelStateToActivate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - alertName, - accept, - context); + return service.updateSubscriptionLevelStateToActivate(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), ascLocation, alertName, accept, context); } /** * Update the alert's state. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1699,9 +1369,9 @@ private Mono updateSubscriptionLevelStateToActivateAsync(String ascLocatio /** * Update the alert's state. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1710,16 +1380,16 @@ private Mono updateSubscriptionLevelStateToActivateAsync(String ascLocatio * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateSubscriptionLevelStateToActivateWithResponse( - String ascLocation, String alertName, Context context) { + 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. + * 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. @@ -1732,9 +1402,9 @@ public void updateSubscriptionLevelStateToActivate(String ascLocation, String al /** * Update the alert's state. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1742,19 +1412,15 @@ public void updateSubscriptionLevelStateToActivate(String ascLocation, String al * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSubscriptionLevelStateToInProgressWithResponseAsync( - String ascLocation, String alertName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -1765,25 +1431,16 @@ private Mono> updateSubscriptionLevelStateToInProgressWithRespons final String apiVersion = "2022-01-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .updateSubscriptionLevelStateToInProgress( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - alertName, - accept, - context)) + .withContext(context -> service.updateSubscriptionLevelStateToInProgress(this.client.getEndpoint(), + apiVersion, this.client.getSubscriptionId(), ascLocation, alertName, accept, 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. + * 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. @@ -1792,19 +1449,15 @@ private Mono> updateSubscriptionLevelStateToInProgressWithRespons * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSubscriptionLevelStateToInProgressWithResponseAsync( - String ascLocation, String alertName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -1815,22 +1468,15 @@ private Mono> updateSubscriptionLevelStateToInProgressWithRespons final String apiVersion = "2022-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .updateSubscriptionLevelStateToInProgress( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - alertName, - accept, - context); + return service.updateSubscriptionLevelStateToInProgress(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), ascLocation, alertName, accept, context); } /** * Update the alert's state. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1845,9 +1491,9 @@ private Mono updateSubscriptionLevelStateToInProgressAsync(String ascLocat /** * Update the alert's state. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1856,16 +1502,16 @@ private Mono updateSubscriptionLevelStateToInProgressAsync(String ascLocat * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateSubscriptionLevelStateToInProgressWithResponse( - String ascLocation, String alertName, Context context) { + 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. + * 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. @@ -1878,11 +1524,11 @@ public void updateSubscriptionLevelStateToInProgress(String ascLocation, String /** * Update the alert's state. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1890,19 +1536,15 @@ public void updateSubscriptionLevelStateToInProgress(String ascLocation, String * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateResourceGroupLevelStateToResolveWithResponseAsync( - String resourceGroupName, String ascLocation, String alertName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1918,27 +1560,18 @@ private Mono> updateResourceGroupLevelStateToResolveWithResponseA final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .updateResourceGroupLevelStateToResolve( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - alertName, - accept, - context)) + context -> service.updateResourceGroupLevelStateToResolve(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, ascLocation, alertName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update the alert's state. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1947,19 +1580,15 @@ private Mono> updateResourceGroupLevelStateToResolveWithResponseA * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1974,25 +1603,17 @@ private Mono> updateResourceGroupLevelStateToResolveWithResponseA final String apiVersion = "2022-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .updateResourceGroupLevelStateToResolve( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - alertName, - accept, - context); + return service.updateResourceGroupLevelStateToResolve(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, ascLocation, alertName, accept, context); } /** * Update the alert's state. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -2000,19 +1621,19 @@ private Mono> updateResourceGroupLevelStateToResolveWithResponseA * @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) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -2021,20 +1642,19 @@ private Mono updateResourceGroupLevelStateToResolveAsync( * @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(); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -2047,11 +1667,11 @@ public void updateResourceGroupLevelStateToResolve(String resourceGroupName, Str /** * Update the alert's state. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -2059,19 +1679,15 @@ public void updateResourceGroupLevelStateToResolve(String resourceGroupName, Str * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateResourceGroupLevelStateToDismissWithResponseAsync( - String resourceGroupName, String ascLocation, String alertName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2087,27 +1703,18 @@ private Mono> updateResourceGroupLevelStateToDismissWithResponseA final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .updateResourceGroupLevelStateToDismiss( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - alertName, - accept, - context)) + context -> service.updateResourceGroupLevelStateToDismiss(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, ascLocation, alertName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update the alert's state. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -2116,19 +1723,15 @@ private Mono> updateResourceGroupLevelStateToDismissWithResponseA * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2143,25 +1746,17 @@ private Mono> updateResourceGroupLevelStateToDismissWithResponseA final String apiVersion = "2022-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .updateResourceGroupLevelStateToDismiss( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - alertName, - accept, - context); + return service.updateResourceGroupLevelStateToDismiss(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, ascLocation, alertName, accept, context); } /** * Update the alert's state. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -2169,19 +1764,19 @@ private Mono> updateResourceGroupLevelStateToDismissWithResponseA * @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) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -2190,20 +1785,19 @@ private Mono updateResourceGroupLevelStateToDismissAsync( * @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(); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -2216,11 +1810,11 @@ public void updateResourceGroupLevelStateToDismiss(String resourceGroupName, Str /** * Update the alert's state. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -2228,19 +1822,15 @@ public void updateResourceGroupLevelStateToDismiss(String resourceGroupName, Str * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateResourceGroupLevelStateToActivateWithResponseAsync( - String resourceGroupName, String ascLocation, String alertName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2256,27 +1846,18 @@ private Mono> updateResourceGroupLevelStateToActivateWithResponse final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .updateResourceGroupLevelStateToActivate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - alertName, - accept, - context)) + context -> service.updateResourceGroupLevelStateToActivate(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, ascLocation, alertName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update the alert's state. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -2285,19 +1866,15 @@ private Mono> updateResourceGroupLevelStateToActivateWithResponse * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2312,25 +1889,17 @@ private Mono> updateResourceGroupLevelStateToActivateWithResponse final String apiVersion = "2022-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .updateResourceGroupLevelStateToActivate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - alertName, - accept, - context); + return service.updateResourceGroupLevelStateToActivate(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, ascLocation, alertName, accept, context); } /** * Update the alert's state. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -2338,19 +1907,19 @@ private Mono> updateResourceGroupLevelStateToActivateWithResponse * @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) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -2359,38 +1928,37 @@ private Mono updateResourceGroupLevelStateToActivateAsync( * @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(); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -2398,19 +1966,15 @@ public void updateResourceGroupLevelStateToActivate( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateResourceGroupLevelStateToInProgressWithResponseAsync( - String resourceGroupName, String ascLocation, String alertName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2426,27 +1990,18 @@ private Mono> updateResourceGroupLevelStateToInProgressWithRespon final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .updateResourceGroupLevelStateToInProgress( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - alertName, - accept, - context)) + context -> service.updateResourceGroupLevelStateToInProgress(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, ascLocation, alertName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update the alert's state. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -2455,19 +2010,15 @@ private Mono> updateResourceGroupLevelStateToInProgressWithRespon * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2482,25 +2033,17 @@ private Mono> updateResourceGroupLevelStateToInProgressWithRespon final String apiVersion = "2022-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .updateResourceGroupLevelStateToInProgress( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - alertName, - accept, - context); + return service.updateResourceGroupLevelStateToInProgress(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, ascLocation, alertName, accept, context); } /** * Update the alert's state. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -2508,19 +2051,19 @@ private Mono> updateResourceGroupLevelStateToInProgressWithRespon * @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) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -2529,36 +2072,35 @@ private Mono updateResourceGroupLevelStateToInProgressAsync( * @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(); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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) { + public void updateResourceGroupLevelStateToInProgress(String resourceGroupName, String ascLocation, + String alertName) { updateResourceGroupLevelStateToInProgressWithResponse(resourceGroupName, ascLocation, alertName, Context.NONE); } /** * Simulate security alerts. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param alertSimulatorRequestBody Alert Simulator Request Properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2566,53 +2108,38 @@ public void updateResourceGroupLevelStateToInProgress( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> simulateWithResponseAsync( - String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); + return Mono.error( + new IllegalArgumentException("Parameter alertSimulatorRequestBody is required and cannot be null.")); } else { alertSimulatorRequestBody.validate(); } final String apiVersion = "2022-01-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .simulate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - alertSimulatorRequestBody, - accept, - context)) + .withContext(context -> service.simulate(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), ascLocation, alertSimulatorRequestBody, accept, 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. + * locations. * @param alertSimulatorRequestBody Alert Simulator Request Properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2621,50 +2148,37 @@ private Mono>> simulateWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> simulateWithResponseAsync( - String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); + return Mono.error( + new IllegalArgumentException("Parameter alertSimulatorRequestBody is required and cannot be null.")); } else { alertSimulatorRequestBody.validate(); } final String apiVersion = "2022-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .simulate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - alertSimulatorRequestBody, - accept, - context); + return service.simulate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), ascLocation, + alertSimulatorRequestBody, accept, context); } /** * Simulate security alerts. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param alertSimulatorRequestBody Alert Simulator Request Properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2672,20 +2186,18 @@ private Mono>> simulateWithResponseAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginSimulateAsync( - String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody) { + 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()); + 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. + * locations. * @param alertSimulatorRequestBody Alert Simulator Request Properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2694,21 +2206,20 @@ private PollerFlux, Void> beginSimulateAsync( * @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) { + 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); + 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. + * locations. * @param alertSimulatorRequestBody Alert Simulator Request Properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2716,16 +2227,16 @@ private PollerFlux, Void> beginSimulateAsync( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginSimulate( - String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody) { + 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. + * locations. * @param alertSimulatorRequestBody Alert Simulator Request Properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2734,16 +2245,16 @@ public SyncPoller, Void> beginSimulate( * @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) { + 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. + * locations. * @param alertSimulatorRequestBody Alert Simulator Request Properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2752,16 +2263,15 @@ public SyncPoller, Void> beginSimulate( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono simulateAsync(String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody) { - return beginSimulateAsync(ascLocation, alertSimulatorRequestBody) - .last() + 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. + * locations. * @param alertSimulatorRequestBody Alert Simulator Request Properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2770,18 +2280,17 @@ private Mono simulateAsync(String ascLocation, AlertSimulatorRequestBody a * @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() + 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. + * locations. * @param alertSimulatorRequestBody Alert Simulator Request Properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2794,9 +2303,9 @@ public void simulate(String ascLocation, AlertSimulatorRequestBody alertSimulato /** * Simulate security alerts. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param alertSimulatorRequestBody Alert Simulator Request Properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2810,9 +2319,10 @@ public void simulate(String ascLocation, AlertSimulatorRequestBody alertSimulato /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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. @@ -2824,31 +2334,22 @@ private Mono> listNextSinglePageAsync(String nextLink) 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -2861,31 +2362,22 @@ private Mono> listNextSinglePageAsync(String nextLink, 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.")); + 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)); + 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -2897,32 +2389,24 @@ private Mono> listByResourceGroupNextSinglePageAsync(S 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.")); + 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)) + .>map(res -> new 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -2935,31 +2419,22 @@ private Mono> listByResourceGroupNextSinglePageAsync(S 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.")); + 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)); + 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -2971,33 +2446,23 @@ private Mono> listSubscriptionLevelByRegionNextSingleP 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -3005,37 +2470,28 @@ private Mono> listSubscriptionLevelByRegionNextSingleP * @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) { + 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.")); + 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)); + 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -3047,33 +2503,23 @@ private Mono> listResourceGroupLevelByRegionNextSingle 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.")); + 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.listResourceGroupLevelByRegionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext( + context -> service.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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -3081,29 +2527,19 @@ private Mono> listResourceGroupLevelByRegionNextSingle * @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) { + private Mono> listResourceGroupLevelByRegionNextSinglePageAsync(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.")); + 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 - .listResourceGroupLevelByRegionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listResourceGroupLevelByRegionNext(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 index 2256ce9a09cd4..cc9acb48a6191 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsImpl.java @@ -29,55 +29,52 @@ public AlertsImpl(AlertsClient innerClient, com.azure.resourcemanager.security.S public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); } public PagedIterable listSubscriptionLevelByRegion(String ascLocation) { PagedIterable inner = this.serviceClient().listSubscriptionLevelByRegion(ascLocation); - return Utils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); } public PagedIterable listResourceGroupLevelByRegion(String ascLocation, String resourceGroupName) { - PagedIterable inner = - this.serviceClient().listResourceGroupLevelByRegion(ascLocation, resourceGroupName); - return Utils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); + 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 Utils.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 getSubscriptionLevelWithResponse(String ascLocation, String alertName, Context context) { - Response inner = - this.serviceClient().getSubscriptionLevelWithResponse(ascLocation, alertName, context); + Response inner + = this.serviceClient().getSubscriptionLevelWithResponse(ascLocation, alertName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new AlertImpl(inner.getValue(), this.manager())); } else { return null; @@ -93,15 +90,12 @@ public Alert getSubscriptionLevel(String ascLocation, String alertName) { } } - public Response getResourceGroupLevelWithResponse( - String resourceGroupName, String ascLocation, String alertName, Context context) { - Response inner = - this.serviceClient().getResourceGroupLevelWithResponse(resourceGroupName, ascLocation, alertName, context); + public Response getResourceGroupLevelWithResponse(String resourceGroupName, String ascLocation, + String alertName, Context context) { + Response inner = this.serviceClient().getResourceGroupLevelWithResponse(resourceGroupName, + ascLocation, alertName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new AlertImpl(inner.getValue(), this.manager())); } else { return null; @@ -117,8 +111,8 @@ public Alert getResourceGroupLevel(String resourceGroupName, String ascLocation, } } - public Response updateSubscriptionLevelStateToDismissWithResponse( - String ascLocation, String alertName, Context context) { + public Response updateSubscriptionLevelStateToDismissWithResponse(String ascLocation, String alertName, + Context context) { return this.serviceClient().updateSubscriptionLevelStateToDismissWithResponse(ascLocation, alertName, context); } @@ -126,8 +120,8 @@ public void updateSubscriptionLevelStateToDismiss(String ascLocation, String ale this.serviceClient().updateSubscriptionLevelStateToDismiss(ascLocation, alertName); } - public Response updateSubscriptionLevelStateToResolveWithResponse( - String ascLocation, String alertName, Context context) { + public Response updateSubscriptionLevelStateToResolveWithResponse(String ascLocation, String alertName, + Context context) { return this.serviceClient().updateSubscriptionLevelStateToResolveWithResponse(ascLocation, alertName, context); } @@ -135,8 +129,8 @@ public void updateSubscriptionLevelStateToResolve(String ascLocation, String ale this.serviceClient().updateSubscriptionLevelStateToResolve(ascLocation, alertName); } - public Response updateSubscriptionLevelStateToActivateWithResponse( - String ascLocation, String alertName, Context context) { + public Response updateSubscriptionLevelStateToActivateWithResponse(String ascLocation, String alertName, + Context context) { return this.serviceClient().updateSubscriptionLevelStateToActivateWithResponse(ascLocation, alertName, context); } @@ -144,60 +138,55 @@ public void updateSubscriptionLevelStateToActivate(String ascLocation, String al this.serviceClient().updateSubscriptionLevelStateToActivate(ascLocation, alertName); } - public Response updateSubscriptionLevelStateToInProgressWithResponse( - String ascLocation, String alertName, Context context) { - return this - .serviceClient() - .updateSubscriptionLevelStateToInProgressWithResponse(ascLocation, alertName, context); + 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 updateResourceGroupLevelStateToResolveWithResponse( - String resourceGroupName, String ascLocation, String alertName, Context context) { - return this - .serviceClient() - .updateResourceGroupLevelStateToResolveWithResponse(resourceGroupName, ascLocation, alertName, context); + 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 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 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) { + 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 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) { + public void updateResourceGroupLevelStateToInProgress(String resourceGroupName, String ascLocation, + String alertName) { this.serviceClient().updateResourceGroupLevelStateToInProgress(resourceGroupName, ascLocation, alertName); } 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 index dba39316deae7..5fbf105426f57 100644 --- 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 @@ -15,8 +15,8 @@ public final class AlertsSuppressionRuleImpl implements AlertsSuppressionRule { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - AlertsSuppressionRuleImpl( - AlertsSuppressionRuleInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + AlertsSuppressionRuleImpl(AlertsSuppressionRuleInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 index b6e2af3f8fd62..838c7900c7d51 100644 --- 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 @@ -33,23 +33,28 @@ import com.azure.resourcemanager.security.models.AlertsSuppressionRulesList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in AlertsSuppressionRulesClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final AlertsSuppressionRulesService service; - /** The service client containing this operation class. */ + /** + * 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.service = RestProxy.create(AlertsSuppressionRulesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -60,162 +65,114 @@ public final class AlertsSuppressionRulesClientImpl implements AlertsSuppression @Host("{$host}") @ServiceInterface(name = "SecurityCenterAlerts") public interface AlertsSuppressionRulesService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") 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( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}") - @ExpectedResponses({200}) + Mono> list(@HostParam("$host") 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("/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("alertsSuppressionRuleName") String alertsSuppressionRuleName, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("alertsSuppressionRuleName") String alertsSuppressionRuleName, @BodyParam("application/json") AlertsSuppressionRuleInner alertsSuppressionRule, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}") - @ExpectedResponses({204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}") + @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("alertsSuppressionRuleName") String alertsSuppressionRuleName, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * 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}. + * {@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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)) + .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}. + * {@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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)); + .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. @@ -229,7 +186,7 @@ private PagedFlux listAsync(String alertType) { /** * 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}. @@ -242,7 +199,7 @@ private PagedFlux listAsync() { /** * 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. @@ -252,13 +209,13 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String alertType, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(alertType, context), nextLink -> listNextSinglePageAsync(nextLink, 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}. @@ -271,7 +228,7 @@ public 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. @@ -286,104 +243,78 @@ public PagedIterable list(String alertType, 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}. + * @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); + 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)) + .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}. + * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); + 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); + 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}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String alertsSuppressionRuleName) { @@ -392,14 +323,14 @@ private Mono getAsync(String alertsSuppressionRuleNa /** * 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}. + * @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) { @@ -408,7 +339,7 @@ public Response getWithResponse(String alertsSuppres /** * 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. @@ -422,7 +353,7 @@ public 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. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -431,25 +362,19 @@ public AlertsSuppressionRuleInner get(String alertsSuppressionRuleName) { * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); + return Mono.error( + new IllegalArgumentException("Parameter alertsSuppressionRuleName is required and cannot be null.")); } if (alertsSuppressionRule == null) { return Mono @@ -460,23 +385,14 @@ private Mono> updateWithResponseAsync( final String apiVersion = "2019-01-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - alertsSuppressionRuleName, - alertsSuppressionRule, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), alertsSuppressionRuleName, alertsSuppressionRule, accept, 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. @@ -486,25 +402,19 @@ private Mono> updateWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); + return Mono.error( + new IllegalArgumentException("Parameter alertsSuppressionRuleName is required and cannot be null.")); } if (alertsSuppressionRule == null) { return Mono @@ -515,20 +425,13 @@ private Mono> updateWithResponseAsync( final String apiVersion = "2019-01-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - alertsSuppressionRuleName, - alertsSuppressionRule, - accept, - context); + return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + alertsSuppressionRuleName, alertsSuppressionRule, accept, 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. @@ -537,15 +440,15 @@ private Mono> updateWithResponseAsync( * @return describes the suppression rule on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String alertsSuppressionRuleName, AlertsSuppressionRuleInner alertsSuppressionRule) { + 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. @@ -555,14 +458,14 @@ private Mono updateAsync( * @return describes the suppression rule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String alertsSuppressionRuleName, AlertsSuppressionRuleInner alertsSuppressionRule, Context context) { + 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. @@ -571,14 +474,14 @@ public Response updateWithResponse( * @return describes the suppression rule. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AlertsSuppressionRuleInner update( - String alertsSuppressionRuleName, AlertsSuppressionRuleInner alertsSuppressionRule) { + 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. @@ -588,42 +491,28 @@ public AlertsSuppressionRuleInner update( @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); + 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 - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - alertsSuppressionRuleName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), alertsSuppressionRuleName, accept, 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. @@ -634,39 +523,27 @@ private Mono> deleteWithResponseAsync(String alertsSuppressionRul @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); + 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 - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - alertsSuppressionRuleName, - accept, - context); + return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + alertsSuppressionRuleName, accept, 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. @@ -680,7 +557,7 @@ private Mono deleteAsync(String alertsSuppressionRuleName) { /** * 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. @@ -695,7 +572,7 @@ public Response deleteWithResponse(String alertsSuppressionRuleName, Conte /** * 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. @@ -708,14 +585,15 @@ public void delete(String alertsSuppressionRuleName) { /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 suppression rules list for subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -723,37 +601,28 @@ private Mono> listNextSinglePageAsync( 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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 suppression rules list for subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -761,23 +630,13 @@ private Mono> listNextSinglePageAsync( 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.")); + 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)); + 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 index fe83aead0087d..353fe376e1f6a 100644 --- 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 @@ -21,30 +21,27 @@ public final class AlertsSuppressionRulesImpl implements AlertsSuppressionRules private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public AlertsSuppressionRulesImpl( - AlertsSuppressionRulesClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + public AlertsSuppressionRulesImpl(AlertsSuppressionRulesClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new AlertsSuppressionRuleImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new AlertsSuppressionRuleImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AlertsSuppressionRuleImpl(inner1, this.manager())); } public Response getWithResponse(String alertsSuppressionRuleName, Context context) { - Response inner = - this.serviceClient().getWithResponse(alertsSuppressionRuleName, context); + Response inner + = this.serviceClient().getWithResponse(alertsSuppressionRuleName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new AlertsSuppressionRuleImpl(inner.getValue(), this.manager())); } else { return null; @@ -60,25 +57,22 @@ public AlertsSuppressionRule get(String alertsSuppressionRuleName) { } } - public Response updateWithResponse( - String alertsSuppressionRuleName, AlertsSuppressionRuleInner alertsSuppressionRule, Context context) { - Response inner = - this.serviceClient().updateWithResponse(alertsSuppressionRuleName, alertsSuppressionRule, context); + public Response updateWithResponse(String alertsSuppressionRuleName, + AlertsSuppressionRuleInner alertsSuppressionRule, Context context) { + Response inner + = this.serviceClient().updateWithResponse(alertsSuppressionRuleName, alertsSuppressionRule, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new AlertsSuppressionRuleImpl(inner.getValue(), this.manager())); } else { return null; } } - public AlertsSuppressionRule update( - String alertsSuppressionRuleName, AlertsSuppressionRuleInner alertsSuppressionRule) { - AlertsSuppressionRuleInner inner = - this.serviceClient().update(alertsSuppressionRuleName, alertsSuppressionRule); + public AlertsSuppressionRule update(String alertsSuppressionRuleName, + AlertsSuppressionRuleInner alertsSuppressionRule) { + AlertsSuppressionRuleInner inner + = this.serviceClient().update(alertsSuppressionRuleName, alertsSuppressionRule); if (inner != null) { return new AlertsSuppressionRuleImpl(inner, this.manager()); } else { 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 index 6ec6858c8cae4..b0d4918e82294 100644 --- 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 @@ -31,22 +31,28 @@ 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. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final AllowedConnectionsService service; - /** The service client containing this operation class. */ + /** + * 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.service = RestProxy.create(AllowedConnectionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -57,153 +63,111 @@ public final class AllowedConnectionsClientImpl implements AllowedConnectionsCli @Host("{$host}") @ServiceInterface(name = "SecurityCenterAllowe") public interface AllowedConnectionsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/allowedConnections") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegion( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByHomeRegion(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("ascLocation") String ascLocation, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections/{connectionType}") - @ExpectedResponses({200}) + @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("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ascLocation") String ascLocation, - @PathParam("connectionType") ConnectionType connectionType, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, + @PathParam("connectionType") ConnectionType connectionType, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByHomeRegionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context 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}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, + accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the 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}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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(), this.client.getSubscriptionId(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, 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}. + * @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() { @@ -212,27 +176,27 @@ private PagedFlux 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 - * PagedFlux}. + * @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)); + 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}. + * @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() { @@ -241,13 +205,13 @@ public 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 ManagementException thrown if 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}. + * @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) { @@ -256,28 +220,24 @@ public PagedIterable list(Context 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. + * 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}. + * @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -285,54 +245,35 @@ private Mono> listByHomeRegionSin final String apiVersion = "2020-01-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByHomeRegion( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - ascLocation, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByHomeRegion(this.client.getEndpoint(), this.client.getSubscriptionId(), + ascLocation, apiVersion, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the 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. + * 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}. + * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -341,66 +282,57 @@ private Mono> listByHomeRegionSin final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByHomeRegion( - this.client.getEndpoint(), this.client.getSubscriptionId(), ascLocation, apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByHomeRegion(this.client.getEndpoint(), this.client.getSubscriptionId(), ascLocation, apiVersion, + 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. + * 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}. + * response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByHomeRegionAsync(String ascLocation) { - return new PagedFlux<>( - () -> listByHomeRegionSinglePageAsync(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. + * 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}. + * response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByHomeRegionAsync(String ascLocation, Context context) { - return new PagedFlux<>( - () -> listByHomeRegionSinglePageAsync(ascLocation, 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. + * 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}. + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByHomeRegion(String ascLocation) { @@ -409,15 +341,15 @@ public PagedIterable listByHomeRegion(String as /** * 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. + * 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}. + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByHomeRegion(String ascLocation, Context context) { @@ -427,32 +359,28 @@ public PagedIterable listByHomeRegion(String as /** * 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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}. + * type along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String ascLocation, ConnectionType connectionType) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -467,51 +395,37 @@ private Mono> getWithResponseAsync( final String apiVersion = "2020-01-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - connectionType, - apiVersion, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, ascLocation, connectionType, apiVersion, 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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}. + * 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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -526,36 +440,28 @@ private Mono> getWithResponseAsync( final String apiVersion = "2020-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - connectionType, - apiVersion, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, ascLocation, + connectionType, apiVersion, 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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}. + * type on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String ascLocation, ConnectionType connectionType) { + private Mono getAsync(String resourceGroupName, String ascLocation, + ConnectionType connectionType) { return getWithResponseAsync(resourceGroupName, ascLocation, connectionType) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -563,56 +469,57 @@ private Mono getAsync( /** * 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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}. + * type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String ascLocation, ConnectionType connectionType, Context context) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. + * type. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AllowedConnectionsResourceInner get( - String resourceGroupName, String ascLocation, ConnectionType connectionType) { + public AllowedConnectionsResourceInner get(String resourceGroupName, String ascLocation, + ConnectionType connectionType) { return getWithResponse(resourceGroupName, ascLocation, connectionType, Context.NONE).getValue(); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 all possible traffic between Azure resources along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -620,75 +527,57 @@ private Mono> listNextSinglePageA 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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 all possible traffic between Azure resources along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { + 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.")); + 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)); + 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 - *

The nextLink parameter. + * + * The nextLink 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 all possible traffic between Azure resources along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByHomeRegionNextSinglePageAsync(String nextLink) { @@ -696,62 +585,44 @@ private Mono> listByHomeRegionNex 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.")); + 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)) + .>map(res -> new 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 - *

The nextLink parameter. + * + * The nextLink 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 all possible traffic between Azure resources along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionNextSinglePageAsync( - String nextLink, Context context) { + 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.")); + 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)); + return service.listByHomeRegionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AllowedConnectionsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AllowedConnectionsImpl.java index 66d36cb8fb158..783c8fb12d198 100644 --- 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 @@ -22,42 +22,43 @@ public final class AllowedConnectionsImpl implements AllowedConnections { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public AllowedConnectionsImpl( - AllowedConnectionsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + public AllowedConnectionsImpl(AllowedConnectionsClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new AllowedConnectionsResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new AllowedConnectionsResourceImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new AllowedConnectionsResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new AllowedConnectionsResourceImpl(inner1, this.manager())); } public PagedIterable listByHomeRegion(String ascLocation) { PagedIterable inner = this.serviceClient().listByHomeRegion(ascLocation); - return Utils.mapPage(inner, inner1 -> new AllowedConnectionsResourceImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new AllowedConnectionsResourceImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().listByHomeRegion(ascLocation, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new AllowedConnectionsResourceImpl(inner1, this.manager())); } - public Response getWithResponse( - String resourceGroupName, String ascLocation, ConnectionType connectionType, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, ascLocation, connectionType, context); + public Response getWithResponse(String resourceGroupName, String ascLocation, + ConnectionType connectionType, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, ascLocation, connectionType, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new AllowedConnectionsResourceImpl(inner.getValue(), this.manager())); } else { return null; @@ -65,8 +66,8 @@ public Response getWithResponse( } public AllowedConnectionsResource get(String resourceGroupName, String ascLocation, ConnectionType connectionType) { - AllowedConnectionsResourceInner inner = - this.serviceClient().get(resourceGroupName, ascLocation, connectionType); + AllowedConnectionsResourceInner inner + = this.serviceClient().get(resourceGroupName, ascLocation, connectionType); if (inner != null) { return new AllowedConnectionsResourceImpl(inner, this.manager()); } else { 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 index f53610805f1b2..de4ec6bfedfdb 100644 --- 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 @@ -16,8 +16,7 @@ public final class AllowedConnectionsResourceImpl implements AllowedConnectionsR private final com.azure.resourcemanager.security.SecurityManager serviceManager; - AllowedConnectionsResourceImpl( - AllowedConnectionsResourceInner innerObject, + AllowedConnectionsResourceImpl(AllowedConnectionsResourceInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 new file mode 100644 index 0000000000000..658835896f614 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionImpl.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +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 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/ApiCollectionOffboardingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOffboardingsClientImpl.java deleted file mode 100644 index ca575de7d8a71..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOffboardingsClientImpl.java +++ /dev/null @@ -1,248 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.Delete; -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.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.ApiCollectionOffboardingsClient; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ApiCollectionOffboardingsClient. */ -public final class ApiCollectionOffboardingsClientImpl implements ApiCollectionOffboardingsClient { - /** The proxy service used to perform REST calls. */ - private final ApiCollectionOffboardingsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of ApiCollectionOffboardingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ApiCollectionOffboardingsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - ApiCollectionOffboardingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterApiCollectionOffboardings to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterApiCol") - public interface ApiCollectionOffboardingsService { - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiCollectionId}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serviceName") String serviceName, - @PathParam("apiCollectionId") String apiCollectionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Offboard an Azure API Management API from Defender for APIs - * - *

Offboard an Azure API Management API from 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 apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API 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 serviceName, String apiCollectionId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.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 (apiCollectionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter apiCollectionId is required and cannot be null.")); - } - final String apiVersion = "2022-11-20-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - serviceName, - apiCollectionId, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Offboard an Azure API Management API from Defender for APIs - * - *

Offboard an Azure API Management API from 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 apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API 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 serviceName, String apiCollectionId, 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 (apiCollectionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter apiCollectionId is required and cannot be null.")); - } - final String apiVersion = "2022-11-20-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - serviceName, - apiCollectionId, - apiVersion, - accept, - context); - } - - /** - * Offboard an Azure API Management API from Defender for APIs - * - *

Offboard an Azure API Management API from 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 apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API 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 serviceName, String apiCollectionId) { - return deleteWithResponseAsync(resourceGroupName, serviceName, apiCollectionId) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Offboard an Azure API Management API from Defender for APIs - * - *

Offboard an Azure API Management API from 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 apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API 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 serviceName, String apiCollectionId, Context context) { - return deleteWithResponseAsync(resourceGroupName, serviceName, apiCollectionId, context).block(); - } - - /** - * Offboard an Azure API Management API from Defender for APIs - * - *

Offboard an Azure API Management API from 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 apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API 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 serviceName, String apiCollectionId) { - deleteWithResponse(resourceGroupName, serviceName, apiCollectionId, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOffboardingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOffboardingsImpl.java deleted file mode 100644 index 8e6f9091324b7..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOffboardingsImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.ApiCollectionOffboardingsClient; -import com.azure.resourcemanager.security.models.ApiCollectionOffboardings; - -public final class ApiCollectionOffboardingsImpl implements ApiCollectionOffboardings { - private static final ClientLogger LOGGER = new ClientLogger(ApiCollectionOffboardingsImpl.class); - - private final ApiCollectionOffboardingsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public ApiCollectionOffboardingsImpl( - ApiCollectionOffboardingsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response deleteWithResponse( - String resourceGroupName, String serviceName, String apiCollectionId, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, serviceName, apiCollectionId, context); - } - - public void delete(String resourceGroupName, String serviceName, String apiCollectionId) { - this.serviceClient().delete(resourceGroupName, serviceName, apiCollectionId); - } - - private ApiCollectionOffboardingsClient 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/ApiCollectionOnboardingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOnboardingsClientImpl.java deleted file mode 100644 index f2eab89967aba..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOnboardingsClientImpl.java +++ /dev/null @@ -1,252 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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.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.ApiCollectionOnboardingsClient; -import com.azure.resourcemanager.security.fluent.models.ApiCollectionResponseInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ApiCollectionOnboardingsClient. */ -public final class ApiCollectionOnboardingsClientImpl implements ApiCollectionOnboardingsClient { - /** The proxy service used to perform REST calls. */ - private final ApiCollectionOnboardingsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of ApiCollectionOnboardingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ApiCollectionOnboardingsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create(ApiCollectionOnboardingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterApiCollectionOnboardings to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterApiCol") - public interface ApiCollectionOnboardingsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiCollectionId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serviceName") String serviceName, - @PathParam("apiCollectionId") String apiCollectionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Onboard an Azure API Management API to Defender for APIs - * - *

Onboard an Azure API Management API to 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 apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API 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 an API collection as represented by Defender for APIs along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, String serviceName, String apiCollectionId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.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 (apiCollectionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter apiCollectionId is required and cannot be null.")); - } - final String apiVersion = "2022-11-20-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - serviceName, - apiCollectionId, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Onboard an Azure API Management API to Defender for APIs - * - *

Onboard an Azure API Management API to 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 apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API 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 an API collection as represented by Defender for APIs along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, String serviceName, String apiCollectionId, 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 (apiCollectionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter apiCollectionId is required and cannot be null.")); - } - final String apiVersion = "2022-11-20-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - serviceName, - apiCollectionId, - apiVersion, - accept, - context); - } - - /** - * Onboard an Azure API Management API to Defender for APIs - * - *

Onboard an Azure API Management API to 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 apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API 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 an API collection as represented by Defender for APIs on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String serviceName, String apiCollectionId) { - return createWithResponseAsync(resourceGroupName, serviceName, apiCollectionId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Onboard an Azure API Management API to Defender for APIs - * - *

Onboard an Azure API Management API to 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 apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API 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 an API collection as represented by Defender for APIs along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, String serviceName, String apiCollectionId, Context context) { - return createWithResponseAsync(resourceGroupName, serviceName, apiCollectionId, context).block(); - } - - /** - * Onboard an Azure API Management API to Defender for APIs - * - *

Onboard an Azure API Management API to 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 apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API 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 an API collection as represented by Defender for APIs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApiCollectionResponseInner create(String resourceGroupName, String serviceName, String apiCollectionId) { - return createWithResponse(resourceGroupName, serviceName, apiCollectionId, Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOnboardingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOnboardingsImpl.java deleted file mode 100644 index 0fc34f1654954..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOnboardingsImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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.ApiCollectionOnboardingsClient; -import com.azure.resourcemanager.security.fluent.models.ApiCollectionResponseInner; -import com.azure.resourcemanager.security.models.ApiCollectionOnboardings; -import com.azure.resourcemanager.security.models.ApiCollectionResponse; - -public final class ApiCollectionOnboardingsImpl implements ApiCollectionOnboardings { - private static final ClientLogger LOGGER = new ClientLogger(ApiCollectionOnboardingsImpl.class); - - private final ApiCollectionOnboardingsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public ApiCollectionOnboardingsImpl( - ApiCollectionOnboardingsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response createWithResponse( - String resourceGroupName, String serviceName, String apiCollectionId, Context context) { - Response inner = - this.serviceClient().createWithResponse(resourceGroupName, serviceName, apiCollectionId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ApiCollectionResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ApiCollectionResponse create(String resourceGroupName, String serviceName, String apiCollectionId) { - ApiCollectionResponseInner inner = this.serviceClient().create(resourceGroupName, serviceName, apiCollectionId); - if (inner != null) { - return new ApiCollectionResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - private ApiCollectionOnboardingsClient 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/ApiCollectionResponseImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionResponseImpl.java deleted file mode 100644 index 1427fdd1513f9..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionResponseImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.ApiCollectionResponseInner; -import com.azure.resourcemanager.security.models.ApiCollectionResponse; -import java.util.Collections; -import java.util.Map; - -public final class ApiCollectionResponseImpl implements ApiCollectionResponse { - private ApiCollectionResponseInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ApiCollectionResponseImpl( - ApiCollectionResponseInner 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 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 ApiCollectionResponseInner 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 index 08310c38ed47a..32347f459c68d 100644 --- 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 @@ -4,6 +4,7 @@ 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; @@ -11,6 +12,7 @@ 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; @@ -23,29 +25,40 @@ 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.ApiCollectionResponseInner; -import com.azure.resourcemanager.security.models.ApiCollectionResponseList; +import com.azure.resourcemanager.security.fluent.models.ApiCollectionInner; +import com.azure.resourcemanager.security.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. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final ApiCollectionsService service; - /** The service client containing this operation class. */ + /** + * 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.service + = RestProxy.create(ApiCollectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -56,75 +69,384 @@ public final class ApiCollectionsClientImpl implements ApiCollectionsClient { @Host("{$host}") @ServiceInterface(name = "SecurityCenterApiCol") public interface ApiCollectionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/apiCollections") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/apiCollections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serviceName") String serviceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiCollectionId}") - @ExpectedResponses({200}) + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, 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> get( - @HostParam("$host") String endpoint, + Mono> listByAzureApiManagementService(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serviceName") String serviceName, - @PathParam("apiCollectionId") String apiCollectionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serviceName") String serviceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @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("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, @QueryParam("api-version") String apiVersion, + @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("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "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("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serviceName") String serviceName, + @PathParam("apiId") String apiId, @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("$host") 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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByAzureApiManagementServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, 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 ManagementException thrown if 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 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(), this.client.getSubscriptionId(), apiVersion, + accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets 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 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(), this.client.getSubscriptionId(), apiVersion, 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 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 Azure API Management APIs that have been onboarded to Defender for APIs - * - *

Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API - * Management API is onboarded to 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. - * + * 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 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 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 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. - * @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 Azure API Management APIs that have been onboarded to Defender for APIs along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return 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> listSinglePageAsync( - String resourceGroupName, String serviceName) { + 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 this.client.getEndpoint() is required and cannot be null.")); + .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(), + this.client.getSubscriptionId(), resourceGroupName, apiVersion, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets 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 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 this.client.getSubscriptionId() is required and cannot be null.")); + .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(), this.client.getSubscriptionId(), resourceGroupName, + apiVersion, 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 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 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 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 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 + * + * 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 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 @@ -133,62 +455,42 @@ private Mono> listSinglePageAsync( if (serviceName == null) { return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); } - final String apiVersion = "2022-11-20-preview"; + final String apiVersion = "2023-11-15"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - serviceName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByAzureApiManagementService(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, serviceName, apiVersion, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs - * - *

Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API - * Management API is onboarded to 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. - * + * 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 Azure API Management APIs that have been onboarded to Defender for APIs along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return 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> listSinglePageAsync( - String resourceGroupName, String serviceName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -197,147 +499,179 @@ private Mono> listSinglePageAsync( if (serviceName == null) { return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); } - final String apiVersion = "2022-11-20-preview"; + final String apiVersion = "2023-11-15"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - serviceName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs - * - *

Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API - * Management API is onboarded to 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. - * + .listByAzureApiManagementService(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, serviceName, apiVersion, 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 Azure API Management APIs that have been onboarded to Defender for APIs as paginated response - * with {@link PagedFlux}. + * @return 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 listAsync(String resourceGroupName, String serviceName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, serviceName), nextLink -> listNextSinglePageAsync(nextLink)); + private PagedFlux listByAzureApiManagementServiceAsync(String resourceGroupName, + String serviceName) { + return new PagedFlux<>(() -> listByAzureApiManagementServiceSinglePageAsync(resourceGroupName, serviceName), + nextLink -> listByAzureApiManagementServiceNextSinglePageAsync(nextLink)); } /** - * Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs - * - *

Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API - * Management API is onboarded to 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. - * + * 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 Azure API Management APIs that have been onboarded to Defender for APIs as paginated response - * with {@link PagedFlux}. + * @return 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 listAsync( - String resourceGroupName, String serviceName, Context context) { + private PagedFlux listByAzureApiManagementServiceAsync(String resourceGroupName, + String serviceName, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, serviceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + () -> listByAzureApiManagementServiceSinglePageAsync(resourceGroupName, serviceName, context), + nextLink -> listByAzureApiManagementServiceNextSinglePageAsync(nextLink, context)); } /** - * Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs - * - *

Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API - * Management API is onboarded to 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. - * + * 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 Azure API Management APIs that have been onboarded to Defender for APIs as paginated response - * with {@link PagedIterable}. + * @return 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 list(String resourceGroupName, String serviceName) { - return new PagedIterable<>(listAsync(resourceGroupName, serviceName)); + public PagedIterable listByAzureApiManagementService(String resourceGroupName, + String serviceName) { + return new PagedIterable<>(listByAzureApiManagementServiceAsync(resourceGroupName, serviceName)); } /** - * Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs - * - *

Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API - * Management API is onboarded to 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. - * + * 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 Azure API Management APIs that have been onboarded to Defender for APIs as paginated response - * with {@link PagedIterable}. + * @return 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 list( - String resourceGroupName, String serviceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, serviceName, context)); + public PagedIterable listByAzureApiManagementService(String resourceGroupName, + String serviceName, Context context) { + return new PagedIterable<>(listByAzureApiManagementServiceAsync(resourceGroupName, serviceName, context)); } /** - * Gets an Azure API Management API if it has been onboarded to Defender for APIs - * - *

Gets an Azure API Management API if it has been onboarded to Defender for APIs. If an Azure API Management API - * is onboarded to 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. - * + * 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 apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. + * @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 Azure API Management API if it has been onboarded to Defender for APIs along with {@link Response} on - * successful completion of {@link Mono}. + * @return 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> getWithResponseAsync( - String resourceGroupName, String serviceName, String apiCollectionId) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + .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(), + this.client.getSubscriptionId(), resourceGroupName, serviceName, apiId, apiVersion, 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 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 @@ -346,60 +680,393 @@ private Mono> getWithResponseAsync( if (serviceName == null) { return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); } - if (apiCollectionId == 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(), this.client.getSubscriptionId(), + resourceGroupName, serviceName, apiId, apiVersion, 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 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 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 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 apiCollectionId is required and cannot be null.")); + .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 = "2022-11-20-preview"; + 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 - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - serviceName, - apiCollectionId, - apiVersion, - accept, - context)) + .withContext(context -> service.onboardAzureApiManagementApi(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, serviceName, apiId, apiVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets an Azure API Management API if it has been onboarded to Defender for APIs - * - *

Gets an Azure API Management API if it has been onboarded to Defender for APIs. If an Azure API Management API - * is onboarded to 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. - * + * 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 apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. + * @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 Azure API Management API if it has been onboarded to Defender for APIs along with {@link Response} on - * successful completion of {@link Mono}. + * @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> getWithResponseAsync( - String resourceGroupName, String serviceName, String apiCollectionId, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + .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(), this.client.getSubscriptionId(), + resourceGroupName, serviceName, apiId, apiVersion, 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 @@ -408,165 +1075,301 @@ private Mono> getWithResponseAsync( if (serviceName == null) { return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); } - if (apiCollectionId == 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.offboardAzureApiManagementApi(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, serviceName, apiId, apiVersion, accept, 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 apiCollectionId is required and cannot be null.")); + .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 = "2022-11-20-preview"; + 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 - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - serviceName, - apiCollectionId, - apiVersion, - accept, - context); + return service.offboardAzureApiManagementApi(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, serviceName, apiId, apiVersion, accept, context); } /** - * Gets an Azure API Management API if it has been onboarded to Defender for APIs - * - *

Gets an Azure API Management API if it has been onboarded to Defender for APIs. If an Azure API Management API - * is onboarded to 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. - * + * 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 apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. + * @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 Azure API Management API if it has been onboarded to Defender for APIs on successful completion of - * {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String serviceName, String apiCollectionId) { - return getWithResponseAsync(resourceGroupName, serviceName, apiCollectionId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono offboardAzureApiManagementApiAsync(String resourceGroupName, String serviceName, String apiId) { + return offboardAzureApiManagementApiWithResponseAsync(resourceGroupName, serviceName, apiId) + .flatMap(ignored -> Mono.empty()); } /** - * Gets an Azure API Management API if it has been onboarded to Defender for APIs - * - *

Gets an Azure API Management API if it has been onboarded to Defender for APIs. If an Azure API Management API - * is onboarded to 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. - * + * 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 apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. + * @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 Azure API Management API if it has been onboarded to Defender for APIs along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String serviceName, String apiCollectionId, Context context) { - return getWithResponseAsync(resourceGroupName, serviceName, apiCollectionId, context).block(); + public Response offboardAzureApiManagementApiWithResponse(String resourceGroupName, String serviceName, + String apiId, Context context) { + return offboardAzureApiManagementApiWithResponseAsync(resourceGroupName, serviceName, apiId, context).block(); } /** - * Gets an Azure API Management API if it has been onboarded to Defender for APIs - * - *

Gets an Azure API Management API if it has been onboarded to Defender for APIs. If an Azure API Management API - * is onboarded to 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. - * + * 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 apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. + * @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 Azure API Management API if it has been onboarded to Defender for APIs. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ApiCollectionResponseInner get(String resourceGroupName, String serviceName, String apiCollectionId) { - return getWithResponse(resourceGroupName, serviceName, apiCollectionId, Context.NONE).getValue(); + public void offboardAzureApiManagementApi(String resourceGroupName, String serviceName, String apiId) { + offboardAzureApiManagementApiWithResponse(resourceGroupName, serviceName, apiId, Context.NONE); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 page of a list of API collections as represented by Defender for APIs along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return page of a list of API collections as represented by Microsoft Defender for APIs along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { + 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.")); + 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)) + .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 - *

The nextLink parameter. + * + * The nextLink 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 page of a list of API collections as represented by Defender for APIs along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return page of a list of API collections as represented by Microsoft Defender for APIs along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + 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.")); + 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)); + 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 + * + * The nextLink 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 page of a list of API collections as represented by 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())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink 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 page of a list of API collections as represented by 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)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink 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 page of a list of API collections as represented by 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())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink 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 page of a list of API collections as represented by 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)); } } 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 index 336ea9d218013..812edc7418b67 100644 --- 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 @@ -10,8 +10,8 @@ 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.ApiCollectionResponseInner; -import com.azure.resourcemanager.security.models.ApiCollectionResponse; +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 { @@ -21,47 +21,98 @@ public final class ApiCollectionsImpl implements ApiCollections { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public ApiCollectionsImpl( - ApiCollectionsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + public ApiCollectionsImpl(ApiCollectionsClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String serviceName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, serviceName); - return Utils.mapPage(inner, inner1 -> new ApiCollectionResponseImpl(inner1, this.manager())); + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApiCollectionImpl(inner1, this.manager())); } - public PagedIterable list(String resourceGroupName, String serviceName, Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, serviceName, context); - return Utils.mapPage(inner, inner1 -> new ApiCollectionResponseImpl(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 Response getWithResponse( - String resourceGroupName, String serviceName, String apiCollectionId, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, serviceName, apiCollectionId, context); + 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())); + } + + 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 Response getByAzureApiManagementServiceWithResponse(String resourceGroupName, + String serviceName, String apiId, Context context) { + Response inner = this.serviceClient() + .getByAzureApiManagementServiceWithResponse(resourceGroupName, serviceName, apiId, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ApiCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ApiCollectionResponseImpl(inner.getValue(), this.manager())); + return new ApiCollectionImpl(inner, this.manager()); } else { return null; } } - public ApiCollectionResponse get(String resourceGroupName, String serviceName, String apiCollectionId) { - ApiCollectionResponseInner inner = this.serviceClient().get(resourceGroupName, serviceName, apiCollectionId); + 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 ApiCollectionResponseImpl(inner, this.manager()); + 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); + } + private ApiCollectionsClient serviceClient() { return this.innerClient; } 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 index 6bb5827d3d18b..b7aec34108ce6 100644 --- 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 @@ -60,22 +60,14 @@ private com.azure.resourcemanager.security.SecurityManager manager() { private String applicationId; public Application create() { - this.innerObject = - serviceManager - .serviceClient() - .getApplicationOperations() - .createOrUpdateWithResponse(applicationId, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getApplicationOperations() + .createOrUpdateWithResponse(applicationId, this.innerModel(), Context.NONE).getValue(); return this; } public Application create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getApplicationOperations() - .createOrUpdateWithResponse(applicationId, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getApplicationOperations() + .createOrUpdateWithResponse(applicationId, this.innerModel(), context).getValue(); return this; } @@ -90,48 +82,32 @@ public ApplicationImpl update() { } public Application apply() { - this.innerObject = - serviceManager - .serviceClient() - .getApplicationOperations() - .createOrUpdateWithResponse(applicationId, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getApplicationOperations() + .createOrUpdateWithResponse(applicationId, this.innerModel(), Context.NONE).getValue(); return this; } public Application apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getApplicationOperations() - .createOrUpdateWithResponse(applicationId, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getApplicationOperations() + .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 = Utils.getValueFromIdByName(innerObject.id(), "applications"); + this.applicationId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "applications"); } public Application refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getApplicationOperations() - .getWithResponse(applicationId, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getApplicationOperations() + .getWithResponse(applicationId, Context.NONE).getValue(); return this; } public Application refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getApplicationOperations() - .getWithResponse(applicationId, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getApplicationOperations() + .getWithResponse(applicationId, context).getValue(); return this; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationOperationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationOperationsClientImpl.java index 4a46f329ee115..2dee16d2c2d36 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationOperationsClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationOperationsClientImpl.java @@ -28,23 +28,28 @@ import com.azure.resourcemanager.security.fluent.models.ApplicationInner; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ApplicationOperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in ApplicationOperationsClient. + */ public final class ApplicationOperationsClientImpl implements ApplicationOperationsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ApplicationOperationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityCenterImpl client; /** * Initializes an instance of ApplicationOperationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ApplicationOperationsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create(ApplicationOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(ApplicationOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -55,66 +60,52 @@ public final class ApplicationOperationsClientImpl implements ApplicationOperati @Host("{$host}") @ServiceInterface(name = "SecurityCenterApplic") public interface ApplicationOperationsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("applicationId") String applicationId, - @HeaderParam("Accept") String accept, - Context context); + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("applicationId") String applicationId, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId}") - @ExpectedResponses({200, 201}) + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("applicationId") String applicationId, - @BodyParam("application/json") ApplicationInner application, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") ApplicationInner application, @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId}") - @ExpectedResponses({200, 204}) + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("applicationId") String applicationId, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("applicationId") 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 ManagementException 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}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -122,43 +113,31 @@ private Mono> getWithResponseAsync(String application 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)) + .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}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -166,14 +145,13 @@ private Mono> getWithResponseAsync(String application 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); + 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. @@ -187,7 +165,7 @@ private Mono getAsync(String applicationId) { /** * 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. @@ -202,7 +180,7 @@ public Response getWithResponse(String applicationId, 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. @@ -216,29 +194,25 @@ public 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -251,46 +225,33 @@ private Mono> createOrUpdateWithResponseAsync( final String apiVersion = "2022-07-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - applicationId, - application, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), applicationId, application, accept, 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}. + * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -303,20 +264,13 @@ private Mono> createOrUpdateWithResponseAsync( final String apiVersion = "2022-07-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - applicationId, - application, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + applicationId, application, accept, 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. @@ -332,7 +286,7 @@ private Mono createOrUpdateAsync(String applicationId, Applica /** * 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. @@ -342,14 +296,14 @@ private Mono createOrUpdateAsync(String applicationId, Applica * @return security Application over a given scope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String applicationId, ApplicationInner application, Context context) { + 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. @@ -364,7 +318,7 @@ public ApplicationInner createOrUpdate(String applicationId, ApplicationInner ap /** * 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. @@ -374,37 +328,26 @@ public ApplicationInner createOrUpdate(String applicationId, ApplicationInner ap @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)) + .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. @@ -415,29 +358,25 @@ private Mono> deleteWithResponseAsync(String applicationId) { @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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); + 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. @@ -451,7 +390,7 @@ private Mono deleteAsync(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. @@ -466,7 +405,7 @@ public 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 ManagementException thrown if the request is rejected by server. diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationOperationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationOperationsImpl.java index 7d6d4ab2601b3..fb1cc5d536bb5 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationOperationsImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationOperationsImpl.java @@ -20,8 +20,8 @@ public final class ApplicationOperationsImpl implements ApplicationOperations { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public ApplicationOperationsImpl( - ApplicationOperationsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + public ApplicationOperationsImpl(ApplicationOperationsClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -29,10 +29,7 @@ public ApplicationOperationsImpl( public Response getWithResponse(String applicationId, Context context) { Response inner = this.serviceClient().getWithResponse(applicationId, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ApplicationImpl(inner.getValue(), this.manager())); } else { return null; @@ -57,45 +54,37 @@ public void delete(String applicationId) { } public Application getById(String id) { - String applicationId = Utils.getValueFromIdByName(id, "applications"); + 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))); + 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 = Utils.getValueFromIdByName(id, "applications"); + 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))); + 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 = Utils.getValueFromIdByName(id, "applications"); + 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))); + 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 = Utils.getValueFromIdByName(id, "applications"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); } return this.deleteWithResponse(applicationId, context); } 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 index b604de04135ab..7462cc2038ff8 100644 --- 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 @@ -30,142 +30,117 @@ import com.azure.resourcemanager.security.models.ApplicationsList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ApplicationsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final ApplicationsService service; - /** The service client containing this operation class. */ + /** + * 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.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. + * The interface defining all the services for SecurityCenterApplications to be used by the proxy service to + * perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "SecurityCenterApplic") public interface ApplicationsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context 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 along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)) + .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}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)); + 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}. + * @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() { @@ -174,27 +149,27 @@ private PagedFlux 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 - * PagedFlux}. + * @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)); + 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}. + * @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() { @@ -203,13 +178,13 @@ public 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 ManagementException thrown if 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}. + * @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) { @@ -218,14 +193,15 @@ public PagedIterable list(Context context) { /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 page of a security applications list along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return page of a security applications list along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -233,37 +209,28 @@ private Mono> listNextSinglePageAsync(String nex 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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 page of a security applications list along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return page of a security applications list along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -271,23 +238,13 @@ private Mono> listNextSinglePageAsync(String nex 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.")); + 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)); + 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 index 190bf422bb857..94842779359ea 100644 --- 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 @@ -19,20 +19,20 @@ public final class ApplicationsImpl implements Applications { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public ApplicationsImpl( - ApplicationsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + public ApplicationsImpl(ApplicationsClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); } private ApplicationsClient serviceClient() { 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 index 2cbcb3ac9e6c5..fe1d978241cf6 100644 --- 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 @@ -35,22 +35,28 @@ import com.azure.resourcemanager.security.models.SecurityAssessmentList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in AssessmentsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final AssessmentsService service; - /** The service client containing this operation class. */ + /** + * 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.service + = RestProxy.create(AssessmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -61,84 +67,67 @@ public final class AssessmentsClientImpl implements AssessmentsClient { @Host("{$host}") @ServiceInterface(name = "SecurityCenterAssess") public interface AssessmentsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/{scope}/providers/Microsoft.Security/assessments") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") 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"}) + @Headers({ "Content-Type: application/json" }) @Get("/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") 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); + @PathParam("assessmentName") String assessmentName, @QueryParam("$expand") ExpandEnum expand, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Put("/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}") - @ExpectedResponses({200, 201}) + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, + Mono> createOrUpdate(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam(value = "resourceId", encoded = true) String resourceId, @PathParam("assessmentName") String assessmentName, - @BodyParam("application/json") SecurityAssessment assessment, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") SecurityAssessment assessment, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Delete("/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}") - @ExpectedResponses({200, 204}) + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("assessmentName") String assessmentName, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("assessmentName") String assessmentName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Get security assessments on all your scanned resources inside a scope. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * 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.")); + 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.")); @@ -147,37 +136,28 @@ private Mono> listSinglePageAsync 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)) + .>map(res -> new 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 Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * 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.")); + 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.")); @@ -185,29 +165,21 @@ private Mono> listSinglePageAsync final String apiVersion = "2021-06-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)); + 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 Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @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) { @@ -216,32 +188,32 @@ private PagedFlux listAsync(String scope) { /** * Get security assessments on all your scanned resources inside a scope. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @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)); + return new PagedFlux<>(() -> listSinglePageAsync(scope, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Get security assessments on all your scanned resources inside a scope. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @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) { @@ -250,15 +222,15 @@ public PagedIterable list(String scope) { /** * Get security assessments on all your scanned resources inside a scope. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @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) { @@ -267,7 +239,7 @@ public PagedIterable list(String scope, Context /** * Get a security assessment on your scanned resource. - * + * * @param resourceId The identifier of the resource. * @param assessmentName The Assessment Key - Unique key for the assessment type. * @param expand OData expand. Optional. @@ -275,16 +247,14 @@ public PagedIterable list(String scope, Context * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a security assessment on your scanned resource along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceId, String assessmentName, ExpandEnum expand) { + 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.")); + 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.")); @@ -295,17 +265,14 @@ private Mono> getWithResponseAsync( final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), apiVersion, resourceId, assessmentName, expand, accept, context)) + .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 identifier of the resource. * @param assessmentName The Assessment Key - Unique key for the assessment type. * @param expand OData expand. Optional. @@ -314,16 +281,14 @@ private Mono> getWithResponseAsync( * @throws ManagementException 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceId, String assessmentName, ExpandEnum expand, Context context) { + 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.")); + 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.")); @@ -339,7 +304,7 @@ private Mono> getWithResponseAsync( /** * Get a security assessment on your scanned resource. - * + * * @param resourceId The identifier of the resource. * @param assessmentName The Assessment Key - Unique key for the assessment type. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -356,7 +321,7 @@ private Mono getAsync(String resourceId, String /** * Get a security assessment on your scanned resource. - * + * * @param resourceId The identifier of the resource. * @param assessmentName The Assessment Key - Unique key for the assessment type. * @param expand OData expand. Optional. @@ -367,14 +332,14 @@ private Mono getAsync(String resourceId, String * @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) { + 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 identifier of the resource. * @param assessmentName The Assessment Key - Unique key for the assessment type. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -391,7 +356,7 @@ public SecurityAssessmentResponseInner get(String resourceId, String assessmentN /** * 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 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. @@ -399,16 +364,14 @@ public SecurityAssessmentResponseInner get(String resourceId, String assessmentN * @throws 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}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceId, String assessmentName, SecurityAssessment assessment) { + 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.")); + 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.")); @@ -424,24 +387,15 @@ private Mono> createOrUpdateWithRespon final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - resourceId, - assessmentName, - assessment, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, resourceId, + assessmentName, assessment, accept, 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 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. @@ -450,16 +404,14 @@ private Mono> createOrUpdateWithRespon * @throws 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}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceId, String assessmentName, SecurityAssessment assessment, Context context) { + 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.")); + 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.")); @@ -475,15 +427,14 @@ private Mono> createOrUpdateWithRespon final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), apiVersion, resourceId, assessmentName, assessment, accept, context); + return service.createOrUpdate(this.client.getEndpoint(), apiVersion, resourceId, assessmentName, assessment, + accept, 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 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. @@ -493,8 +444,8 @@ private Mono> createOrUpdateWithRespon * @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) { + private Mono createOrUpdateAsync(String resourceId, String assessmentName, + SecurityAssessment assessment) { return createOrUpdateWithResponseAsync(resourceId, assessmentName, assessment) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -502,7 +453,7 @@ private Mono createOrUpdateAsync( /** * 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 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. @@ -513,15 +464,15 @@ private Mono createOrUpdateAsync( * @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) { + 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 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. @@ -531,15 +482,15 @@ public Response createOrUpdateWithResponse( * @return security assessment on a resource - response format. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityAssessmentResponseInner createOrUpdate( - String resourceId, String assessmentName, SecurityAssessment assessment) { + 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 identifier of the resource. * @param assessmentName The Assessment Key - Unique key for the assessment type. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -550,10 +501,8 @@ public SecurityAssessmentResponseInner createOrUpdate( @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.")); + 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.")); @@ -564,16 +513,15 @@ private Mono> deleteWithResponseAsync(String resourceId, String a final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service.delete(this.client.getEndpoint(), apiVersion, resourceId, assessmentName, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, resourceId, assessmentName, + accept, 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 identifier of the resource. * @param assessmentName The Assessment Key - Unique key for the assessment type. * @param context The context to associate with this operation. @@ -585,10 +533,8 @@ private Mono> deleteWithResponseAsync(String resourceId, String a @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.")); + 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.")); @@ -605,7 +551,7 @@ private Mono> deleteWithResponseAsync(String resourceId, String a /** * 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 identifier of the resource. * @param assessmentName The Assessment Key - Unique key for the assessment type. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -621,7 +567,7 @@ private Mono deleteAsync(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 identifier of the resource. * @param assessmentName The Assessment Key - Unique key for the assessment type. * @param context The context to associate with this operation. @@ -638,7 +584,7 @@ public Response deleteWithResponse(String resourceId, String assessmentNam /** * 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 identifier of the resource. * @param assessmentName The Assessment Key - Unique key for the assessment type. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -652,14 +598,15 @@ public void delete(String resourceId, String assessmentName) { /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 page of a security assessments list along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return page of a security assessments list along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -667,62 +614,43 @@ private Mono> listNextSinglePageA 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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 page of a security assessments list along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return page of a security assessments list along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { + 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.")); + 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)); + 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 index 0e5cc1fb108d6..e0843e5ad7500 100644 --- 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 @@ -22,31 +22,30 @@ public final class AssessmentsImpl implements Assessments { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public AssessmentsImpl( - AssessmentsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + public AssessmentsImpl(AssessmentsClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list(String scope) { PagedIterable inner = this.serviceClient().list(scope); - return Utils.mapPage(inner, inner1 -> new SecurityAssessmentResponseImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new SecurityAssessmentResponseImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SecurityAssessmentResponseImpl(inner1, this.manager())); } - public Response getWithResponse( - String resourceId, String assessmentName, ExpandEnum expand, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceId, assessmentName, expand, context); + public Response getWithResponse(String resourceId, String assessmentName, + ExpandEnum expand, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceId, assessmentName, expand, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SecurityAssessmentResponseImpl(inner.getValue(), this.manager())); } else { return null; @@ -71,98 +70,66 @@ public void deleteByResourceGroup(String resourceId, String assessmentName) { } public SecurityAssessmentResponse getById(String id) { - String resourceId = - Utils - .getValueFromIdByParameterName( - id, "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", "resourceId"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); } - String assessmentName = - Utils - .getValueFromIdByParameterName( - id, "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", "assessmentName"); + 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))); + 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 = - Utils - .getValueFromIdByParameterName( - id, "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", "resourceId"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); } - String assessmentName = - Utils - .getValueFromIdByParameterName( - id, "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", "assessmentName"); + 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))); + 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 = - Utils - .getValueFromIdByParameterName( - id, "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", "resourceId"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); } - String assessmentName = - Utils - .getValueFromIdByParameterName( - id, "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", "assessmentName"); + 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))); + 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 = - Utils - .getValueFromIdByParameterName( - id, "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", "resourceId"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); } - String assessmentName = - Utils - .getValueFromIdByParameterName( - id, "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", "assessmentName"); + 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))); + 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); } 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 index 77bbc5dbcc388..31e296e55c852 100644 --- 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 @@ -33,193 +33,158 @@ import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataResponseList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in AssessmentsMetadatasClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final AssessmentsMetadatasService service; - /** The service client containing this operation class. */ + /** + * 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.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. + * The interface defining all the services for SecurityCenterAssessmentsMetadatas to be used by the proxy service + * to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "SecurityCenterAssess") public interface AssessmentsMetadatasService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Security/assessmentMetadata") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("assessmentMetadataName") String assessmentMetadataName, - @HeaderParam("Accept") String accept, + @PathParam("assessmentMetadataName") String assessmentMetadataName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscription( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> listBySubscription(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getInSubscription( - @HostParam("$host") String endpoint, + Mono> getInSubscription(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("assessmentMetadataName") String assessmentMetadataName, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> createInSubscription( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("assessmentMetadataName") String assessmentMetadataName, @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") SecurityAssessmentMetadataResponseInner assessmentMetadata, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteInSubscription( - @HostParam("$host") String endpoint, + Mono> deleteInSubscription(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("assessmentMetadataName") String assessmentMetadataName, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context 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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String apiVersion = "2021-06-01"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) + return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + res -> new 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}. + * {@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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.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}. @@ -231,7 +196,7 @@ private PagedFlux 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. @@ -240,13 +205,13 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, 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}. @@ -258,7 +223,7 @@ public 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 ManagementException thrown if the request is rejected by server. @@ -272,27 +237,24 @@ public PagedIterable list(Context conte /** * 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}. + * @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) { + 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.")); + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter assessmentMetadataName is required and cannot be null.")); } final String apiVersion = "2021-06-01"; final String accept = "application/json"; @@ -304,28 +266,25 @@ private Mono> getWithResponseA /** * 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}. + * @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) { + 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.")); + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter assessmentMetadataName is required and cannot be null.")); } final String apiVersion = "2021-06-01"; final String accept = "application/json"; @@ -335,7 +294,7 @@ private Mono> getWithResponseA /** * 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. @@ -349,7 +308,7 @@ private Mono getAsync(String assessment /** * 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. @@ -358,14 +317,14 @@ private Mono getAsync(String assessment * @return metadata information on an assessment type along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String assessmentMetadataName, Context context) { + 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. @@ -379,125 +338,100 @@ public SecurityAssessmentMetadataResponseInner get(String assessmentMetadataName /** * 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}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listBySubscription( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .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)) + res -> new 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}. + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionSinglePageAsync( - Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2021-06-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)); + .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}. + * @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)); + 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}. + * @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), + 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}. + * @return metadata information on all assessment types in a specific subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listBySubscription() { @@ -506,13 +440,13 @@ public 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 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}. + * @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) { @@ -521,103 +455,79 @@ public PagedIterable listBySubscription /** * 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}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getInSubscriptionWithResponseAsync( - String assessmentMetadataName) { + 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.")); + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter assessmentMetadataName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getInSubscription( - this.client.getEndpoint(), - apiVersion, - assessmentMetadataName, - this.client.getSubscriptionId(), - accept, - context)) + .withContext(context -> service.getInSubscription(this.client.getEndpoint(), apiVersion, + assessmentMetadataName, this.client.getSubscriptionId(), 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}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getInSubscriptionWithResponseAsync( - String assessmentMetadataName, Context context) { + 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.")); + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter assessmentMetadataName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getInSubscription( - this.client.getEndpoint(), - apiVersion, - assessmentMetadataName, - this.client.getSubscriptionId(), - accept, - context); + return service.getInSubscription(this.client.getEndpoint(), apiVersion, assessmentMetadataName, + this.client.getSubscriptionId(), 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}. + * @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) { @@ -627,7 +537,7 @@ private Mono getInSubscriptionAsync(Str /** * 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. @@ -636,14 +546,14 @@ private Mono getInSubscriptionAsync(Str * @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) { + 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. @@ -657,34 +567,29 @@ public SecurityAssessmentMetadataResponseInner getInSubscription(String assessme /** * 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}. + * @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.")); + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter assessmentMetadataName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (assessmentMetadata == null) { return Mono @@ -695,51 +600,37 @@ private Mono> createInSubscrip final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createInSubscription( - this.client.getEndpoint(), - apiVersion, - assessmentMetadataName, - this.client.getSubscriptionId(), - assessmentMetadata, - accept, - context)) + .withContext(context -> service.createInSubscription(this.client.getEndpoint(), apiVersion, + assessmentMetadataName, this.client.getSubscriptionId(), assessmentMetadata, accept, 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}. + * @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.")); + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter assessmentMetadataName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (assessmentMetadata == null) { return Mono @@ -750,20 +641,13 @@ private Mono> createInSubscrip final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createInSubscription( - this.client.getEndpoint(), - apiVersion, - assessmentMetadataName, - this.client.getSubscriptionId(), - assessmentMetadata, - accept, - context); + return service.createInSubscription(this.client.getEndpoint(), apiVersion, assessmentMetadataName, + this.client.getSubscriptionId(), assessmentMetadata, accept, 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. @@ -772,15 +656,15 @@ private Mono> createInSubscrip * @return security assessment metadata response on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createInSubscriptionAsync( - String assessmentMetadataName, SecurityAssessmentMetadataResponseInner assessmentMetadata) { + 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. @@ -797,7 +681,7 @@ public Response createInSubscriptionWit /** * 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. @@ -806,15 +690,15 @@ public Response createInSubscriptionWit * @return security assessment metadata response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityAssessmentMetadataResponseInner createInSubscription( - String assessmentMetadataName, SecurityAssessmentMetadataResponseInner assessmentMetadata) { + 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. @@ -824,42 +708,29 @@ public SecurityAssessmentMetadataResponseInner createInSubscription( @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.")); + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter assessmentMetadataName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2021-06-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .deleteInSubscription( - this.client.getEndpoint(), - apiVersion, - assessmentMetadataName, - this.client.getSubscriptionId(), - accept, - context)) + .withContext(context -> service.deleteInSubscription(this.client.getEndpoint(), apiVersion, + assessmentMetadataName, this.client.getSubscriptionId(), accept, 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. @@ -870,39 +741,28 @@ private Mono> deleteInSubscriptionWithResponseAsync(String assess @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.")); + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter assessmentMetadataName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2021-06-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .deleteInSubscription( - this.client.getEndpoint(), - apiVersion, - assessmentMetadataName, - this.client.getSubscriptionId(), - accept, - context); + return service.deleteInSubscription(this.client.getEndpoint(), apiVersion, assessmentMetadataName, + this.client.getSubscriptionId(), accept, 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. @@ -917,7 +777,7 @@ private Mono deleteInSubscriptionAsync(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. @@ -933,7 +793,7 @@ public Response deleteInSubscriptionWithResponse(String 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -946,14 +806,15 @@ public void deleteInSubscription(String assessmentMetadataName) { /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 security assessment metadata along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return list of security assessment metadata along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -961,140 +822,106 @@ private Mono> listNextSin 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.")); + 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)) + 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)) + res -> new 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 - *

The nextLink parameter. + * + * The nextLink 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 security assessment metadata along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return list of security assessment metadata along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { + 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.")); + 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)); + 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 - *

The nextLink parameter. + * + * The nextLink 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 security assessment metadata along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return list of security assessment metadata along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink) { + 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.")); + 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)) + res -> new 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 - *

The nextLink parameter. + * + * The nextLink 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 security assessment metadata along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return list of security assessment metadata along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { + 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.")); + 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)); + 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/AssessmentsMetadatasImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsMetadatasImpl.java index 5a878349df354..6ddb28434bef5 100644 --- 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 @@ -21,31 +21,30 @@ public final class AssessmentsMetadatasImpl implements AssessmentsMetadatas { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public AssessmentsMetadatasImpl( - AssessmentsMetadatasClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + public AssessmentsMetadatasImpl(AssessmentsMetadatasClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new SecurityAssessmentMetadataResponseImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SecurityAssessmentMetadataResponseImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new SecurityAssessmentMetadataResponseImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SecurityAssessmentMetadataResponseImpl(inner1, this.manager())); } - public Response getWithResponse( - String assessmentMetadataName, Context context) { - Response inner = - this.serviceClient().getWithResponse(assessmentMetadataName, context); + public Response getWithResponse(String assessmentMetadataName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(assessmentMetadataName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SecurityAssessmentMetadataResponseImpl(inner.getValue(), this.manager())); } else { return null; @@ -63,23 +62,22 @@ public SecurityAssessmentMetadataResponse get(String assessmentMetadataName) { public PagedIterable listBySubscription() { PagedIterable inner = this.serviceClient().listBySubscription(); - return Utils.mapPage(inner, inner1 -> new SecurityAssessmentMetadataResponseImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SecurityAssessmentMetadataResponseImpl(inner1, this.manager())); } public PagedIterable listBySubscription(Context context) { PagedIterable inner = this.serviceClient().listBySubscription(context); - return Utils.mapPage(inner, inner1 -> new SecurityAssessmentMetadataResponseImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SecurityAssessmentMetadataResponseImpl(inner1, this.manager())); } - public Response getInSubscriptionWithResponse( - String assessmentMetadataName, Context context) { - Response inner = - this.serviceClient().getInSubscriptionWithResponse(assessmentMetadataName, context); + public Response getInSubscriptionWithResponse(String assessmentMetadataName, + Context context) { + Response inner + = this.serviceClient().getInSubscriptionWithResponse(assessmentMetadataName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SecurityAssessmentMetadataResponseImpl(inner.getValue(), this.manager())); } else { return null; @@ -104,53 +102,37 @@ public void deleteInSubscription(String assessmentMetadataName) { } public SecurityAssessmentMetadataResponse getInSubscriptionById(String id) { - String assessmentMetadataName = Utils.getValueFromIdByName(id, "assessmentMetadata"); + 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))); + 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 = Utils.getValueFromIdByName(id, "assessmentMetadata"); + 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))); + 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 = Utils.getValueFromIdByName(id, "assessmentMetadata"); + 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))); + 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 = Utils.getValueFromIdByName(id, "assessmentMetadata"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'assessmentMetadata'.", id))); } return this.deleteInSubscriptionWithResponse(assessmentMetadataName, context); } 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 index 896c6cbf97910..8837be6b785c8 100644 --- 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 @@ -14,8 +14,8 @@ public final class AutoProvisioningSettingImpl implements AutoProvisioningSettin private final com.azure.resourcemanager.security.SecurityManager serviceManager; - AutoProvisioningSettingImpl( - AutoProvisioningSettingInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + AutoProvisioningSettingImpl(AutoProvisioningSettingInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -47,22 +47,14 @@ private com.azure.resourcemanager.security.SecurityManager manager() { private String settingName; public AutoProvisioningSetting create() { - this.innerObject = - serviceManager - .serviceClient() - .getAutoProvisioningSettings() - .createWithResponse(settingName, this.innerModel(), Context.NONE) - .getValue(); + 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(); + this.innerObject = serviceManager.serviceClient().getAutoProvisioningSettings() + .createWithResponse(settingName, this.innerModel(), context).getValue(); return this; } @@ -73,22 +65,14 @@ public AutoProvisioningSetting create(Context context) { } public AutoProvisioningSetting refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getAutoProvisioningSettings() - .getWithResponse(settingName, Context.NONE) - .getValue(); + 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(); + this.innerObject = serviceManager.serviceClient().getAutoProvisioningSettings() + .getWithResponse(settingName, context).getValue(); 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 index 9c600ec6bd5db..d5562f17e13fc 100644 --- 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 @@ -32,23 +32,28 @@ import com.azure.resourcemanager.security.models.AutoProvisioningSettingList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in AutoProvisioningSettingsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final AutoProvisioningSettingsService service; - /** The service client containing this operation class. */ + /** + * 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.service = RestProxy.create(AutoProvisioningSettingsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -59,137 +64,100 @@ public final class AutoProvisioningSettingsClientImpl implements AutoProvisionin @Host("{$host}") @ServiceInterface(name = "SecurityCenterAutoPr") public interface AutoProvisioningSettingsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("settingName") String settingName, - @HeaderParam("Accept") String accept, - Context context); + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("settingName") String settingName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("settingName") String settingName, - @BodyParam("application/json") AutoProvisioningSettingInner setting, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") AutoProvisioningSettingInner setting, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context 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 along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)) + .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}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)); + 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}. @@ -201,7 +169,7 @@ private PagedFlux 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. @@ -210,13 +178,13 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, 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}. @@ -228,7 +196,7 @@ public 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 ManagementException thrown if the request is rejected by server. @@ -242,7 +210,7 @@ public PagedIterable list(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. @@ -252,16 +220,12 @@ public PagedIterable list(Context context) { @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -269,22 +233,14 @@ private Mono> getWithResponseAsync(String 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)) + .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. @@ -295,16 +251,12 @@ private Mono> getWithResponseAsync(String @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -312,13 +264,13 @@ private Mono> getWithResponseAsync(String 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); + 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. @@ -332,7 +284,7 @@ private Mono getAsync(String settingName) { /** * 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. @@ -347,7 +299,7 @@ public Response getWithResponse(String settingName /** * 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. @@ -361,7 +313,7 @@ public AutoProvisioningSettingInner get(String settingName) { /** * 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. @@ -370,19 +322,15 @@ public AutoProvisioningSettingInner get(String settingName) { * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -395,23 +343,14 @@ private Mono> createWithResponseAsync( final String apiVersion = "2017-08-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - settingName, - setting, - accept, - context)) + .withContext(context -> service.create(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), settingName, setting, accept, 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. @@ -421,19 +360,15 @@ private Mono> createWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -446,20 +381,13 @@ private Mono> createWithResponseAsync( final String apiVersion = "2017-08-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - settingName, - setting, - accept, - context); + return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), settingName, + setting, accept, 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. @@ -474,7 +402,7 @@ private Mono createAsync(String settingName, AutoP /** * 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. @@ -484,14 +412,14 @@ private Mono createAsync(String settingName, AutoP * @return auto provisioning setting along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String settingName, AutoProvisioningSettingInner setting, Context context) { + 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. @@ -506,14 +434,15 @@ public AutoProvisioningSettingInner create(String settingName, AutoProvisioningS /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 all the auto provisioning settings response along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -521,62 +450,43 @@ private Mono> listNextSinglePageAsyn 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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 all the auto provisioning settings response along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { + 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.")); + 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)); + 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 index 7d284eeb293ee..6f422238d33ed 100644 --- 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 @@ -21,29 +21,26 @@ public final class AutoProvisioningSettingsImpl implements AutoProvisioningSetti private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public AutoProvisioningSettingsImpl( - AutoProvisioningSettingsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + public AutoProvisioningSettingsImpl(AutoProvisioningSettingsClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new AutoProvisioningSettingImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AutoProvisioningSettingImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new AutoProvisioningSettingImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AutoProvisioningSettingImpl(inner1, this.manager())); } public Response getWithResponse(String settingName, Context context) { Response inner = this.serviceClient().getWithResponse(settingName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new AutoProvisioningSettingImpl(inner.getValue(), this.manager())); } else { return null; @@ -60,29 +57,19 @@ public AutoProvisioningSetting get(String settingName) { } public AutoProvisioningSetting getById(String id) { - String settingName = Utils.getValueFromIdByName(id, "autoProvisioningSettings"); + 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))); + 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 = Utils.getValueFromIdByName(id, "autoProvisioningSettings"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'autoProvisioningSettings'.", id))); } return this.getWithResponse(settingName, context); } 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 index 1fe4c63468b08..28fdf882a3d21 100644 --- 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 @@ -12,6 +12,7 @@ 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; @@ -106,28 +107,22 @@ private com.azure.resourcemanager.security.SecurityManager manager() { 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(); + 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(); + this.innerObject = serviceManager.serviceClient().getAutomations() + .createOrUpdateWithResponse(resourceGroupName, automationName, this.innerModel(), context).getValue(); return this; } @@ -138,60 +133,44 @@ public Automation create(Context context) { } public AutomationImpl update() { + this.updateAutomation = new AutomationUpdateModel(); return this; } public Automation apply() { - this.innerObject = - serviceManager - .serviceClient() - .getAutomations() - .createOrUpdateWithResponse(resourceGroupName, automationName, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getAutomations() + .updateWithResponse(resourceGroupName, automationName, updateAutomation, Context.NONE).getValue(); return this; } public Automation apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getAutomations() - .createOrUpdateWithResponse(resourceGroupName, automationName, this.innerModel(), context) - .getValue(); + 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 = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.automationName = Utils.getValueFromIdByName(innerObject.id(), "automations"); + 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(); + 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(); + 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); + return serviceManager.automations().validateWithResponse(resourceGroupName, automationName, automation, + context); } public AutomationValidationStatus validate(AutomationInner automation) { @@ -209,32 +188,66 @@ public AutomationImpl withRegion(String location) { } public AutomationImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateAutomation.withTags(tags); + return this; + } } public AutomationImpl withDescription(String description) { - this.innerModel().withDescription(description); - return this; + if (isInCreateMode()) { + this.innerModel().withDescription(description); + return this; + } else { + this.updateAutomation.withDescription(description); + return this; + } } public AutomationImpl withIsEnabled(Boolean isEnabled) { - this.innerModel().withIsEnabled(isEnabled); - return this; + if (isInCreateMode()) { + this.innerModel().withIsEnabled(isEnabled); + return this; + } else { + this.updateAutomation.withIsEnabled(isEnabled); + return this; + } } public AutomationImpl withScopes(List scopes) { - this.innerModel().withScopes(scopes); - return this; + if (isInCreateMode()) { + this.innerModel().withScopes(scopes); + return this; + } else { + this.updateAutomation.withScopes(scopes); + return this; + } } public AutomationImpl withSources(List sources) { - this.innerModel().withSources(sources); - return this; + if (isInCreateMode()) { + this.innerModel().withSources(sources); + return this; + } else { + this.updateAutomation.withSources(sources); + return this; + } } public AutomationImpl withActions(List actions) { - this.innerModel().withActions(actions); - return this; + if (isInCreateMode()) { + this.innerModel().withActions(actions); + return this; + } else { + this.updateAutomation.withActions(actions); + return this; + } + } + + private boolean isInCreateMode() { + return 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 index 5e3c49c7e027c..62257fd6317d7 100644 --- 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 @@ -12,8 +12,7 @@ public final class AutomationValidationStatusImpl implements AutomationValidatio private final com.azure.resourcemanager.security.SecurityManager serviceManager; - AutomationValidationStatusImpl( - AutomationValidationStatusInner innerObject, + AutomationValidationStatusImpl(AutomationValidationStatusInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 index 2348e654c1b27..b2701ff23fdc8 100644 --- 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 @@ -12,6 +12,7 @@ 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; @@ -33,24 +34,31 @@ import com.azure.resourcemanager.security.fluent.models.AutomationInner; import com.azure.resourcemanager.security.fluent.models.AutomationValidationStatusInner; import com.azure.resourcemanager.security.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. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final AutomationsService service; - /** The service client containing this operation class. */ + /** + * 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.service + = RestProxy.create(AutomationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -61,196 +69,152 @@ public final class AutomationsClientImpl implements AutomationsClient { @Host("{$host}") @ServiceInterface(name = "SecurityCenterAutoma") public interface AutomationsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/automations") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") 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.Security/automations") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("automationName") String automationName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("automationName") String automationName, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") AutomationInner automation, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("automationName") String automationName, - @BodyParam("application/json") AutomationInner automation, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") AutomationUpdateModel automation, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}") - @ExpectedResponses({204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") 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); + @PathParam("automationName") String automationName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}/validate") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}/validate") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> validate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> validate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("automationName") String automationName, - @BodyParam("application/json") AutomationInner automation, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") AutomationInner automation, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, 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 ManagementException thrown 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}. + * @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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 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)) + .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}. + * @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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 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)); + 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}. @@ -263,7 +227,7 @@ private PagedFlux 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. @@ -272,14 +236,14 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, 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}. @@ -292,7 +256,7 @@ public 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 ManagementException thrown if the request is rejected by server. @@ -307,118 +271,83 @@ public PagedIterable list(Context 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 within the user's subscription. The name is case - * insensitive. + * 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}. + * @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.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-01-01-preview"; + 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)) + .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 within the user's subscription. The name is case - * insensitive. + * 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}. + * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.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-01-01-preview"; + 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)); + .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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -426,17 +355,16 @@ private Mono> listByResourceGroupSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -445,17 +373,16 @@ private PagedFlux listByResourceGroupAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -469,9 +396,9 @@ public PagedIterable listByResourceGroup(String resourceGroupNa /** * 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -485,9 +412,9 @@ public PagedIterable listByResourceGroup(String resourceGroupNa /** * Retrieves information about the model of a security automation. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -495,19 +422,15 @@ public PagedIterable listByResourceGroup(String resourceGroupNa * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -516,28 +439,19 @@ private Mono> getByResourceGroupWithResponseAsync( if (automationName == null) { return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); } - final String apiVersion = "2019-01-01-preview"; + 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)) + .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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param automationName The security automation name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -546,19 +460,15 @@ private Mono> getByResourceGroupWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -567,25 +477,18 @@ private Mono> getByResourceGroupWithResponseAsync( if (automationName == null) { return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); } - final String apiVersion = "2019-01-01-preview"; + 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); + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -600,9 +503,9 @@ private Mono getByResourceGroupAsync(String resourceGroupName, /** * Retrieves information about the model of a security automation. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param automationName The security automation name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -611,16 +514,16 @@ private Mono getByResourceGroupAsync(String resourceGroupName, * @return the security automation resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String automationName, Context context) { + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -635,9 +538,9 @@ public AutomationInner getByResourceGroup(String resourceGroupName, String autom /** * 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param automationName The security automation name. * @param automation The security automation resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -646,19 +549,15 @@ public AutomationInner getByResourceGroup(String resourceGroupName, String autom * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -672,30 +571,20 @@ private Mono> createOrUpdateWithResponseAsync( } else { automation.validate(); } - final String apiVersion = "2019-01-01-preview"; + final String apiVersion = "2023-12-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - automationName, - automation, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, automationName, automation, accept, 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param automationName The security automation name. * @param automation The security automation resource. * @param context The context to associate with this operation. @@ -705,19 +594,15 @@ private Mono> createOrUpdateWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -731,27 +616,19 @@ private Mono> createOrUpdateWithResponseAsync( } else { automation.validate(); } - final String apiVersion = "2019-01-01-preview"; + final String apiVersion = "2023-12-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - automationName, - automation, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, automationName, automation, accept, 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param automationName The security automation name. * @param automation The security automation resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -760,8 +637,8 @@ private Mono> createOrUpdateWithResponseAsync( * @return the security automation resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String automationName, AutomationInner automation) { + private Mono createOrUpdateAsync(String resourceGroupName, String automationName, + AutomationInner automation) { return createOrUpdateWithResponseAsync(resourceGroupName, automationName, automation) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -769,9 +646,9 @@ private Mono createOrUpdateAsync( /** * 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param automationName The security automation name. * @param automation The security automation resource. * @param context The context to associate with this operation. @@ -781,17 +658,17 @@ private Mono createOrUpdateAsync( * @return the security automation resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String automationName, AutomationInner automation, Context context) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param automationName The security automation name. * @param automation The security automation resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -804,11 +681,152 @@ public AutomationInner createOrUpdate(String resourceGroupName, String automatio return createOrUpdateWithResponse(resourceGroupName, automationName, automation, Context.NONE).getValue(); } + /** + * Updates a security automation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, automationName, automation, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a security automation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + automationName, automation, accept, context); + } + + /** + * Updates a security automation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. 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 within the user's subscription. 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 within the user's subscription. 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -818,16 +836,12 @@ public AutomationInner createOrUpdate(String resourceGroupName, String automatio @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -836,28 +850,19 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (automationName == null) { return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); } - final String apiVersion = "2019-01-01-preview"; + final String apiVersion = "2023-12-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - automationName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, automationName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes a security automation. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param automationName The security automation name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -866,19 +871,15 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String automationName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -887,25 +888,18 @@ private Mono> deleteWithResponseAsync( if (automationName == null) { return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); } - final String apiVersion = "2019-01-01-preview"; + final String apiVersion = "2023-12-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - automationName, - accept, - context); + return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + automationName, accept, context); } /** * Deletes a security automation. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -919,9 +913,9 @@ private Mono deleteAsync(String resourceGroupName, String automationName) /** * Deletes a security automation. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param automationName The security automation name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -936,9 +930,9 @@ public Response deleteWithResponse(String resourceGroupName, String automa /** * Deletes a security automation. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -952,31 +946,27 @@ public void delete(String resourceGroupName, String automationName) { /** * 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 within the user's subscription. The name is case - * insensitive. + * 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateWithResponseAsync( - String resourceGroupName, String automationName, AutomationInner automation) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -990,30 +980,20 @@ private Mono> validateWithResponseAsyn } else { automation.validate(); } - final String apiVersion = "2019-01-01-preview"; + final String apiVersion = "2023-12-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .validate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - automationName, - automation, - accept, - context)) + .withContext(context -> service.validate(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, automationName, automation, accept, 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param automationName The security automation name. * @param automation The security automation resource. * @param context The context to associate with this operation. @@ -1021,22 +1001,18 @@ private Mono> validateWithResponseAsyn * @throws ManagementException 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateWithResponseAsync( - String resourceGroupName, String automationName, AutomationInner automation, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1050,27 +1026,19 @@ private Mono> validateWithResponseAsyn } else { automation.validate(); } - final String apiVersion = "2019-01-01-preview"; + final String apiVersion = "2023-12-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .validate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - automationName, - automation, - accept, - context); + return service.validate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, automationName, automation, accept, 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param automationName The security automation name. * @param automation The security automation resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1079,8 +1047,8 @@ private Mono> validateWithResponseAsyn * @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) { + private Mono validateAsync(String resourceGroupName, String automationName, + AutomationInner automation) { return validateWithResponseAsync(resourceGroupName, automationName, automation) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -1088,9 +1056,9 @@ private Mono validateAsync( /** * 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param automationName The security automation name. * @param automation The security automation resource. * @param context The context to associate with this operation. @@ -1100,17 +1068,17 @@ private Mono validateAsync( * @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) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param automationName The security automation name. * @param automation The security automation resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1119,21 +1087,22 @@ public Response validateWithResponse( * @return the security automation model state property bag. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AutomationValidationStatusInner validate( - String resourceGroupName, String automationName, AutomationInner automation) { + 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 - *

The nextLink parameter. + * + * The nextLink 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 security automations response along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @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) { @@ -1141,37 +1110,28 @@ private Mono> listNextSinglePageAsync(String next 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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 security automations response along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @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) { @@ -1179,36 +1139,27 @@ private Mono> listNextSinglePageAsync(String next 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.")); + 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)); + 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 - *

The nextLink parameter. + * + * The nextLink 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 security automations response along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @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) { @@ -1216,63 +1167,45 @@ private Mono> listByResourceGroupNextSinglePageAs 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.")); + 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)) + .>map(res -> new 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 - *

The nextLink parameter. + * + * The nextLink 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 security automations response along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @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) { + 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.")); + 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)); + 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/AutomationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationsImpl.java index b0ab5eaeb2e0c..e76dfb3dd1cb0 100644 --- 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 @@ -23,41 +23,38 @@ public final class AutomationsImpl implements Automations { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public AutomationsImpl( - AutomationsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + public AutomationsImpl(AutomationsClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new AutomationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AutomationImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new AutomationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AutomationImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new AutomationImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new AutomationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AutomationImpl(inner1, this.manager())); } - public Response getByResourceGroupWithResponse( - String resourceGroupName, String automationName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, automationName, context); + public Response getByResourceGroupWithResponse(String resourceGroupName, String automationName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, automationName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new AutomationImpl(inner.getValue(), this.manager())); } else { return null; @@ -73,8 +70,8 @@ public Automation getByResourceGroup(String resourceGroupName, String automation } } - public Response deleteByResourceGroupWithResponse( - String resourceGroupName, String automationName, Context context) { + public Response deleteByResourceGroupWithResponse(String resourceGroupName, String automationName, + Context context) { return this.serviceClient().deleteWithResponse(resourceGroupName, automationName, context); } @@ -82,25 +79,22 @@ public void deleteByResourceGroup(String resourceGroupName, String automationNam this.serviceClient().delete(resourceGroupName, automationName); } - public Response validateWithResponse( - String resourceGroupName, String automationName, AutomationInner automation, Context context) { - Response inner = - this.serviceClient().validateWithResponse(resourceGroupName, automationName, automation, context); + public Response validateWithResponse(String resourceGroupName, String automationName, + AutomationInner automation, Context context) { + Response inner + = this.serviceClient().validateWithResponse(resourceGroupName, automationName, automation, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new AutomationValidationStatusImpl(inner.getValue(), this.manager())); } else { return null; } } - public AutomationValidationStatus validate( - String resourceGroupName, String automationName, AutomationInner automation) { - AutomationValidationStatusInner inner = - this.serviceClient().validate(resourceGroupName, automationName, automation); + 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 { @@ -109,77 +103,57 @@ public AutomationValidationStatus validate( } public Automation getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String automationName = Utils.getValueFromIdByName(id, "automations"); + 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))); + 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 = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String automationName = Utils.getValueFromIdByName(id, "automations"); + 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))); + 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 = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String automationName = Utils.getValueFromIdByName(id, "automations"); + 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))); + 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 = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String automationName = Utils.getValueFromIdByName(id, "automations"); + 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))); + 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); } 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 new file mode 100644 index 0000000000000..5a09e1d2d7884 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgImpl.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public AzureDevOpsOrgProperties properties() { + return this.innerModel().properties(); + } + + 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 new file mode 100644 index 0000000000000..300da645bf6b1 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgListResponseImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 new file mode 100644 index 0000000000000..05e97549792a6 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgsClientImpl.java @@ -0,0 +1,1105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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("{$host}") + @ServiceInterface(name = "SecurityCenterAzureD") + public interface AzureDevOpsOrgsService { + @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("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, 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("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @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("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AzureDevOpsOrgInner azureDevOpsOrg, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AzureDevOpsOrgInner azureDevOpsOrg, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * 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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listAvailable(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, apiVersion, 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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listAvailable(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + securityConnectorName, apiVersion, 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. + * + * @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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, 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())); + } + + /** + * 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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, + apiVersion, 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 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 Azure DevOps organization 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 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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, orgName, apiVersion, 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 Azure DevOps organization 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 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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + securityConnectorName, orgName, apiVersion, 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 Azure DevOps organization 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 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 Azure DevOps organization 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 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 Azure DevOps organization 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 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 Azure DevOps organization name. + * @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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, orgName, apiVersion, azureDevOpsOrg, accept, 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 Azure DevOps organization name. + * @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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + securityConnectorName, orgName, apiVersion, azureDevOpsOrg, accept, 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 Azure DevOps organization name. + * @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 Azure DevOps organization name. + * @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 Azure DevOps organization name. + * @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 Azure DevOps organization name. + * @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 Azure DevOps organization name. + * @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 Azure DevOps organization name. + * @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 Azure DevOps organization name. + * @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 Azure DevOps organization name. + * @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 Azure DevOps organization name. + * @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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, orgName, apiVersion, azureDevOpsOrg, accept, 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 Azure DevOps organization name. + * @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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + securityConnectorName, orgName, apiVersion, azureDevOpsOrg, accept, 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 Azure DevOps organization name. + * @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 Azure DevOps organization name. + * @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 Azure DevOps organization name. + * @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 Azure DevOps organization name. + * @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 Azure DevOps organization name. + * @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 Azure DevOps organization name. + * @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 Azure DevOps organization name. + * @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 Azure DevOps organization name. + * @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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink 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> 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 + * + * The nextLink 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> 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 new file mode 100644 index 0000000000000..a51d49dabb6eb --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgsImpl.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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 listAvailableWithResponse(String resourceGroupName, + String securityConnectorName, Context context) { + Response inner + = this.serviceClient().listAvailableWithResponse(resourceGroupName, securityConnectorName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AzureDevOpsOrgListResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 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 getWithResponse(String resourceGroupName, String securityConnectorName, + String orgName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, securityConnectorName, orgName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AzureDevOpsOrgImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 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 new file mode 100644 index 0000000000000..140d8d0d8286e --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectImpl.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public AzureDevOpsProjectProperties properties() { + return this.innerModel().properties(); + } + + 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 new file mode 100644 index 0000000000000..0dda863a85d79 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectsClientImpl.java @@ -0,0 +1,1049 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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.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("{$host}") + @ServiceInterface(name = "SecurityCenterAzureD") + public interface AzureDevOpsProjectsService { + @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("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @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("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, + @PathParam("projectName") String projectName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @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("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, + @PathParam("projectName") String projectName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AzureDevOpsProjectInner azureDevOpsProject, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @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("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, + @PathParam("projectName") String projectName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AzureDevOpsProjectInner azureDevOpsProject, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * 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 Azure DevOps organization 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, 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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, orgName, 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())); + } + + /** + * 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 Azure DevOps organization 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, 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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, + orgName, apiVersion, 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 Azure DevOps organization 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, + 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 Azure DevOps organization 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, + 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 Azure DevOps organization 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, + 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 Azure DevOps organization 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, + String orgName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, orgName, 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 Azure DevOps organization name. + * @param projectName The project 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 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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, orgName, projectName, apiVersion, 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 Azure DevOps organization name. + * @param projectName The project 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 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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + securityConnectorName, orgName, projectName, apiVersion, 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 Azure DevOps organization name. + * @param projectName The project 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 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 Azure DevOps organization name. + * @param projectName The project 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 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 Azure DevOps organization name. + * @param projectName The project 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 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 Azure DevOps organization name. + * @param projectName The project name. + * @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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, orgName, projectName, apiVersion, azureDevOpsProject, accept, + 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 Azure DevOps organization name. + * @param projectName The project name. + * @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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + securityConnectorName, orgName, projectName, apiVersion, azureDevOpsProject, accept, 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 Azure DevOps organization name. + * @param projectName The project name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + securityConnectorName, orgName, projectName, apiVersion, azureDevOpsProject, accept, 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 Azure DevOps organization name. + * @param projectName The project name. + * @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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + securityConnectorName, orgName, projectName, apiVersion, azureDevOpsProject, accept, 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 Azure DevOps organization name. + * @param projectName The project name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink 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> 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 + * + * The nextLink 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> 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 new file mode 100644 index 0000000000000..444c613d071cc --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectsImpl.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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 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 Response getWithResponse(String resourceGroupName, String securityConnectorName, + String orgName, String projectName, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceGroupName, + securityConnectorName, orgName, projectName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AzureDevOpsProjectImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 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 new file mode 100644 index 0000000000000..7b363074e298e --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsReposClientImpl.java @@ -0,0 +1,1117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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.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("{$host}") + @ServiceInterface(name = "SecurityCenterAzureD") + 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") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, + @PathParam("projectName") String projectName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @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("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, + @PathParam("projectName") String projectName, @PathParam("repoName") String repoName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @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("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, + @PathParam("projectName") String projectName, @PathParam("repoName") String repoName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AzureDevOpsRepositoryInner azureDevOpsRepository, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @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("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, + @PathParam("projectName") String projectName, @PathParam("repoName") String repoName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AzureDevOpsRepositoryInner azureDevOpsRepository, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * 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 Azure DevOps organization name. + * @param projectName The project 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, 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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, orgName, projectName, 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())); + } + + /** + * 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 Azure DevOps organization name. + * @param projectName The project 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, 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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, + orgName, projectName, apiVersion, 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 Azure DevOps organization name. + * @param projectName The project 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, + 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 Azure DevOps organization name. + * @param projectName The project 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, + 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 Azure DevOps organization name. + * @param projectName The project 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, + 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 Azure DevOps organization name. + * @param projectName The project 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, + String orgName, String projectName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, orgName, projectName, 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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository 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 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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, orgName, projectName, repoName, apiVersion, 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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository 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 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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + securityConnectorName, orgName, projectName, repoName, apiVersion, 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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository 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 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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository 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 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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository 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 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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, orgName, projectName, repoName, apiVersion, + azureDevOpsRepository, accept, 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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + securityConnectorName, orgName, projectName, repoName, apiVersion, azureDevOpsRepository, accept, 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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, orgName, projectName, repoName, apiVersion, + azureDevOpsRepository, accept, 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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + securityConnectorName, orgName, projectName, repoName, apiVersion, azureDevOpsRepository, accept, 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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository name. + * @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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink 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> 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 + * + * The nextLink 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> 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 new file mode 100644 index 0000000000000..53627f6d38224 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsReposImpl.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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 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 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); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AzureDevOpsRepositoryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 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 new file mode 100644 index 0000000000000..752131e4ded17 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsRepositoryImpl.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public AzureDevOpsRepositoryProperties properties() { + return this.innerModel().properties(); + } + + 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/ComplianceResultImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceResultImpl.java index dd6a7518892a3..1d8255952a275 100644 --- 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 @@ -13,8 +13,8 @@ public final class ComplianceResultImpl implements ComplianceResult { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - ComplianceResultImpl( - ComplianceResultInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + ComplianceResultImpl(ComplianceResultInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 index 94eef1b3a1f7c..da654a6b037da 100644 --- 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 @@ -30,22 +30,28 @@ import com.azure.resourcemanager.security.models.ComplianceResultList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ComplianceResultsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final ComplianceResultsService service; - /** The service client containing this operation class. */ + /** + * 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.service + = RestProxy.create(ComplianceResultsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -56,58 +62,48 @@ public final class ComplianceResultsClientImpl implements ComplianceResultsClien @Host("{$host}") @ServiceInterface(name = "SecurityCenterCompli") public interface ComplianceResultsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/{scope}/providers/Microsoft.Security/complianceResults") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") 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"}) + @Headers({ "Content-Type: application/json" }) @Get("/{resourceId}/providers/Microsoft.Security/complianceResults/{complianceResultName}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("complianceResultName") String complianceResultName, - @HeaderParam("Accept") String accept, + @PathParam("complianceResultName") String complianceResultName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Security compliance results in the subscription. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @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.")); + 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.")); @@ -116,37 +112,28 @@ private Mono> listSinglePageAsync(String sc 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)) + .>map(res -> new 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 Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @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.")); + 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.")); @@ -154,24 +141,16 @@ private Mono> listSinglePageAsync(String sc 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)); + 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 Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -184,9 +163,9 @@ private PagedFlux listAsync(String scope) { /** * Security compliance results in the subscription. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -195,15 +174,15 @@ private PagedFlux listAsync(String scope) { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String scope, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(scope, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(scope, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Security compliance results in the subscription. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -216,9 +195,9 @@ public PagedIterable list(String scope) { /** * Security compliance results in the subscription. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -232,7 +211,7 @@ public PagedIterable list(String scope, Context context) /** * Security Compliance Result. - * + * * @param resourceId The identifier of the resource. * @param complianceResultName name of the desired assessment compliance result. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -243,10 +222,8 @@ public PagedIterable list(String scope, Context context) @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.")); + 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.")); @@ -258,16 +235,14 @@ private Mono> getWithResponseAsync(String resour 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)) + .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 identifier of the resource. * @param complianceResultName name of the desired assessment compliance result. * @param context The context to associate with this operation. @@ -277,13 +252,11 @@ private Mono> getWithResponseAsync(String resour * @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) { + 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.")); + 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.")); @@ -300,7 +273,7 @@ private Mono> getWithResponseAsync( /** * Security Compliance Result. - * + * * @param resourceId The identifier of the resource. * @param complianceResultName name of the desired assessment compliance result. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -315,7 +288,7 @@ private Mono getAsync(String resourceId, String complianc /** * Security Compliance Result. - * + * * @param resourceId The identifier of the resource. * @param complianceResultName name of the desired assessment compliance result. * @param context The context to associate with this operation. @@ -325,14 +298,14 @@ private Mono getAsync(String resourceId, String complianc * @return a compliance result along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceId, String complianceResultName, Context context) { + public Response getWithResponse(String resourceId, String complianceResultName, + Context context) { return getWithResponseAsync(resourceId, complianceResultName, context).block(); } /** * Security Compliance Result. - * + * * @param resourceId The identifier of the resource. * @param complianceResultName name of the desired assessment compliance result. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -347,14 +320,15 @@ public ComplianceResultInner get(String resourceId, String complianceResultName) /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 compliance results response along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @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) { @@ -362,37 +336,28 @@ private Mono> listNextSinglePageAsync(Strin 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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 compliance results response along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @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) { @@ -400,23 +365,13 @@ private Mono> listNextSinglePageAsync(Strin 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.")); + 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)); + 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 index 2aa80fd05d011..ec52ed5b3f21c 100644 --- 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 @@ -21,30 +21,27 @@ public final class ComplianceResultsImpl implements ComplianceResults { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public ComplianceResultsImpl( - ComplianceResultsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + public ComplianceResultsImpl(ComplianceResultsClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list(String scope) { PagedIterable inner = this.serviceClient().list(scope); - return Utils.mapPage(inner, inner1 -> new ComplianceResultImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new ComplianceResultImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ComplianceResultImpl(inner1, this.manager())); } public Response getWithResponse(String resourceId, String complianceResultName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceId, complianceResultName, context); + Response inner + = this.serviceClient().getWithResponse(resourceId, complianceResultName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ComplianceResultImpl(inner.getValue(), this.manager())); } else { return null; 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 index 9dc3ac51dad76..bf5115ad78b8d 100644 --- 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 @@ -30,22 +30,28 @@ import com.azure.resourcemanager.security.models.ComplianceList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in CompliancesClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final CompliancesService service; - /** The service client containing this operation class. */ + /** + * 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.service + = RestProxy.create(CompliancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -56,58 +62,46 @@ public final class CompliancesClientImpl implements CompliancesClient { @Host("{$host}") @ServiceInterface(name = "SecurityCenterCompli") public interface CompliancesService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/{scope}/providers/Microsoft.Security/compliances") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") 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"}) + @Headers({ "Content-Type: application/json" }) @Get("/{scope}/providers/Microsoft.Security/compliances/{complianceName}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("complianceName") String complianceName, - @HeaderParam("Accept") String accept, - Context context); + Mono> get(@HostParam("$host") 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"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * The Compliance scores of the specific management group. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @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.")); + 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.")); @@ -116,37 +110,28 @@ private Mono> listSinglePageAsync(String scope) { 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)) + .>map(res -> new 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 Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @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.")); + 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.")); @@ -154,24 +139,16 @@ private Mono> listSinglePageAsync(String scope, C 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)); + 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 Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -184,9 +161,9 @@ private PagedFlux listAsync(String scope) { /** * The Compliance scores of the specific management group. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -195,15 +172,15 @@ private PagedFlux listAsync(String scope) { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String scope, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(scope, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(scope, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * The Compliance scores of the specific management group. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -216,9 +193,9 @@ public PagedIterable list(String scope) { /** * The Compliance scores of the specific management group. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -232,9 +209,9 @@ public PagedIterable list(String scope, Context context) { /** * Details of a specific Compliance. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param complianceName name of the Compliance. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -244,10 +221,8 @@ public PagedIterable list(String scope, Context context) { @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.")); + 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.")); @@ -265,9 +240,9 @@ private Mono> getWithResponseAsync(String scope, Strin /** * Details of a specific Compliance. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param complianceName name of the Compliance. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -278,10 +253,8 @@ private Mono> getWithResponseAsync(String scope, Strin @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.")); + 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.")); @@ -297,9 +270,9 @@ private Mono> getWithResponseAsync(String scope, Strin /** * Details of a specific Compliance. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param complianceName name of the Compliance. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -313,9 +286,9 @@ private Mono getAsync(String scope, String complianceName) { /** * Details of a specific Compliance. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param complianceName name of the Compliance. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -330,9 +303,9 @@ public Response getWithResponse(String scope, String compliance /** * Details of a specific Compliance. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param complianceName name of the Compliance. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -346,14 +319,15 @@ public ComplianceInner get(String scope, String complianceName) { /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 Compliance objects response along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @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) { @@ -361,37 +335,28 @@ private Mono> listNextSinglePageAsync(String next 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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 Compliance objects response along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @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) { @@ -399,23 +364,13 @@ private Mono> listNextSinglePageAsync(String next 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.")); + 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)); + 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 index b8e4641782c32..e66593bba785e 100644 --- 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 @@ -21,29 +21,26 @@ public final class CompliancesImpl implements Compliances { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public CompliancesImpl( - CompliancesClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + public CompliancesImpl(CompliancesClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list(String scope) { PagedIterable inner = this.serviceClient().list(scope); - return Utils.mapPage(inner, inner1 -> new ComplianceImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new ComplianceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ComplianceImpl(inner1, this.manager())); } public Response getWithResponse(String scope, String complianceName, Context context) { Response inner = this.serviceClient().getWithResponse(scope, complianceName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ComplianceImpl(inner.getValue(), this.manager())); } else { return null; diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectionStringsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectionStringsImpl.java deleted file mode 100644 index 9014f64c6f6b6..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectionStringsImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.ConnectionStringsInner; -import com.azure.resourcemanager.security.models.ConnectionStrings; -import com.azure.resourcemanager.security.models.IngestionConnectionString; -import java.util.Collections; -import java.util.List; - -public final class ConnectionStringsImpl implements ConnectionStrings { - private ConnectionStringsInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ConnectionStringsImpl( - ConnectionStringsInner 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 ConnectionStringsInner 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/ConnectorSettingImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorSettingImpl.java index 8fdafd0a7a493..0bcb75c18b2a1 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorSettingImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorSettingImpl.java @@ -47,22 +47,14 @@ private com.azure.resourcemanager.security.SecurityManager manager() { private String connectorName; public ConnectorSetting create() { - this.innerObject = - serviceManager - .serviceClient() - .getConnectors() - .createOrUpdateWithResponse(connectorName, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getConnectors() + .createOrUpdateWithResponse(connectorName, this.innerModel(), Context.NONE).getValue(); return this; } public ConnectorSetting create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getConnectors() - .createOrUpdateWithResponse(connectorName, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getConnectors() + .createOrUpdateWithResponse(connectorName, this.innerModel(), context).getValue(); return this; } @@ -77,41 +69,33 @@ public ConnectorSettingImpl update() { } public ConnectorSetting apply() { - this.innerObject = - serviceManager - .serviceClient() - .getConnectors() - .createOrUpdateWithResponse(connectorName, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getConnectors() + .createOrUpdateWithResponse(connectorName, this.innerModel(), Context.NONE).getValue(); return this; } public ConnectorSetting apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getConnectors() - .createOrUpdateWithResponse(connectorName, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getConnectors() + .createOrUpdateWithResponse(connectorName, this.innerModel(), context).getValue(); return this; } - ConnectorSettingImpl( - ConnectorSettingInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + ConnectorSettingImpl(ConnectorSettingInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.connectorName = Utils.getValueFromIdByName(innerObject.id(), "connectors"); + this.connectorName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "connectors"); } public ConnectorSetting refresh() { - this.innerObject = - serviceManager.serviceClient().getConnectors().getWithResponse(connectorName, Context.NONE).getValue(); + this.innerObject + = serviceManager.serviceClient().getConnectors().getWithResponse(connectorName, Context.NONE).getValue(); return this; } public ConnectorSetting refresh(Context context) { - this.innerObject = - serviceManager.serviceClient().getConnectors().getWithResponse(connectorName, context).getValue(); + this.innerObject + = serviceManager.serviceClient().getConnectors().getWithResponse(connectorName, context).getValue(); return this; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorsClientImpl.java index 21700bf0455ab..ff131b2b5d35b 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorsClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorsClientImpl.java @@ -33,22 +33,28 @@ import com.azure.resourcemanager.security.models.ConnectorSettingList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ConnectorsClient. */ +/** + * An instance of this class provides access to all the operations defined in ConnectorsClient. + */ public final class ConnectorsClientImpl implements ConnectorsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ConnectorsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityCenterImpl client; /** * Initializes an instance of ConnectorsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ConnectorsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(ConnectorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(ConnectorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -59,153 +65,111 @@ public final class ConnectorsClientImpl implements ConnectorsClient { @Host("{$host}") @ServiceInterface(name = "SecurityCenterConnec") public interface ConnectorsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("connectorName") String connectorName, - @HeaderParam("Accept") String accept, - Context context); + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("connectorName") String connectorName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("connectorName") String connectorName, - @BodyParam("application/json") ConnectorSettingInner connectorSetting, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConnectorSettingInner connectorSetting, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}") - @ExpectedResponses({200, 204}) + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("connectorName") String connectorName, - @HeaderParam("Accept") String accept, - Context context); + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("connectorName") String connectorName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Cloud accounts connectors 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 for a subscription, list of all cloud account connectors and their settings along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return for a subscription, list of all cloud account connectors and their settings 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2020-01-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)) + .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())); } /** * Cloud accounts connectors 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 for a subscription, list of all cloud account connectors and their settings along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return for a subscription, list of all cloud account connectors and their settings 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2020-01-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)); + 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)); } /** * Cloud accounts connectors 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 for a subscription, list of all cloud account connectors and their settings as paginated response with - * {@link PagedFlux}. + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -214,27 +178,27 @@ private PagedFlux listAsync() { /** * Cloud accounts connectors 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 for a subscription, list of all cloud account connectors and their settings as paginated response with - * {@link PagedFlux}. + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Cloud accounts connectors 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 for a subscription, list of all cloud account connectors and their settings as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -243,13 +207,13 @@ public PagedIterable list() { /** * Cloud accounts connectors 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 for a subscription, list of all cloud account connectors and their settings as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -258,7 +222,7 @@ public PagedIterable list(Context context) { /** * Details of a specific cloud account connector. - * + * * @param connectorName Name of the cloud account connector. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -268,16 +232,12 @@ public PagedIterable list(Context context) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String connectorName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (connectorName == null) { return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null.")); @@ -285,22 +245,14 @@ private Mono> getWithResponseAsync(String connec final String apiVersion = "2020-01-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - connectorName, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + connectorName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Details of a specific cloud account connector. - * + * * @param connectorName Name of the cloud account connector. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -311,16 +263,12 @@ private Mono> getWithResponseAsync(String connec @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String connectorName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (connectorName == null) { return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null.")); @@ -328,14 +276,13 @@ private Mono> getWithResponseAsync(String connec final String apiVersion = "2020-01-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), connectorName, accept, context); + return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), connectorName, + accept, context); } /** * Details of a specific cloud account connector. - * + * * @param connectorName Name of the cloud account connector. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -349,7 +296,7 @@ private Mono getAsync(String connectorName) { /** * Details of a specific cloud account connector. - * + * * @param connectorName Name of the cloud account connector. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -364,7 +311,7 @@ public Response getWithResponse(String connectorName, Con /** * Details of a specific cloud account connector. - * + * * @param connectorName Name of the cloud account connector. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -379,7 +326,7 @@ public ConnectorSettingInner get(String connectorName) { /** * Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either * account credentials or role-based authentication. For GCP, use account organization credentials. - * + * * @param connectorName Name of the cloud account connector. * @param connectorSetting Settings for the cloud account connector. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -388,19 +335,15 @@ public ConnectorSettingInner get(String connectorName) { * @return the connector setting along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String connectorName, ConnectorSettingInner connectorSetting) { + private Mono> createOrUpdateWithResponseAsync(String connectorName, + ConnectorSettingInner connectorSetting) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (connectorName == null) { return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null.")); @@ -414,24 +357,15 @@ private Mono> createOrUpdateWithResponseAsync( final String apiVersion = "2020-01-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - connectorName, - connectorSetting, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), connectorName, connectorSetting, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either * account credentials or role-based authentication. For GCP, use account organization credentials. - * + * * @param connectorName Name of the cloud account connector. * @param connectorSetting Settings for the cloud account connector. * @param context The context to associate with this operation. @@ -441,19 +375,15 @@ private Mono> createOrUpdateWithResponseAsync( * @return the connector setting along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String connectorName, ConnectorSettingInner connectorSetting, Context context) { + private Mono> createOrUpdateWithResponseAsync(String connectorName, + ConnectorSettingInner connectorSetting, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (connectorName == null) { return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null.")); @@ -467,21 +397,14 @@ private Mono> createOrUpdateWithResponseAsync( final String apiVersion = "2020-01-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - connectorName, - connectorSetting, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + connectorName, connectorSetting, accept, context); } /** * Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either * account credentials or role-based authentication. For GCP, use account organization credentials. - * + * * @param connectorName Name of the cloud account connector. * @param connectorSetting Settings for the cloud account connector. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -490,8 +413,8 @@ private Mono> createOrUpdateWithResponseAsync( * @return the connector setting on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String connectorName, ConnectorSettingInner connectorSetting) { + private Mono createOrUpdateAsync(String connectorName, + ConnectorSettingInner connectorSetting) { return createOrUpdateWithResponseAsync(connectorName, connectorSetting) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -499,7 +422,7 @@ private Mono createOrUpdateAsync( /** * Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either * account credentials or role-based authentication. For GCP, use account organization credentials. - * + * * @param connectorName Name of the cloud account connector. * @param connectorSetting Settings for the cloud account connector. * @param context The context to associate with this operation. @@ -509,15 +432,15 @@ private Mono createOrUpdateAsync( * @return the connector setting along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String connectorName, ConnectorSettingInner connectorSetting, Context context) { + public Response createOrUpdateWithResponse(String connectorName, + ConnectorSettingInner connectorSetting, Context context) { return createOrUpdateWithResponseAsync(connectorName, connectorSetting, context).block(); } /** * Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either * account credentials or role-based authentication. For GCP, use account organization credentials. - * + * * @param connectorName Name of the cloud account connector. * @param connectorSetting Settings for the cloud account connector. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -532,7 +455,7 @@ public ConnectorSettingInner createOrUpdate(String connectorName, ConnectorSetti /** * Delete a cloud account connector from a subscription. - * + * * @param connectorName Name of the cloud account connector. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -542,16 +465,12 @@ public ConnectorSettingInner createOrUpdate(String connectorName, ConnectorSetti @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String connectorName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (connectorName == null) { return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null.")); @@ -559,22 +478,14 @@ private Mono> deleteWithResponseAsync(String connectorName) { final String apiVersion = "2020-01-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - connectorName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), connectorName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete a cloud account connector from a subscription. - * + * * @param connectorName Name of the cloud account connector. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -585,16 +496,12 @@ private Mono> deleteWithResponseAsync(String connectorName) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String connectorName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (connectorName == null) { return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null.")); @@ -602,14 +509,13 @@ private Mono> deleteWithResponseAsync(String connectorName, Conte final String apiVersion = "2020-01-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), connectorName, accept, context); + return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), connectorName, + accept, context); } /** * Delete a cloud account connector from a subscription. - * + * * @param connectorName Name of the cloud account connector. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -623,7 +529,7 @@ private Mono deleteAsync(String connectorName) { /** * Delete a cloud account connector from a subscription. - * + * * @param connectorName Name of the cloud account connector. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -638,7 +544,7 @@ public Response deleteWithResponse(String connectorName, Context context) /** * Delete a cloud account connector from a subscription. - * + * * @param connectorName Name of the cloud account connector. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -651,14 +557,15 @@ public void delete(String connectorName) { /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 for a subscription, list of all cloud account connectors and their settings along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return for a subscription, list of all cloud account connectors and their settings along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -666,37 +573,28 @@ private Mono> listNextSinglePageAsync(Strin 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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 for a subscription, list of all cloud account connectors and their settings along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return for a subscription, list of all cloud account connectors and their settings along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -704,23 +602,13 @@ private Mono> listNextSinglePageAsync(Strin 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.")); + 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)); + 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/ConnectorsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorsImpl.java index ba0dd85d8a644..b0fc9d20799e1 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorsImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorsImpl.java @@ -21,29 +21,26 @@ public final class ConnectorsImpl implements Connectors { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public ConnectorsImpl( - ConnectorsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + public ConnectorsImpl(ConnectorsClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new ConnectorSettingImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectorSettingImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new ConnectorSettingImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectorSettingImpl(inner1, this.manager())); } public Response getWithResponse(String connectorName, Context context) { Response inner = this.serviceClient().getWithResponse(connectorName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ConnectorSettingImpl(inner.getValue(), this.manager())); } else { return null; @@ -68,45 +65,37 @@ public void delete(String connectorName) { } public ConnectorSetting getById(String id) { - String connectorName = Utils.getValueFromIdByName(id, "connectors"); + String connectorName = ResourceManagerUtils.getValueFromIdByName(id, "connectors"); if (connectorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'connectors'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connectors'.", id))); } return this.getWithResponse(connectorName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String connectorName = Utils.getValueFromIdByName(id, "connectors"); + String connectorName = ResourceManagerUtils.getValueFromIdByName(id, "connectors"); if (connectorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'connectors'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connectors'.", id))); } return this.getWithResponse(connectorName, context); } public void deleteById(String id) { - String connectorName = Utils.getValueFromIdByName(id, "connectors"); + String connectorName = ResourceManagerUtils.getValueFromIdByName(id, "connectors"); if (connectorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'connectors'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connectors'.", id))); } this.deleteWithResponse(connectorName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { - String connectorName = Utils.getValueFromIdByName(id, "connectors"); + String connectorName = ResourceManagerUtils.getValueFromIdByName(id, "connectors"); if (connectorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'connectors'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connectors'.", id))); } return this.deleteWithResponse(connectorName, context); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationImpl.java index 4b7d59d784b08..3576a911cb8d5 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationImpl.java @@ -18,8 +18,7 @@ public final class CustomAssessmentAutomationImpl private final com.azure.resourcemanager.security.SecurityManager serviceManager; - CustomAssessmentAutomationImpl( - CustomAssessmentAutomationInner innerObject, + CustomAssessmentAutomationImpl(CustomAssessmentAutomationInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -89,27 +88,16 @@ public CustomAssessmentAutomationImpl withExistingResourceGroup(String resourceG } public CustomAssessmentAutomation create() { - this.innerObject = - serviceManager - .serviceClient() - .getCustomAssessmentAutomations() - .createWithResponse( - resourceGroupName, - customAssessmentAutomationName, - createCustomAssessmentAutomationBody, - Context.NONE) - .getValue(); + this.innerObject + = serviceManager.serviceClient().getCustomAssessmentAutomations().createWithResponse(resourceGroupName, + customAssessmentAutomationName, createCustomAssessmentAutomationBody, Context.NONE).getValue(); return this; } public CustomAssessmentAutomation create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getCustomAssessmentAutomations() - .createWithResponse( - resourceGroupName, customAssessmentAutomationName, createCustomAssessmentAutomationBody, context) - .getValue(); + this.innerObject + = serviceManager.serviceClient().getCustomAssessmentAutomations().createWithResponse(resourceGroupName, + customAssessmentAutomationName, createCustomAssessmentAutomationBody, context).getValue(); return this; } @@ -121,22 +109,14 @@ public CustomAssessmentAutomation create(Context context) { } public CustomAssessmentAutomation refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getCustomAssessmentAutomations() - .getByResourceGroupWithResponse(resourceGroupName, customAssessmentAutomationName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getCustomAssessmentAutomations() + .getByResourceGroupWithResponse(resourceGroupName, customAssessmentAutomationName, Context.NONE).getValue(); return this; } public CustomAssessmentAutomation refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getCustomAssessmentAutomations() - .getByResourceGroupWithResponse(resourceGroupName, customAssessmentAutomationName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getCustomAssessmentAutomations() + .getByResourceGroupWithResponse(resourceGroupName, customAssessmentAutomationName, context).getValue(); return this; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsClientImpl.java index 21111c2d2a9ee..e5169ac0da7f6 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsClientImpl.java @@ -34,24 +34,28 @@ import com.azure.resourcemanager.security.models.CustomAssessmentAutomationsListResult; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in CustomAssessmentAutomationsClient. */ +/** + * An instance of this class provides access to all the operations defined in CustomAssessmentAutomationsClient. + */ public final class CustomAssessmentAutomationsClientImpl implements CustomAssessmentAutomationsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final CustomAssessmentAutomationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityCenterImpl client; /** * Initializes an instance of CustomAssessmentAutomationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ CustomAssessmentAutomationsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - CustomAssessmentAutomationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(CustomAssessmentAutomationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -62,253 +66,202 @@ public final class CustomAssessmentAutomationsClientImpl implements CustomAssess @Host("{$host}") @ServiceInterface(name = "SecurityCenterCustom") public interface CustomAssessmentAutomationsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("customAssessmentAutomationName") String customAssessmentAutomationName, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("customAssessmentAutomationName") String customAssessmentAutomationName, @BodyParam("application/json") CustomAssessmentAutomationRequest customAssessmentAutomationBody, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("customAssessmentAutomationName") String customAssessmentAutomationName, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @HeaderParam("Accept") String accept, + Mono> listByResourceGroup(@HostParam("$host") 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"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/customAssessmentAutomations") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Gets a custom assessment automation - * - *

Gets a single custom assessment automation by name for the provided subscription and resource group. - * + * + * Gets a single custom assessment automation by name for the provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customAssessmentAutomationName Name of the Custom Assessment Automation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single custom assessment automation by name for the provided subscription and resource group along with - * {@link Response} on successful completion of {@link Mono}. + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String customAssessmentAutomationName) { + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String customAssessmentAutomationName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.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 (customAssessmentAutomationName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customAssessmentAutomationName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter customAssessmentAutomationName is required and cannot be null.")); } final String apiVersion = "2021-07-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - customAssessmentAutomationName, - accept, - context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, customAssessmentAutomationName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets a custom assessment automation - * - *

Gets a single custom assessment automation by name for the provided subscription and resource group. - * + * + * Gets a single custom assessment automation by name for the provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customAssessmentAutomationName Name of the Custom Assessment Automation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single custom assessment automation by name for the provided subscription and resource group along with - * {@link Response} on successful completion of {@link Mono}. + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( String resourceGroupName, String customAssessmentAutomationName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.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 (customAssessmentAutomationName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customAssessmentAutomationName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter customAssessmentAutomationName is required and cannot be null.")); } final String apiVersion = "2021-07-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - customAssessmentAutomationName, - accept, - context); + return service.getByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, customAssessmentAutomationName, accept, context); } /** * Gets a custom assessment automation - * - *

Gets a single custom assessment automation by name for the provided subscription and resource group. - * + * + * Gets a single custom assessment automation by name for the provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customAssessmentAutomationName Name of the Custom Assessment Automation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single custom assessment automation by name for the provided subscription and resource group on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync( - String resourceGroupName, String customAssessmentAutomationName) { + private Mono getByResourceGroupAsync(String resourceGroupName, + String customAssessmentAutomationName) { return getByResourceGroupWithResponseAsync(resourceGroupName, customAssessmentAutomationName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets a custom assessment automation - * - *

Gets a single custom assessment automation by name for the provided subscription and resource group. - * + * + * Gets a single custom assessment automation by name for the provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customAssessmentAutomationName Name of the Custom Assessment Automation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single custom assessment automation by name for the provided subscription and resource group along with - * {@link Response}. + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String customAssessmentAutomationName, Context context) { + public Response getByResourceGroupWithResponse(String resourceGroupName, + String customAssessmentAutomationName, Context context) { return getByResourceGroupWithResponseAsync(resourceGroupName, customAssessmentAutomationName, context).block(); } /** * Gets a custom assessment automation - * - *

Gets a single custom assessment automation by name for the provided subscription and resource group. - * + * + * Gets a single custom assessment automation by name for the provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customAssessmentAutomationName Name of the Custom Assessment Automation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -316,20 +269,20 @@ public Response getByResourceGroupWithResponse( * @return a single custom assessment automation by name for the provided subscription and resource group. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CustomAssessmentAutomationInner getByResourceGroup( - String resourceGroupName, String customAssessmentAutomationName) { + public CustomAssessmentAutomationInner getByResourceGroup(String resourceGroupName, + String customAssessmentAutomationName) { return getByResourceGroupWithResponse(resourceGroupName, customAssessmentAutomationName, Context.NONE) .getValue(); } /** * Creates a custom assessment automation - * - *

Creates or updates a custom assessment automation for the provided subscription. Please note that providing an + * + * Creates or updates a custom assessment automation for the provided subscription. Please note that providing an * existing custom assessment automation will replace the existing record. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customAssessmentAutomationName Name of the Custom Assessment Automation. * @param customAssessmentAutomationBody Custom Assessment Automation body. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -338,37 +291,27 @@ public CustomAssessmentAutomationInner getByResourceGroup( * @return custom Assessment Automation along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, - String customAssessmentAutomationName, - CustomAssessmentAutomationRequest customAssessmentAutomationBody) { + private Mono> createWithResponseAsync(String resourceGroupName, + String customAssessmentAutomationName, CustomAssessmentAutomationRequest customAssessmentAutomationBody) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.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 (customAssessmentAutomationName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customAssessmentAutomationName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter customAssessmentAutomationName is required and cannot be null.")); } if (customAssessmentAutomationBody == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customAssessmentAutomationBody is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter customAssessmentAutomationBody is required and cannot be null.")); } else { customAssessmentAutomationBody.validate(); } @@ -376,28 +319,19 @@ private Mono> createWithResponseAsync( final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - customAssessmentAutomationName, - customAssessmentAutomationBody, - accept, - context)) + context -> service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, customAssessmentAutomationName, customAssessmentAutomationBody, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates a custom assessment automation - * - *

Creates or updates a custom assessment automation for the provided subscription. Please note that providing an + * + * Creates or updates a custom assessment automation for the provided subscription. Please note that providing an * existing custom assessment automation will replace the existing record. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customAssessmentAutomationName Name of the Custom Assessment Automation. * @param customAssessmentAutomationBody Custom Assessment Automation body. * @param context The context to associate with this operation. @@ -407,64 +341,46 @@ private Mono> createWithResponseAsync( * @return custom Assessment Automation along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, - String customAssessmentAutomationName, - CustomAssessmentAutomationRequest customAssessmentAutomationBody, + private Mono> createWithResponseAsync(String resourceGroupName, + String customAssessmentAutomationName, CustomAssessmentAutomationRequest customAssessmentAutomationBody, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.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 (customAssessmentAutomationName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customAssessmentAutomationName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter customAssessmentAutomationName is required and cannot be null.")); } if (customAssessmentAutomationBody == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customAssessmentAutomationBody is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter customAssessmentAutomationBody is required and cannot be null.")); } else { customAssessmentAutomationBody.validate(); } final String apiVersion = "2021-07-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - customAssessmentAutomationName, - customAssessmentAutomationBody, - accept, - context); + return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + customAssessmentAutomationName, customAssessmentAutomationBody, accept, context); } /** * Creates a custom assessment automation - * - *

Creates or updates a custom assessment automation for the provided subscription. Please note that providing an + * + * Creates or updates a custom assessment automation for the provided subscription. Please note that providing an * existing custom assessment automation will replace the existing record. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customAssessmentAutomationName Name of the Custom Assessment Automation. * @param customAssessmentAutomationBody Custom Assessment Automation body. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -473,23 +389,20 @@ private Mono> createWithResponseAsync( * @return custom Assessment Automation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, - String customAssessmentAutomationName, - CustomAssessmentAutomationRequest customAssessmentAutomationBody) { - return createWithResponseAsync( - resourceGroupName, customAssessmentAutomationName, customAssessmentAutomationBody) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono createAsync(String resourceGroupName, + String customAssessmentAutomationName, CustomAssessmentAutomationRequest customAssessmentAutomationBody) { + return createWithResponseAsync(resourceGroupName, customAssessmentAutomationName, + customAssessmentAutomationBody).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Creates a custom assessment automation - * - *

Creates or updates a custom assessment automation for the provided subscription. Please note that providing an + * + * Creates or updates a custom assessment automation for the provided subscription. Please note that providing an * existing custom assessment automation will replace the existing record. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customAssessmentAutomationName Name of the Custom Assessment Automation. * @param customAssessmentAutomationBody Custom Assessment Automation body. * @param context The context to associate with this operation. @@ -499,24 +412,21 @@ private Mono createAsync( * @return custom Assessment Automation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, - String customAssessmentAutomationName, - CustomAssessmentAutomationRequest customAssessmentAutomationBody, + public Response createWithResponse(String resourceGroupName, + String customAssessmentAutomationName, CustomAssessmentAutomationRequest customAssessmentAutomationBody, Context context) { - return createWithResponseAsync( - resourceGroupName, customAssessmentAutomationName, customAssessmentAutomationBody, context) - .block(); + return createWithResponseAsync(resourceGroupName, customAssessmentAutomationName, + customAssessmentAutomationBody, context).block(); } /** * Creates a custom assessment automation - * - *

Creates or updates a custom assessment automation for the provided subscription. Please note that providing an + * + * Creates or updates a custom assessment automation for the provided subscription. Please note that providing an * existing custom assessment automation will replace the existing record. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customAssessmentAutomationName Name of the Custom Assessment Automation. * @param customAssessmentAutomationBody Custom Assessment Automation body. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -525,22 +435,19 @@ public Response createWithResponse( * @return custom Assessment Automation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CustomAssessmentAutomationInner create( - String resourceGroupName, - String customAssessmentAutomationName, + public CustomAssessmentAutomationInner create(String resourceGroupName, String customAssessmentAutomationName, CustomAssessmentAutomationRequest customAssessmentAutomationBody) { - return createWithResponse( - resourceGroupName, customAssessmentAutomationName, customAssessmentAutomationBody, Context.NONE) - .getValue(); + return createWithResponse(resourceGroupName, customAssessmentAutomationName, customAssessmentAutomationBody, + Context.NONE).getValue(); } /** * Deletes a custom assessment automation - * - *

Deletes a custom assessment automation by name for a provided subscription. - * + * + * Deletes a custom assessment automation by name for a provided subscription. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customAssessmentAutomationName Name of the Custom Assessment Automation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -548,54 +455,39 @@ public CustomAssessmentAutomationInner create( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String customAssessmentAutomationName) { + private Mono> deleteWithResponseAsync(String resourceGroupName, + String customAssessmentAutomationName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.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 (customAssessmentAutomationName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customAssessmentAutomationName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter customAssessmentAutomationName is required and cannot be null.")); } final String apiVersion = "2021-07-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - customAssessmentAutomationName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, customAssessmentAutomationName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes a custom assessment automation - * - *

Deletes a custom assessment automation by name for a provided subscription. - * + * + * Deletes a custom assessment automation by name for a provided subscription. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customAssessmentAutomationName Name of the Custom Assessment Automation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -604,51 +496,38 @@ private Mono> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String customAssessmentAutomationName, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, + String customAssessmentAutomationName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.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 (customAssessmentAutomationName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customAssessmentAutomationName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter customAssessmentAutomationName is required and cannot be null.")); } final String apiVersion = "2021-07-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - customAssessmentAutomationName, - accept, - context); + return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + customAssessmentAutomationName, accept, context); } /** * Deletes a custom assessment automation - * - *

Deletes a custom assessment automation by name for a provided subscription. - * + * + * Deletes a custom assessment automation by name for a provided subscription. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customAssessmentAutomationName Name of the Custom Assessment Automation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -663,11 +542,11 @@ private Mono deleteAsync(String resourceGroupName, String customAssessment /** * Deletes a custom assessment automation - * - *

Deletes a custom assessment automation by name for a provided subscription. - * + * + * Deletes a custom assessment automation by name for a provided subscription. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customAssessmentAutomationName Name of the Custom Assessment Automation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -676,18 +555,18 @@ private Mono deleteAsync(String resourceGroupName, String customAssessment * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String customAssessmentAutomationName, Context context) { + public Response deleteWithResponse(String resourceGroupName, String customAssessmentAutomationName, + Context context) { return deleteWithResponseAsync(resourceGroupName, customAssessmentAutomationName, context).block(); } /** * Deletes a custom assessment automation - * - *

Deletes a custom assessment automation by name for a provided subscription. - * + * + * Deletes a custom assessment automation by name for a provided subscription. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customAssessmentAutomationName Name of the Custom Assessment Automation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -700,31 +579,27 @@ public void delete(String resourceGroupName, String customAssessmentAutomationNa /** * List custom assessment automations in a subscription and a resource group - * - *

List custom assessment automations by provided subscription and resource group. - * + * + * List custom assessment automations by provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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 Custom Assessment Automations along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -733,56 +608,37 @@ private Mono> listByResourceGroup final String apiVersion = "2021-07-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)) + .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 custom assessment automations in a subscription and a resource group - * - *

List custom assessment automations by provided subscription and resource group. - * + * + * List custom assessment automations by provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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 Custom Assessment Automations along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -792,31 +648,19 @@ private Mono> listByResourceGroup 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)); + .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 custom assessment automations in a subscription and a resource group - * - *

List custom assessment automations by provided subscription and resource group. - * + * + * List custom assessment automations by provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -824,18 +668,17 @@ private Mono> listByResourceGroup */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** * List custom assessment automations in a subscription and a resource group - * - *

List custom assessment automations by provided subscription and resource group. - * + * + * List custom assessment automations by provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -843,20 +686,19 @@ private PagedFlux listByResourceGroupAsync(Stri * @return a list of Custom Assessment Automations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** * List custom assessment automations in a subscription and a resource group - * - *

List custom assessment automations by provided subscription and resource group. - * + * + * List custom assessment automations by provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -869,11 +711,11 @@ public PagedIterable listByResourceGroup(String /** * List custom assessment automations in a subscription and a resource group - * - *

List custom assessment automations by provided subscription and resource group. - * + * + * List custom assessment automations by provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -881,116 +723,91 @@ public PagedIterable listByResourceGroup(String * @return a list of Custom Assessment Automations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, Context context) { + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); } /** * List custom assessment automations in a subscription - * - *

List custom assessment automations by provided subscription. - * + * + * List custom assessment automations by provided 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 Custom Assessment Automations along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2021-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)) + .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 custom assessment automations in a subscription - * - *

List custom assessment automations by provided subscription. - * + * + * List custom assessment automations by provided 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 Custom Assessment Automations along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2021-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)); + 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 custom assessment automations in a subscription - * - *

List custom assessment automations by provided subscription. - * + * + * List custom assessment automations by provided 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 Custom Assessment Automations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { - return new PagedFlux<>( - () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** * List custom assessment automations in a subscription - * - *

List custom assessment automations by provided subscription. - * + * + * List custom assessment automations by provided 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. @@ -999,15 +816,15 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** * List custom assessment automations in a subscription - * - *

List custom assessment automations by provided subscription. - * + * + * List custom assessment automations by provided 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 Custom Assessment Automations as paginated response with {@link PagedIterable}. @@ -1019,9 +836,9 @@ public PagedIterable list() { /** * List custom assessment automations in a subscription - * - *

List custom assessment automations by provided subscription. - * + * + * List custom assessment automations by provided 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. @@ -1035,157 +852,123 @@ public PagedIterable list(Context context) { /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 Custom Assessment Automations along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink) { + 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.")); + 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)) + .>map(res -> new 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 - *

The nextLink parameter. + * + * The nextLink 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 Custom Assessment Automations along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { + 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.")); + 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)); + 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 - *

The nextLink parameter. + * + * The nextLink 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 Custom Assessment Automations along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink) { + 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.")); + 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)) + .>map(res -> new 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 - *

The nextLink parameter. + * + * The nextLink 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 Custom Assessment Automations along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { + 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.")); + 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)); + 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/CustomAssessmentAutomationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsImpl.java index 460555a46574e..0ccaf3e238622 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsImpl.java @@ -21,34 +21,28 @@ public final class CustomAssessmentAutomationsImpl implements CustomAssessmentAu private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public CustomAssessmentAutomationsImpl( - CustomAssessmentAutomationsClient innerClient, + public CustomAssessmentAutomationsImpl(CustomAssessmentAutomationsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response getByResourceGroupWithResponse( - String resourceGroupName, String customAssessmentAutomationName, Context context) { - Response inner = - this - .serviceClient() - .getByResourceGroupWithResponse(resourceGroupName, customAssessmentAutomationName, context); + public Response getByResourceGroupWithResponse(String resourceGroupName, + String customAssessmentAutomationName, Context context) { + Response inner = this.serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, customAssessmentAutomationName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new CustomAssessmentAutomationImpl(inner.getValue(), this.manager())); } else { return null; } } - public CustomAssessmentAutomation getByResourceGroup( - String resourceGroupName, String customAssessmentAutomationName) { - CustomAssessmentAutomationInner inner = - this.serviceClient().getByResourceGroup(resourceGroupName, customAssessmentAutomationName); + public CustomAssessmentAutomation getByResourceGroup(String resourceGroupName, + String customAssessmentAutomationName) { + CustomAssessmentAutomationInner inner + = this.serviceClient().getByResourceGroup(resourceGroupName, customAssessmentAutomationName); if (inner != null) { return new CustomAssessmentAutomationImpl(inner, this.manager()); } else { @@ -56,8 +50,8 @@ public CustomAssessmentAutomation getByResourceGroup( } } - public Response deleteByResourceGroupWithResponse( - String resourceGroupName, String customAssessmentAutomationName, Context context) { + public Response deleteByResourceGroupWithResponse(String resourceGroupName, + String customAssessmentAutomationName, Context context) { return this.serviceClient().deleteWithResponse(resourceGroupName, customAssessmentAutomationName, context); } @@ -66,117 +60,88 @@ public void deleteByResourceGroup(String resourceGroupName, String customAssessm } public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new CustomAssessmentAutomationImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new CustomAssessmentAutomationImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new CustomAssessmentAutomationImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new CustomAssessmentAutomationImpl(inner1, this.manager())); } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new CustomAssessmentAutomationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new CustomAssessmentAutomationImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new CustomAssessmentAutomationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new CustomAssessmentAutomationImpl(inner1, this.manager())); } public CustomAssessmentAutomation getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); } - String customAssessmentAutomationName = Utils.getValueFromIdByName(id, "customAssessmentAutomations"); + String customAssessmentAutomationName + = ResourceManagerUtils.getValueFromIdByName(id, "customAssessmentAutomations"); if (customAssessmentAutomationName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment" - + " 'customAssessmentAutomations'.", - id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'customAssessmentAutomations'.", id))); } - return this - .getByResourceGroupWithResponse(resourceGroupName, customAssessmentAutomationName, Context.NONE) + return this.getByResourceGroupWithResponse(resourceGroupName, customAssessmentAutomationName, Context.NONE) .getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); } - String customAssessmentAutomationName = Utils.getValueFromIdByName(id, "customAssessmentAutomations"); + String customAssessmentAutomationName + = ResourceManagerUtils.getValueFromIdByName(id, "customAssessmentAutomations"); if (customAssessmentAutomationName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment" - + " 'customAssessmentAutomations'.", - id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'customAssessmentAutomations'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, customAssessmentAutomationName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); } - String customAssessmentAutomationName = Utils.getValueFromIdByName(id, "customAssessmentAutomations"); + String customAssessmentAutomationName + = ResourceManagerUtils.getValueFromIdByName(id, "customAssessmentAutomations"); if (customAssessmentAutomationName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment" - + " 'customAssessmentAutomations'.", - id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'customAssessmentAutomations'.", id))); } this.deleteByResourceGroupWithResponse(resourceGroupName, customAssessmentAutomationName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); } - String customAssessmentAutomationName = Utils.getValueFromIdByName(id, "customAssessmentAutomations"); + String customAssessmentAutomationName + = ResourceManagerUtils.getValueFromIdByName(id, "customAssessmentAutomations"); if (customAssessmentAutomationName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment" - + " 'customAssessmentAutomations'.", - id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'customAssessmentAutomations'.", id))); } return this.deleteByResourceGroupWithResponse(resourceGroupName, customAssessmentAutomationName, context); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentImpl.java index fb658a4180552..7b253384c9086 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentImpl.java @@ -16,8 +16,7 @@ public final class CustomEntityStoreAssignmentImpl private final com.azure.resourcemanager.security.SecurityManager serviceManager; - CustomEntityStoreAssignmentImpl( - CustomEntityStoreAssignmentInner innerObject, + CustomEntityStoreAssignmentImpl(CustomEntityStoreAssignmentInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -67,30 +66,18 @@ public CustomEntityStoreAssignmentImpl withExistingResourceGroup(String resource } public CustomEntityStoreAssignment create() { - this.innerObject = - serviceManager - .serviceClient() - .getCustomEntityStoreAssignments() - .createWithResponse( - resourceGroupName, - customEntityStoreAssignmentName, - createCustomEntityStoreAssignmentRequestBody, - Context.NONE) + this.innerObject + = serviceManager + .serviceClient().getCustomEntityStoreAssignments().createWithResponse(resourceGroupName, + customEntityStoreAssignmentName, createCustomEntityStoreAssignmentRequestBody, Context.NONE) .getValue(); return this; } public CustomEntityStoreAssignment create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getCustomEntityStoreAssignments() - .createWithResponse( - resourceGroupName, - customEntityStoreAssignmentName, - createCustomEntityStoreAssignmentRequestBody, - context) - .getValue(); + this.innerObject + = serviceManager.serviceClient().getCustomEntityStoreAssignments().createWithResponse(resourceGroupName, + customEntityStoreAssignmentName, createCustomEntityStoreAssignmentRequestBody, context).getValue(); return this; } @@ -102,22 +89,15 @@ public CustomEntityStoreAssignment create(Context context) { } public CustomEntityStoreAssignment refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getCustomEntityStoreAssignments() - .getByResourceGroupWithResponse(resourceGroupName, customEntityStoreAssignmentName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getCustomEntityStoreAssignments() + .getByResourceGroupWithResponse(resourceGroupName, customEntityStoreAssignmentName, Context.NONE) + .getValue(); return this; } public CustomEntityStoreAssignment refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getCustomEntityStoreAssignments() - .getByResourceGroupWithResponse(resourceGroupName, customEntityStoreAssignmentName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getCustomEntityStoreAssignments() + .getByResourceGroupWithResponse(resourceGroupName, customEntityStoreAssignmentName, context).getValue(); return this; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentsClientImpl.java index 338a98a95a378..b41e3b2200f10 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentsClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentsClientImpl.java @@ -34,24 +34,28 @@ import com.azure.resourcemanager.security.models.CustomEntityStoreAssignmentsListResult; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in CustomEntityStoreAssignmentsClient. */ +/** + * An instance of this class provides access to all the operations defined in CustomEntityStoreAssignmentsClient. + */ public final class CustomEntityStoreAssignmentsClientImpl implements CustomEntityStoreAssignmentsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final CustomEntityStoreAssignmentsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityCenterImpl client; /** * Initializes an instance of CustomEntityStoreAssignmentsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ CustomEntityStoreAssignmentsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - CustomEntityStoreAssignmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(CustomEntityStoreAssignmentsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -62,253 +66,202 @@ public final class CustomEntityStoreAssignmentsClientImpl implements CustomEntit @Host("{$host}") @ServiceInterface(name = "SecurityCenterCustom") public interface CustomEntityStoreAssignmentsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("customEntityStoreAssignmentName") String customEntityStoreAssignmentName, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("customEntityStoreAssignmentName") String customEntityStoreAssignmentName, @BodyParam("application/json") CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("customEntityStoreAssignmentName") String customEntityStoreAssignmentName, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @HeaderParam("Accept") String accept, + Mono> listByResourceGroup(@HostParam("$host") 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"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/customEntityStoreAssignments") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Gets a custom entity store assignment - * - *

Gets a single custom entity store assignment by name for the provided subscription and resource group. - * + * + * Gets a single custom entity store assignment by name for the provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is 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 single custom entity store assignment by name for the provided subscription and resource group along - * with {@link Response} on successful completion of {@link Mono}. + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String customEntityStoreAssignmentName) { + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String customEntityStoreAssignmentName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.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 (customEntityStoreAssignmentName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customEntityStoreAssignmentName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter customEntityStoreAssignmentName is required and cannot be null.")); } final String apiVersion = "2021-07-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - customEntityStoreAssignmentName, - accept, - context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, customEntityStoreAssignmentName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets a custom entity store assignment - * - *

Gets a single custom entity store assignment by name for the provided subscription and resource group. - * + * + * Gets a single custom entity store assignment by name for the provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is 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 single custom entity store assignment by name for the provided subscription and resource group along - * with {@link Response} on successful completion of {@link Mono}. + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( String resourceGroupName, String customEntityStoreAssignmentName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.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 (customEntityStoreAssignmentName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customEntityStoreAssignmentName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter customEntityStoreAssignmentName is required and cannot be null.")); } final String apiVersion = "2021-07-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - customEntityStoreAssignmentName, - accept, - context); + return service.getByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, customEntityStoreAssignmentName, accept, context); } /** * Gets a custom entity store assignment - * - *

Gets a single custom entity store assignment by name for the provided subscription and resource group. - * + * + * Gets a single custom entity store assignment by name for the provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is 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 single custom entity store assignment by name for the provided subscription and resource group on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync( - String resourceGroupName, String customEntityStoreAssignmentName) { + private Mono getByResourceGroupAsync(String resourceGroupName, + String customEntityStoreAssignmentName) { return getByResourceGroupWithResponseAsync(resourceGroupName, customEntityStoreAssignmentName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets a custom entity store assignment - * - *

Gets a single custom entity store assignment by name for the provided subscription and resource group. - * + * + * Gets a single custom entity store assignment by name for the provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is 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 single custom entity store assignment by name for the provided subscription and resource group along - * with {@link Response}. + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String customEntityStoreAssignmentName, Context context) { + public Response getByResourceGroupWithResponse(String resourceGroupName, + String customEntityStoreAssignmentName, Context context) { return getByResourceGroupWithResponseAsync(resourceGroupName, customEntityStoreAssignmentName, context).block(); } /** * Gets a custom entity store assignment - * - *

Gets a single custom entity store assignment by name for the provided subscription and resource group. - * + * + * Gets a single custom entity store assignment by name for the provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -316,19 +269,19 @@ public Response getByResourceGroupWithResponse * @return a single custom entity store assignment by name for the provided subscription and resource group. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CustomEntityStoreAssignmentInner getByResourceGroup( - String resourceGroupName, String customEntityStoreAssignmentName) { + public CustomEntityStoreAssignmentInner getByResourceGroup(String resourceGroupName, + String customEntityStoreAssignmentName) { return getByResourceGroupWithResponse(resourceGroupName, customEntityStoreAssignmentName, Context.NONE) .getValue(); } /** * Creates a custom entity store assignment - * - *

Creates a custom entity store assignment for the provided subscription, if not already exists. - * + * + * Creates a custom entity store assignment for the provided subscription, if not already exists. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. * @param customEntityStoreAssignmentRequestBody Custom entity store assignment body. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -337,65 +290,47 @@ public CustomEntityStoreAssignmentInner getByResourceGroup( * @return custom entity store assignment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, + private Mono> createWithResponseAsync(String resourceGroupName, String customEntityStoreAssignmentName, CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.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 (customEntityStoreAssignmentName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customEntityStoreAssignmentName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter customEntityStoreAssignmentName is required and cannot be null.")); } if (customEntityStoreAssignmentRequestBody == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customEntityStoreAssignmentRequestBody is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter customEntityStoreAssignmentRequestBody is required and cannot be null.")); } else { customEntityStoreAssignmentRequestBody.validate(); } final String apiVersion = "2021-07-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - customEntityStoreAssignmentName, - customEntityStoreAssignmentRequestBody, - accept, - context)) + .withContext(context -> service.create(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, customEntityStoreAssignmentName, + customEntityStoreAssignmentRequestBody, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates a custom entity store assignment - * - *

Creates a custom entity store assignment for the provided subscription, if not already exists. - * + * + * Creates a custom entity store assignment for the provided subscription, if not already exists. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. * @param customEntityStoreAssignmentRequestBody Custom entity store assignment body. * @param context The context to associate with this operation. @@ -405,63 +340,45 @@ private Mono> createWithResponseAsync * @return custom entity store assignment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, + private Mono> createWithResponseAsync(String resourceGroupName, String customEntityStoreAssignmentName, - CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody, - Context context) { + CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.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 (customEntityStoreAssignmentName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customEntityStoreAssignmentName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter customEntityStoreAssignmentName is required and cannot be null.")); } if (customEntityStoreAssignmentRequestBody == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customEntityStoreAssignmentRequestBody is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter customEntityStoreAssignmentRequestBody is required and cannot be null.")); } else { customEntityStoreAssignmentRequestBody.validate(); } final String apiVersion = "2021-07-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - customEntityStoreAssignmentName, - customEntityStoreAssignmentRequestBody, - accept, - context); + return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + customEntityStoreAssignmentName, customEntityStoreAssignmentRequestBody, accept, context); } /** * Creates a custom entity store assignment - * - *

Creates a custom entity store assignment for the provided subscription, if not already exists. - * + * + * Creates a custom entity store assignment for the provided subscription, if not already exists. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. * @param customEntityStoreAssignmentRequestBody Custom entity store assignment body. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -470,22 +387,20 @@ private Mono> createWithResponseAsync * @return custom entity store assignment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, + private Mono createAsync(String resourceGroupName, String customEntityStoreAssignmentName, CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody) { - return createWithResponseAsync( - resourceGroupName, customEntityStoreAssignmentName, customEntityStoreAssignmentRequestBody) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + return createWithResponseAsync(resourceGroupName, customEntityStoreAssignmentName, + customEntityStoreAssignmentRequestBody).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Creates a custom entity store assignment - * - *

Creates a custom entity store assignment for the provided subscription, if not already exists. - * + * + * Creates a custom entity store assignment for the provided subscription, if not already exists. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. * @param customEntityStoreAssignmentRequestBody Custom entity store assignment body. * @param context The context to associate with this operation. @@ -495,23 +410,20 @@ private Mono createAsync( * @return custom entity store assignment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, + public Response createWithResponse(String resourceGroupName, String customEntityStoreAssignmentName, - CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody, - Context context) { - return createWithResponseAsync( - resourceGroupName, customEntityStoreAssignmentName, customEntityStoreAssignmentRequestBody, context) - .block(); + CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody, Context context) { + return createWithResponseAsync(resourceGroupName, customEntityStoreAssignmentName, + customEntityStoreAssignmentRequestBody, context).block(); } /** * Creates a custom entity store assignment - * - *

Creates a custom entity store assignment for the provided subscription, if not already exists. - * + * + * Creates a custom entity store assignment for the provided subscription, if not already exists. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. * @param customEntityStoreAssignmentRequestBody Custom entity store assignment body. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -520,25 +432,19 @@ public Response createWithResponse( * @return custom entity store assignment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CustomEntityStoreAssignmentInner create( - String resourceGroupName, - String customEntityStoreAssignmentName, + public CustomEntityStoreAssignmentInner create(String resourceGroupName, String customEntityStoreAssignmentName, CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody) { - return createWithResponse( - resourceGroupName, - customEntityStoreAssignmentName, - customEntityStoreAssignmentRequestBody, - Context.NONE) - .getValue(); + return createWithResponse(resourceGroupName, customEntityStoreAssignmentName, + customEntityStoreAssignmentRequestBody, Context.NONE).getValue(); } /** * Deleted a custom entity store assignment - * - *

Delete a custom entity store assignment by name for a provided subscription. - * + * + * Delete a custom entity store assignment by name for a provided subscription. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -546,54 +452,39 @@ public CustomEntityStoreAssignmentInner create( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String customEntityStoreAssignmentName) { + private Mono> deleteWithResponseAsync(String resourceGroupName, + String customEntityStoreAssignmentName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.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 (customEntityStoreAssignmentName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customEntityStoreAssignmentName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter customEntityStoreAssignmentName is required and cannot be null.")); } final String apiVersion = "2021-07-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - customEntityStoreAssignmentName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, customEntityStoreAssignmentName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deleted a custom entity store assignment - * - *

Delete a custom entity store assignment by name for a provided subscription. - * + * + * Delete a custom entity store assignment by name for a provided subscription. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -602,51 +493,38 @@ private Mono> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String customEntityStoreAssignmentName, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, + String customEntityStoreAssignmentName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.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 (customEntityStoreAssignmentName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customEntityStoreAssignmentName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter customEntityStoreAssignmentName is required and cannot be null.")); } final String apiVersion = "2021-07-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - customEntityStoreAssignmentName, - accept, - context); + return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + customEntityStoreAssignmentName, accept, context); } /** * Deleted a custom entity store assignment - * - *

Delete a custom entity store assignment by name for a provided subscription. - * + * + * Delete a custom entity store assignment by name for a provided subscription. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -661,11 +539,11 @@ private Mono deleteAsync(String resourceGroupName, String customEntityStor /** * Deleted a custom entity store assignment - * - *

Delete a custom entity store assignment by name for a provided subscription. - * + * + * Delete a custom entity store assignment by name for a provided subscription. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -674,18 +552,18 @@ private Mono deleteAsync(String resourceGroupName, String customEntityStor * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String customEntityStoreAssignmentName, Context context) { + public Response deleteWithResponse(String resourceGroupName, String customEntityStoreAssignmentName, + Context context) { return deleteWithResponseAsync(resourceGroupName, customEntityStoreAssignmentName, context).block(); } /** * Deleted a custom entity store assignment - * - *

Delete a custom entity store assignment by name for a provided subscription. - * + * + * Delete a custom entity store assignment by name for a provided subscription. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -698,31 +576,27 @@ public void delete(String resourceGroupName, String customEntityStoreAssignmentN /** * List custom entity store assignments in a subscription and a resource group - * - *

List custom entity store assignments by a provided subscription and resource group. - * + * + * List custom entity store assignments by a provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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 custom entity store assignments along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -731,56 +605,37 @@ private Mono> listByResourceGrou final String apiVersion = "2021-07-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)) + .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 custom entity store assignments in a subscription and a resource group - * - *

List custom entity store assignments by a provided subscription and resource group. - * + * + * List custom entity store assignments by a provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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 custom entity store assignments along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -790,31 +645,19 @@ private Mono> listByResourceGrou 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)); + .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 custom entity store assignments in a subscription and a resource group - * - *

List custom entity store assignments by a provided subscription and resource group. - * + * + * List custom entity store assignments by a provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -822,18 +665,17 @@ private Mono> listByResourceGrou */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** * List custom entity store assignments in a subscription and a resource group - * - *

List custom entity store assignments by a provided subscription and resource group. - * + * + * List custom entity store assignments by a provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -841,20 +683,19 @@ private PagedFlux listByResourceGroupAsync(Str * @return a list of custom entity store assignments as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** * List custom entity store assignments in a subscription and a resource group - * - *

List custom entity store assignments by a provided subscription and resource group. - * + * + * List custom entity store assignments by a provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -867,11 +708,11 @@ public PagedIterable listByResourceGroup(Strin /** * List custom entity store assignments in a subscription and a resource group - * - *

List custom entity store assignments by a provided subscription and resource group. - * + * + * List custom entity store assignments by a provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -879,116 +720,91 @@ public PagedIterable listByResourceGroup(Strin * @return a list of custom entity store assignments as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, Context context) { + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); } /** * List custom entity store assignments in a subscription - * - *

List custom entity store assignments by provided subscription. - * + * + * List custom entity store assignments by provided 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 custom entity store assignments along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2021-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)) + .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 custom entity store assignments in a subscription - * - *

List custom entity store assignments by provided subscription. - * + * + * List custom entity store assignments by provided 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 custom entity store assignments along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2021-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)); + 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 custom entity store assignments in a subscription - * - *

List custom entity store assignments by provided subscription. - * + * + * List custom entity store assignments by provided 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 custom entity store assignments as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { - return new PagedFlux<>( - () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** * List custom entity store assignments in a subscription - * - *

List custom entity store assignments by provided subscription. - * + * + * List custom entity store assignments by provided 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. @@ -997,15 +813,15 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** * List custom entity store assignments in a subscription - * - *

List custom entity store assignments by provided subscription. - * + * + * List custom entity store assignments by provided 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 custom entity store assignments as paginated response with {@link PagedIterable}. @@ -1017,9 +833,9 @@ public PagedIterable list() { /** * List custom entity store assignments in a subscription - * - *

List custom entity store assignments by provided subscription. - * + * + * List custom entity store assignments by provided 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. @@ -1033,157 +849,123 @@ public PagedIterable list(Context context) { /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 custom entity store assignments along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink) { + 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.")); + 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)) + .>map(res -> new 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 - *

The nextLink parameter. + * + * The nextLink 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 custom entity store assignments along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { + 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.")); + 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)); + 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 - *

The nextLink parameter. + * + * The nextLink 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 custom entity store assignments along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink) { + 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.")); + 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)) + .>map(res -> new 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 - *

The nextLink parameter. + * + * The nextLink 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 custom entity store assignments along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { + 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.")); + 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)); + 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/CustomEntityStoreAssignmentsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentsImpl.java index 2b1bdc19cc0ed..5ac206c8eea7b 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentsImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentsImpl.java @@ -21,34 +21,28 @@ public final class CustomEntityStoreAssignmentsImpl implements CustomEntityStore private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public CustomEntityStoreAssignmentsImpl( - CustomEntityStoreAssignmentsClient innerClient, + public CustomEntityStoreAssignmentsImpl(CustomEntityStoreAssignmentsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response getByResourceGroupWithResponse( - String resourceGroupName, String customEntityStoreAssignmentName, Context context) { - Response inner = - this - .serviceClient() - .getByResourceGroupWithResponse(resourceGroupName, customEntityStoreAssignmentName, context); + public Response getByResourceGroupWithResponse(String resourceGroupName, + String customEntityStoreAssignmentName, Context context) { + Response inner = this.serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, customEntityStoreAssignmentName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new CustomEntityStoreAssignmentImpl(inner.getValue(), this.manager())); } else { return null; } } - public CustomEntityStoreAssignment getByResourceGroup( - String resourceGroupName, String customEntityStoreAssignmentName) { - CustomEntityStoreAssignmentInner inner = - this.serviceClient().getByResourceGroup(resourceGroupName, customEntityStoreAssignmentName); + public CustomEntityStoreAssignment getByResourceGroup(String resourceGroupName, + String customEntityStoreAssignmentName) { + CustomEntityStoreAssignmentInner inner + = this.serviceClient().getByResourceGroup(resourceGroupName, customEntityStoreAssignmentName); if (inner != null) { return new CustomEntityStoreAssignmentImpl(inner, this.manager()); } else { @@ -56,8 +50,8 @@ public CustomEntityStoreAssignment getByResourceGroup( } } - public Response deleteByResourceGroupWithResponse( - String resourceGroupName, String customEntityStoreAssignmentName, Context context) { + public Response deleteByResourceGroupWithResponse(String resourceGroupName, + String customEntityStoreAssignmentName, Context context) { return this.serviceClient().deleteWithResponse(resourceGroupName, customEntityStoreAssignmentName, context); } @@ -66,117 +60,88 @@ public void deleteByResourceGroup(String resourceGroupName, String customEntityS } public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new CustomEntityStoreAssignmentImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new CustomEntityStoreAssignmentImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new CustomEntityStoreAssignmentImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new CustomEntityStoreAssignmentImpl(inner1, this.manager())); } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new CustomEntityStoreAssignmentImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new CustomEntityStoreAssignmentImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new CustomEntityStoreAssignmentImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new CustomEntityStoreAssignmentImpl(inner1, this.manager())); } public CustomEntityStoreAssignment getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); } - String customEntityStoreAssignmentName = Utils.getValueFromIdByName(id, "customEntityStoreAssignments"); + String customEntityStoreAssignmentName + = ResourceManagerUtils.getValueFromIdByName(id, "customEntityStoreAssignments"); if (customEntityStoreAssignmentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment" - + " 'customEntityStoreAssignments'.", - id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'customEntityStoreAssignments'.", id))); } - return this - .getByResourceGroupWithResponse(resourceGroupName, customEntityStoreAssignmentName, Context.NONE) + return this.getByResourceGroupWithResponse(resourceGroupName, customEntityStoreAssignmentName, Context.NONE) .getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); } - String customEntityStoreAssignmentName = Utils.getValueFromIdByName(id, "customEntityStoreAssignments"); + String customEntityStoreAssignmentName + = ResourceManagerUtils.getValueFromIdByName(id, "customEntityStoreAssignments"); if (customEntityStoreAssignmentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment" - + " 'customEntityStoreAssignments'.", - id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'customEntityStoreAssignments'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, customEntityStoreAssignmentName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); } - String customEntityStoreAssignmentName = Utils.getValueFromIdByName(id, "customEntityStoreAssignments"); + String customEntityStoreAssignmentName + = ResourceManagerUtils.getValueFromIdByName(id, "customEntityStoreAssignments"); if (customEntityStoreAssignmentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment" - + " 'customEntityStoreAssignments'.", - id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'customEntityStoreAssignments'.", id))); } this.deleteByResourceGroupWithResponse(resourceGroupName, customEntityStoreAssignmentName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); } - String customEntityStoreAssignmentName = Utils.getValueFromIdByName(id, "customEntityStoreAssignments"); + String customEntityStoreAssignmentName + = ResourceManagerUtils.getValueFromIdByName(id, "customEntityStoreAssignments"); if (customEntityStoreAssignmentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment" - + " 'customEntityStoreAssignments'.", - id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'customEntityStoreAssignments'.", id))); } return this.deleteByResourceGroupWithResponse(resourceGroupName, customEntityStoreAssignmentName, context); } 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 new file mode 100644 index 0000000000000..b5754f553d463 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStorageSettingImpl.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +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.OperationStatus; +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 Boolean isEnabled() { + return this.innerModel().isEnabled(); + } + + public Boolean overrideSubscriptionLevelSettings() { + return this.innerModel().overrideSubscriptionLevelSettings(); + } + + public String scanResultsEventGridTopicResourceId() { + return this.innerModel().scanResultsEventGridTopicResourceId(); + } + + public OperationStatus operationStatus() { + return this.innerModel().operationStatus(); + } + + public Boolean isEnabledMalwareScanningIsEnabled() { + return this.innerModel().isEnabledMalwareScanningIsEnabled(); + } + + public Integer capGBPerMonth() { + return this.innerModel().capGBPerMonth(); + } + + public Boolean isEnabledSensitiveDataDiscoveryIsEnabled() { + return this.innerModel().isEnabledSensitiveDataDiscoveryIsEnabled(); + } + + public OperationStatus operationStatusSensitiveDataDiscoveryOperationStatus() { + return this.innerModel().operationStatusSensitiveDataDiscoveryOperationStatus(); + } + + 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 DefenderForStorageSettingImpl withIsEnabled(Boolean isEnabled) { + this.innerModel().withIsEnabled(isEnabled); + return this; + } + + public DefenderForStorageSettingImpl + withOverrideSubscriptionLevelSettings(Boolean overrideSubscriptionLevelSettings) { + this.innerModel().withOverrideSubscriptionLevelSettings(overrideSubscriptionLevelSettings); + return this; + } + + public DefenderForStorageSettingImpl + withScanResultsEventGridTopicResourceId(String scanResultsEventGridTopicResourceId) { + this.innerModel().withScanResultsEventGridTopicResourceId(scanResultsEventGridTopicResourceId); + return this; + } + + public DefenderForStorageSettingImpl + withIsEnabledMalwareScanningIsEnabled(Boolean isEnabledMalwareScanningIsEnabled) { + this.innerModel().withIsEnabledMalwareScanningIsEnabled(isEnabledMalwareScanningIsEnabled); + return this; + } + + public DefenderForStorageSettingImpl withCapGBPerMonth(Integer capGBPerMonth) { + this.innerModel().withCapGBPerMonth(capGBPerMonth); + return this; + } + + public DefenderForStorageSettingImpl + withIsEnabledSensitiveDataDiscoveryIsEnabled(Boolean isEnabledSensitiveDataDiscoveryIsEnabled) { + this.innerModel().withIsEnabledSensitiveDataDiscoveryIsEnabled(isEnabledSensitiveDataDiscoveryIsEnabled); + 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 new file mode 100644 index 0000000000000..8e825be60930f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStoragesClientImpl.java @@ -0,0 +1,323 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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.DefenderForStoragesClient; +import com.azure.resourcemanager.security.fluent.models.DefenderForStorageSettingInner; +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("{$host}") + @ServiceInterface(name = "SecurityCenterDefend") + public interface DefenderForStoragesService { + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") 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" }) + @Put("/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceId", encoded = true) String resourceId, + @PathParam("settingName") SettingName settingName, + @BodyParam("application/json") DefenderForStorageSettingInner defenderForStorageSetting, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the Defender for Storage settings for the specified storage account. + * + * @param resourceId The identifier of the resource. + * @param settingName 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 = "2022-12-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 identifier of the resource. + * @param settingName 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 = "2022-12-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 identifier of the resource. + * @param settingName 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 identifier of the resource. + * @param settingName 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 identifier of the resource. + * @param settingName 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 identifier of the resource. + * @param settingName 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 = "2022-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), apiVersion, resourceId, settingName, + defenderForStorageSetting, accept, 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 identifier of the resource. + * @param settingName 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 = "2022-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), apiVersion, resourceId, settingName, defenderForStorageSetting, + accept, context); + } + + /** + * Creates or updates the Defender for Storage settings on a specified storage account. + * + * @param resourceId The identifier of the resource. + * @param settingName 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 identifier of the resource. + * @param settingName 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 identifier of the resource. + * @param settingName 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(); + } +} 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 new file mode 100644 index 0000000000000..1cc0bf9043b7a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStoragesImpl.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.DefenderForStoragesClient; +import com.azure.resourcemanager.security.fluent.models.DefenderForStorageSettingInner; +import com.azure.resourcemanager.security.models.DefenderForStorageSetting; +import com.azure.resourcemanager.security.models.DefenderForStorages; +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); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DefenderForStorageSettingImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 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 new file mode 100644 index 0000000000000..9e56179ffc970 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public DevOpsConfigurationProperties properties() { + return this.innerModel().properties(); + } + + 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 new file mode 100644 index 0000000000000..aa2a975542fdc --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationsClientImpl.java @@ -0,0 +1,1152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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.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("{$host}") + @ServiceInterface(name = "SecurityCenterDevOps") + public interface DevOpsConfigurationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @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("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DevOpsConfigurationInner devOpsConfiguration, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DevOpsConfigurationInner devOpsConfiguration, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "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("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * 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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, 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 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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, + apiVersion, 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)); + } + + /** + * 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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, apiVersion, 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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + securityConnectorName, apiVersion, 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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, apiVersion, devOpsConfiguration, accept, 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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + securityConnectorName, apiVersion, devOpsConfiguration, accept, 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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, apiVersion, devOpsConfiguration, accept, 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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + securityConnectorName, apiVersion, devOpsConfiguration, accept, 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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, apiVersion, accept, 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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + securityConnectorName, apiVersion, accept, 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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink 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> 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 + * + * The nextLink 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> 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 new file mode 100644 index 0000000000000..9a67afb8bd386 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationsImpl.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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 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())); + } + + public Response getWithResponse(String resourceGroupName, String securityConnectorName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, securityConnectorName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DevOpsConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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); + } + + 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 new file mode 100644 index 0000000000000..2877727b9f51c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsOperationResultsClientImpl.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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("{$host}") + @ServiceInterface(name = "SecurityCenterDevOps") + 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("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @PathParam("operationResultId") String operationResultId, @QueryParam("api-version") String apiVersion, + @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 operation result 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 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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, operationResultId, apiVersion, 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 operation result 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 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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + securityConnectorName, operationResultId, apiVersion, 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 operation result 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 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 operation result 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 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 operation result 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 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 new file mode 100644 index 0000000000000..72a9d7822e4ad --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsOperationResultsImpl.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OperationStatusResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 index 6edb2fe0dd317..c16f6f43d45b6 100644 --- 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 @@ -86,22 +86,15 @@ public DeviceSecurityGroupImpl withExistingResourceId(String resourceId) { } public DeviceSecurityGroup create() { - this.innerObject = - serviceManager - .serviceClient() - .getDeviceSecurityGroups() - .createOrUpdateWithResponse(resourceId, deviceSecurityGroupName, this.innerModel(), Context.NONE) - .getValue(); + 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(); + this.innerObject = serviceManager.serviceClient().getDeviceSecurityGroups() + .createOrUpdateWithResponse(resourceId, deviceSecurityGroupName, this.innerModel(), context).getValue(); return this; } @@ -116,60 +109,38 @@ public DeviceSecurityGroupImpl update() { } public DeviceSecurityGroup apply() { - this.innerObject = - serviceManager - .serviceClient() - .getDeviceSecurityGroups() - .createOrUpdateWithResponse(resourceId, deviceSecurityGroupName, this.innerModel(), Context.NONE) - .getValue(); + 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(); + this.innerObject = serviceManager.serviceClient().getDeviceSecurityGroups() + .createOrUpdateWithResponse(resourceId, deviceSecurityGroupName, this.innerModel(), context).getValue(); return this; } - DeviceSecurityGroupImpl( - DeviceSecurityGroupInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + DeviceSecurityGroupImpl(DeviceSecurityGroupInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceId = - Utils - .getValueFromIdByParameterName( - innerObject.id(), - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", - "resourceId"); - this.deviceSecurityGroupName = - Utils - .getValueFromIdByParameterName( - innerObject.id(), - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", - "deviceSecurityGroupName"); + 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(); + 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(); + this.innerObject = serviceManager.serviceClient().getDeviceSecurityGroups() + .getWithResponse(resourceId, deviceSecurityGroupName, context).getValue(); 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 index 0d3f936ce0620..a7a01f5ae19ad 100644 --- 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 @@ -33,95 +33,88 @@ import com.azure.resourcemanager.security.models.DeviceSecurityGroupList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in DeviceSecurityGroupsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final DeviceSecurityGroupsService service; - /** The service client containing this operation class. */ + /** + * 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.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. + * The interface defining all the services for SecurityCenterDeviceSecurityGroups to be used by the proxy service + * to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "SecurityCenterDevice") public interface DeviceSecurityGroupsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @HeaderParam("Accept") String accept, + @PathParam(value = "resourceId", encoded = true) String resourceId, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("deviceSecurityGroupName") String deviceSecurityGroupName, - @HeaderParam("Accept") String accept, + @PathParam("deviceSecurityGroupName") String deviceSecurityGroupName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Put("/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}") - @ExpectedResponses({200, 201}) + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, + Mono> createOrUpdate(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam(value = "resourceId", encoded = true) String resourceId, @PathParam("deviceSecurityGroupName") String deviceSecurityGroupName, @BodyParam("application/json") DeviceSecurityGroupInner deviceSecurityGroup, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Delete("/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}") - @ExpectedResponses({200, 204}) + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("deviceSecurityGroupName") String deviceSecurityGroupName, - @HeaderParam("Accept") String accept, + @PathParam("deviceSecurityGroupName") String deviceSecurityGroupName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Use this method get the list of device security groups for the specified IoT Hub resource. - * + * * @param resourceId The identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -131,10 +124,8 @@ Mono> listNext( @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.")); + 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.")); @@ -143,21 +134,14 @@ private Mono> listSinglePageAsync(String 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)) + .>map(res -> new 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 identifier of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -168,10 +152,8 @@ private Mono> listSinglePageAsync(String @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.")); + 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.")); @@ -179,22 +161,14 @@ private Mono> listSinglePageAsync(String 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)); + 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 identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -208,7 +182,7 @@ private PagedFlux listAsync(String resourceId) { /** * Use this method get the list of device security groups for the specified IoT Hub resource. - * + * * @param resourceId The identifier of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -218,13 +192,13 @@ private PagedFlux listAsync(String resourceId) { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceId, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceId, context), nextLink -> listNextSinglePageAsync(nextLink, 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 identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -238,7 +212,7 @@ public PagedIterable list(String resourceId) { /** * Use this method get the list of device security groups for the specified IoT Hub resource. - * + * * @param resourceId The identifier of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -253,54 +227,43 @@ public PagedIterable list(String resourceId, Context c /** * Use this method to get the device security group for the specified IoT Hub resource. - * + * * @param resourceId The 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. + * 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) { + 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.")); + 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.")); + 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)) + .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 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. + * 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. @@ -308,21 +271,18 @@ private Mono> getWithResponseAsync( * @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) { + 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.")); + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter deviceSecurityGroupName is required and cannot be null.")); } final String apiVersion = "2019-08-01"; final String accept = "application/json"; @@ -332,10 +292,10 @@ private Mono> getWithResponseAsync( /** * Use this method to get the device security group for the specified IoT Hub resource. - * + * * @param resourceId The 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. + * 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. @@ -349,10 +309,10 @@ private Mono getAsync(String resourceId, String device /** * Use this method to get the device security group for the specified IoT Hub resource. - * + * * @param resourceId The 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. + * 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. @@ -360,17 +320,17 @@ private Mono getAsync(String resourceId, String device * @return the device security group resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceId, String deviceSecurityGroupName, Context context) { + 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 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. + * 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. @@ -383,10 +343,10 @@ public DeviceSecurityGroupInner get(String resourceId, String deviceSecurityGrou /** * Use this method to creates or updates the device security group on a specified IoT Hub resource. - * + * * @param resourceId The 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. + * 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. @@ -394,21 +354,18 @@ public DeviceSecurityGroupInner get(String resourceId, String deviceSecurityGrou * @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) { + 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.")); + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter deviceSecurityGroupName is required and cannot be null.")); } if (deviceSecurityGroup == null) { return Mono @@ -419,26 +376,17 @@ private Mono> createOrUpdateWithResponseAsync final String apiVersion = "2019-08-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - resourceId, - deviceSecurityGroupName, - deviceSecurityGroup, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, resourceId, + deviceSecurityGroupName, deviceSecurityGroup, accept, 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 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. + * 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. @@ -447,24 +395,18 @@ private Mono> createOrUpdateWithResponseAsync * @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) { + 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.")); + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter deviceSecurityGroupName is required and cannot be null.")); } if (deviceSecurityGroup == null) { return Mono @@ -475,23 +417,16 @@ private Mono> createOrUpdateWithResponseAsync final String apiVersion = "2019-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - resourceId, - deviceSecurityGroupName, - deviceSecurityGroup, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), apiVersion, resourceId, deviceSecurityGroupName, + deviceSecurityGroup, accept, context); } /** * Use this method to creates or updates the device security group on a specified IoT Hub resource. - * + * * @param resourceId The 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. + * 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. @@ -499,18 +434,18 @@ private Mono> createOrUpdateWithResponseAsync * @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) { + 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 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. + * 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. @@ -519,21 +454,18 @@ private Mono createOrUpdateAsync( * @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) { + 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 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. + * 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. @@ -541,18 +473,18 @@ public Response createOrUpdateWithResponse( * @return the device security group resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeviceSecurityGroupInner createOrUpdate( - String resourceId, String deviceSecurityGroupName, DeviceSecurityGroupInner deviceSecurityGroup) { + 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 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. + * 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. @@ -561,41 +493,30 @@ public DeviceSecurityGroupInner createOrUpdate( @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.")); + 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.")); + 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 - .delete( - this.client.getEndpoint(), - apiVersion, - resourceId, - deviceSecurityGroupName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, resourceId, + deviceSecurityGroupName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * User this method to deletes the device security group. - * + * * @param resourceId The 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. + * 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. @@ -603,35 +524,32 @@ private Mono> deleteWithResponseAsync(String resourceId, String d * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceId, String deviceSecurityGroupName, Context context) { + 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.")); + 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.")); + 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 - .delete(this.client.getEndpoint(), apiVersion, resourceId, deviceSecurityGroupName, accept, context); + return service.delete(this.client.getEndpoint(), apiVersion, resourceId, deviceSecurityGroupName, accept, + context); } /** * User this method to deletes the device security group. - * + * * @param resourceId The 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. + * 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. @@ -644,10 +562,10 @@ private Mono deleteAsync(String resourceId, String deviceSecurityGroupName /** * User this method to deletes the device security group. - * + * * @param resourceId The 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. + * 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. @@ -661,10 +579,10 @@ public Response deleteWithResponse(String resourceId, String deviceSecurit /** * User this method to deletes the device security group. - * + * * @param resourceId The 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. + * 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. @@ -676,9 +594,10 @@ public void delete(String resourceId, String deviceSecurityGroupName) { /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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. @@ -690,31 +609,22 @@ private Mono> listNextSinglePageAsync(St 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -727,23 +637,13 @@ private Mono> listNextSinglePageAsync(St 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.")); + 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)); + 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 index 84a677f1ee3e8..d2941c4ea197b 100644 --- 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 @@ -21,31 +21,28 @@ public final class DeviceSecurityGroupsImpl implements DeviceSecurityGroups { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public DeviceSecurityGroupsImpl( - DeviceSecurityGroupsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + public DeviceSecurityGroupsImpl(DeviceSecurityGroupsClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list(String resourceId) { PagedIterable inner = this.serviceClient().list(resourceId); - return Utils.mapPage(inner, inner1 -> new DeviceSecurityGroupImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new DeviceSecurityGroupImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeviceSecurityGroupImpl(inner1, this.manager())); } - public Response getWithResponse( - String resourceId, String deviceSecurityGroupName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceId, deviceSecurityGroupName, context); + public Response getWithResponse(String resourceId, String deviceSecurityGroupName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceId, deviceSecurityGroupName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new DeviceSecurityGroupImpl(inner.getValue(), this.manager())); } else { return null; @@ -61,8 +58,8 @@ public DeviceSecurityGroup get(String resourceId, String deviceSecurityGroupName } } - public Response deleteByResourceGroupWithResponse( - String resourceId, String deviceSecurityGroupName, Context context) { + public Response deleteByResourceGroupWithResponse(String resourceId, String deviceSecurityGroupName, + Context context) { return this.serviceClient().deleteWithResponse(resourceId, deviceSecurityGroupName, context); } @@ -71,125 +68,69 @@ public void deleteByResourceGroup(String resourceId, String deviceSecurityGroupN } public DeviceSecurityGroup getById(String id) { - String resourceId = - Utils - .getValueFromIdByParameterName( - id, - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", - "resourceId"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); } - String deviceSecurityGroupName = - Utils - .getValueFromIdByParameterName( - id, - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", - "deviceSecurityGroupName"); + 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))); + 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 = - Utils - .getValueFromIdByParameterName( - id, - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", - "resourceId"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); } - String deviceSecurityGroupName = - Utils - .getValueFromIdByParameterName( - id, - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", - "deviceSecurityGroupName"); + 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))); + 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 = - Utils - .getValueFromIdByParameterName( - id, - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", - "resourceId"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); } - String deviceSecurityGroupName = - Utils - .getValueFromIdByParameterName( - id, - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", - "deviceSecurityGroupName"); + 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))); + 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 = - Utils - .getValueFromIdByParameterName( - id, - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", - "resourceId"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); } - String deviceSecurityGroupName = - Utils - .getValueFromIdByParameterName( - id, - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", - "deviceSecurityGroupName"); + 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))); + 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); } 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 index 65e6eb8b1f5b9..55df609e646e7 100644 --- 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 @@ -13,8 +13,7 @@ public final class DiscoveredSecuritySolutionImpl implements DiscoveredSecurityS private final com.azure.resourcemanager.security.SecurityManager serviceManager; - DiscoveredSecuritySolutionImpl( - DiscoveredSecuritySolutionInner innerObject, + DiscoveredSecuritySolutionImpl(DiscoveredSecuritySolutionInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 index ed28a5ae9ae9c..a770cf5d2571c 100644 --- 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 @@ -30,24 +30,28 @@ import com.azure.resourcemanager.security.models.DiscoveredSecuritySolutionList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in DiscoveredSecuritySolutionsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final DiscoveredSecuritySolutionsService service; - /** The service client containing this operation class. */ + /** + * 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.service = RestProxy.create(DiscoveredSecuritySolutionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -58,154 +62,112 @@ public final class DiscoveredSecuritySolutionsClientImpl implements DiscoveredSe @Host("{$host}") @ServiceInterface(name = "SecurityCenterDiscov") public interface DiscoveredSecuritySolutionsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/discoveredSecuritySolutions") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegion( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByHomeRegion(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("ascLocation") String ascLocation, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions/{discoveredSecuritySolutionName}") - @ExpectedResponses({200}) + @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("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ascLocation") String ascLocation, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, @PathParam("discoveredSecuritySolutionName") String discoveredSecuritySolutionName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByHomeRegionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context 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}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, + accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets 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}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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(), this.client.getSubscriptionId(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, 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}. + * @return a list of discovered Security Solutions for the subscription as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -214,27 +176,27 @@ private PagedFlux 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 - * PagedFlux}. + * @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)); + 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}. + * @return a list of discovered Security Solutions for the subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -243,13 +205,13 @@ public 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 ManagementException thrown if 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}. + * @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) { @@ -258,28 +220,24 @@ public PagedIterable list(Context 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. + * 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}. + * @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -287,54 +245,35 @@ private Mono> listByHomeRegionSin final String apiVersion = "2020-01-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByHomeRegion( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - ascLocation, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByHomeRegion(this.client.getEndpoint(), this.client.getSubscriptionId(), + ascLocation, apiVersion, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets 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. + * 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}. + * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -343,66 +282,57 @@ private Mono> listByHomeRegionSin final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByHomeRegion( - this.client.getEndpoint(), this.client.getSubscriptionId(), ascLocation, apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByHomeRegion(this.client.getEndpoint(), this.client.getSubscriptionId(), ascLocation, apiVersion, + 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. + * 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}. + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByHomeRegionAsync(String ascLocation) { - return new PagedFlux<>( - () -> listByHomeRegionSinglePageAsync(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. + * 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}. + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByHomeRegionAsync(String ascLocation, Context context) { - return new PagedFlux<>( - () -> listByHomeRegionSinglePageAsync(ascLocation, 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. + * 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}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByHomeRegion(String ascLocation) { @@ -411,15 +341,15 @@ public PagedIterable listByHomeRegion(String as /** * 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. + * 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}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByHomeRegion(String ascLocation, Context context) { @@ -428,32 +358,28 @@ public PagedIterable listByHomeRegion(String as /** * Gets a specific discovered Security Solution. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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}. + * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -463,58 +389,42 @@ private Mono> getWithResponseAsync( 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.")); + 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(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - discoveredSecuritySolutionName, - apiVersion, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, ascLocation, discoveredSecuritySolutionName, apiVersion, 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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}. + * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -524,33 +434,23 @@ private Mono> getWithResponseAsync( 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.")); + 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(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - discoveredSecuritySolutionName, - apiVersion, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, ascLocation, + discoveredSecuritySolutionName, apiVersion, accept, context); } /** * Gets a specific discovered Security Solution. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -558,19 +458,19 @@ private Mono> getWithResponseAsync( * @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) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -579,18 +479,18 @@ private Mono getAsync( * @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) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -598,16 +498,17 @@ public Response getWithResponse( * @return a specific discovered Security Solution. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DiscoveredSecuritySolutionInner get( - String resourceGroupName, String ascLocation, String discoveredSecuritySolutionName) { + public DiscoveredSecuritySolutionInner get(String resourceGroupName, String ascLocation, + String discoveredSecuritySolutionName) { return getWithResponse(resourceGroupName, ascLocation, discoveredSecuritySolutionName, Context.NONE).getValue(); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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. @@ -619,31 +520,22 @@ private Mono> listNextSinglePageA 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -651,37 +543,28 @@ private Mono> listNextSinglePageA * @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) { + 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.")); + 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)); + 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -693,31 +576,23 @@ private Mono> listByHomeRegionNex 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.")); + 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)) + .>map(res -> new 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -725,29 +600,19 @@ private Mono> listByHomeRegionNex * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionNextSinglePageAsync( - String nextLink, Context context) { + 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.")); + 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)); + return service.listByHomeRegionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DiscoveredSecuritySolutionsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DiscoveredSecuritySolutionsImpl.java index 3fc2fb690fe9c..83b4894ee9426 100644 --- 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 @@ -21,8 +21,7 @@ public final class DiscoveredSecuritySolutionsImpl implements DiscoveredSecurity private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public DiscoveredSecuritySolutionsImpl( - DiscoveredSecuritySolutionsClient innerClient, + public DiscoveredSecuritySolutionsImpl(DiscoveredSecuritySolutionsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -30,46 +29,45 @@ public DiscoveredSecuritySolutionsImpl( public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new DiscoveredSecuritySolutionImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new DiscoveredSecuritySolutionImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new DiscoveredSecuritySolutionImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new DiscoveredSecuritySolutionImpl(inner1, this.manager())); } public PagedIterable listByHomeRegion(String ascLocation) { PagedIterable inner = this.serviceClient().listByHomeRegion(ascLocation); - return Utils.mapPage(inner, inner1 -> new DiscoveredSecuritySolutionImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new DiscoveredSecuritySolutionImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().listByHomeRegion(ascLocation, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new DiscoveredSecuritySolutionImpl(inner1, this.manager())); } - public Response getWithResponse( - String resourceGroupName, String ascLocation, String discoveredSecuritySolutionName, Context context) { - Response inner = - this - .serviceClient() - .getWithResponse(resourceGroupName, ascLocation, discoveredSecuritySolutionName, context); + public Response getWithResponse(String resourceGroupName, String ascLocation, + String discoveredSecuritySolutionName, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceGroupName, + ascLocation, discoveredSecuritySolutionName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new DiscoveredSecuritySolutionImpl(inner.getValue(), this.manager())); } else { return null; } } - public DiscoveredSecuritySolution get( - String resourceGroupName, String ascLocation, String discoveredSecuritySolutionName) { - DiscoveredSecuritySolutionInner inner = - this.serviceClient().get(resourceGroupName, ascLocation, discoveredSecuritySolutionName); + 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 { 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 index aca3c0f73e305..cdb69a6db7002 100644 --- 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 @@ -12,8 +12,8 @@ public final class ExternalSecuritySolutionImpl implements ExternalSecuritySolut private final com.azure.resourcemanager.security.SecurityManager serviceManager; - ExternalSecuritySolutionImpl( - ExternalSecuritySolutionInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + ExternalSecuritySolutionImpl(ExternalSecuritySolutionInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 index db970ccd5c33d..0b806c14a20d7 100644 --- 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 @@ -30,24 +30,28 @@ import com.azure.resourcemanager.security.models.ExternalSecuritySolutionList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ExternalSecuritySolutionsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final ExternalSecuritySolutionsService service; - /** The service client containing this operation class. */ + /** + * 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.service = RestProxy.create(ExternalSecuritySolutionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -58,150 +62,108 @@ public final class ExternalSecuritySolutionsClientImpl implements ExternalSecuri @Host("{$host}") @ServiceInterface(name = "SecurityCenterExtern") public interface ExternalSecuritySolutionsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/externalSecuritySolutions") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegion( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByHomeRegion(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("ascLocation") String ascLocation, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions/{externalSecuritySolutionsName}") - @ExpectedResponses({200}) + @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("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ascLocation") String ascLocation, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, @PathParam("externalSecuritySolutionsName") String externalSecuritySolutionsName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByHomeRegionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context 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}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)) + .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}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)); + 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}. @@ -213,7 +175,7 @@ private PagedFlux 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. @@ -222,17 +184,17 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, 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}. + * @return a list of external security solutions for the subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -241,13 +203,13 @@ public 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 ManagementException thrown if 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}. + * @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) { @@ -256,28 +218,24 @@ public PagedIterable list(Context 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. + * 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}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -285,54 +243,35 @@ private Mono> listByHomeRegionSingl final String apiVersion = "2020-01-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByHomeRegion( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - ascLocation, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByHomeRegion(this.client.getEndpoint(), this.client.getSubscriptionId(), + ascLocation, apiVersion, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets 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. + * 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}. + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionSinglePageAsync( - String ascLocation, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -341,66 +280,57 @@ private Mono> listByHomeRegionSingl final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByHomeRegion( - this.client.getEndpoint(), this.client.getSubscriptionId(), ascLocation, apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByHomeRegion(this.client.getEndpoint(), this.client.getSubscriptionId(), ascLocation, apiVersion, + 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. + * 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}. + * @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), + 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. + * 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}. + * @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), + 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. + * 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}. + * @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) { @@ -409,15 +339,15 @@ public PagedIterable listByHomeRegion(String ascL /** * 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. + * 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}. + * @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) { @@ -426,32 +356,28 @@ public PagedIterable listByHomeRegion(String ascL /** * Gets a specific external Security Solution. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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}. + * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -461,58 +387,42 @@ private Mono> getWithResponseAsync( 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.")); + 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(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - externalSecuritySolutionsName, - apiVersion, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, ascLocation, externalSecuritySolutionsName, apiVersion, 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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}. + * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -522,33 +432,23 @@ private Mono> getWithResponseAsync( 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.")); + 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(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - externalSecuritySolutionsName, - apiVersion, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, ascLocation, + externalSecuritySolutionsName, apiVersion, accept, context); } /** * Gets a specific external Security Solution. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -556,19 +456,19 @@ private Mono> getWithResponseAsync( * @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) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -577,18 +477,18 @@ private Mono getAsync( * @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) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -596,16 +496,17 @@ public Response getWithResponse( * @return a specific external Security Solution. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ExternalSecuritySolutionInner get( - String resourceGroupName, String ascLocation, String externalSecuritySolutionsName) { + public ExternalSecuritySolutionInner get(String resourceGroupName, String ascLocation, + String externalSecuritySolutionsName) { return getWithResponse(resourceGroupName, ascLocation, externalSecuritySolutionsName, Context.NONE).getValue(); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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. @@ -617,31 +518,22 @@ private Mono> listNextSinglePageAsy 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -649,37 +541,28 @@ private Mono> listNextSinglePageAsy * @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) { + 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.")); + 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)); + 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -691,31 +574,23 @@ private Mono> listByHomeRegionNextS 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.")); + 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)) + .>map(res -> new 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -723,29 +598,19 @@ private Mono> listByHomeRegionNextS * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionNextSinglePageAsync( - String nextLink, Context context) { + 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.")); + 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)); + return service.listByHomeRegionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ExternalSecuritySolutionsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ExternalSecuritySolutionsImpl.java index 27d2cba5cf911..cd21d6455bc05 100644 --- 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 @@ -21,8 +21,7 @@ public final class ExternalSecuritySolutionsImpl implements ExternalSecuritySolu private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public ExternalSecuritySolutionsImpl( - ExternalSecuritySolutionsClient innerClient, + public ExternalSecuritySolutionsImpl(ExternalSecuritySolutionsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -30,46 +29,41 @@ public ExternalSecuritySolutionsImpl( public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new ExternalSecuritySolutionImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ExternalSecuritySolutionImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new ExternalSecuritySolutionImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ExternalSecuritySolutionImpl(inner1, this.manager())); } public PagedIterable listByHomeRegion(String ascLocation) { PagedIterable inner = this.serviceClient().listByHomeRegion(ascLocation); - return Utils.mapPage(inner, inner1 -> new ExternalSecuritySolutionImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new ExternalSecuritySolutionImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().listByHomeRegion(ascLocation, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ExternalSecuritySolutionImpl(inner1, this.manager())); } - public Response getWithResponse( - String resourceGroupName, String ascLocation, String externalSecuritySolutionsName, Context context) { - Response inner = - this - .serviceClient() - .getWithResponse(resourceGroupName, ascLocation, externalSecuritySolutionsName, context); + public Response getWithResponse(String resourceGroupName, String ascLocation, + String externalSecuritySolutionsName, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceGroupName, + ascLocation, externalSecuritySolutionsName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ExternalSecuritySolutionImpl(inner.getValue(), this.manager())); } else { return null; } } - public ExternalSecuritySolution get( - String resourceGroupName, String ascLocation, String externalSecuritySolutionsName) { - ExternalSecuritySolutionInner inner = - this.serviceClient().get(resourceGroupName, ascLocation, externalSecuritySolutionsName); + 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 { 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 new file mode 100644 index 0000000000000..403c137feb0d0 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsListResponseImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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 new file mode 100644 index 0000000000000..15134d6c65c67 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsResponseImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +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 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/GitHubOwnerImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnerImpl.java new file mode 100644 index 0000000000000..c8983ce0b00d9 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnerImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public GitHubOwnerProperties properties() { + return this.innerModel().properties(); + } + + 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 new file mode 100644 index 0000000000000..6d727c5be2593 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnerListResponseImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 new file mode 100644 index 0000000000000..dc2f11141c5da --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnersClientImpl.java @@ -0,0 +1,566 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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("{$host}") + @ServiceInterface(name = "SecurityCenterGitHub") + public interface GitHubOwnersService { + @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("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @QueryParam("api-version") String apiVersion, @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("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @QueryParam("api-version") String apiVersion, @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}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, @PathParam("ownerName") String ownerName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * 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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listAvailable(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, apiVersion, 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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listAvailable(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + securityConnectorName, apiVersion, 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. + * + * @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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, 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())); + } + + /** + * 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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, + apiVersion, 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 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 GitHub owner 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 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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, ownerName, apiVersion, 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 GitHub owner 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 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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + securityConnectorName, ownerName, apiVersion, 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 GitHub owner 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 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 GitHub owner 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 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 GitHub owner 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 gitHub Owner resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GitHubOwnerInner get(String resourceGroupName, String securityConnectorName, String ownerName) { + return getWithResponse(resourceGroupName, securityConnectorName, ownerName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink 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> 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 + * + * The nextLink 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> 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 new file mode 100644 index 0000000000000..8408b8f3bfec7 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnersImpl.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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 listAvailableWithResponse(String resourceGroupName, + String securityConnectorName, Context context) { + Response inner + = this.serviceClient().listAvailableWithResponse(resourceGroupName, securityConnectorName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new GitHubOwnerListResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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; + } + } + + 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 getWithResponse(String resourceGroupName, String securityConnectorName, + String ownerName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, securityConnectorName, ownerName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new GitHubOwnerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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; + } + } + + 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 new file mode 100644 index 0000000000000..1fadc2c71993f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubReposClientImpl.java @@ -0,0 +1,458 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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.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("{$host}") + @ServiceInterface(name = "SecurityCenterGitHub") + public interface GitHubReposService { + @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("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, @PathParam("ownerName") String ownerName, + @QueryParam("api-version") String apiVersion, @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/{repoName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, @PathParam("ownerName") String ownerName, + @PathParam("repoName") String repoName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * 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 GitHub owner 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, 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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, ownerName, 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())); + } + + /** + * 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 GitHub owner 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, 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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, + ownerName, apiVersion, 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 GitHub owner 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, + 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 GitHub owner 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, + 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 GitHub owner 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, + 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 GitHub owner 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, + String ownerName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, ownerName, 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 GitHub owner name. + * @param repoName The repository 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 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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, ownerName, repoName, apiVersion, 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 GitHub owner name. + * @param repoName The repository 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 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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + securityConnectorName, ownerName, repoName, apiVersion, 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 GitHub owner name. + * @param repoName The repository 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 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 GitHub owner name. + * @param repoName The repository 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 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 GitHub owner name. + * @param repoName The repository 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 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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink 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> 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 + * + * The nextLink 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> 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 new file mode 100644 index 0000000000000..e8ab7aec520d0 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubReposImpl.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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 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())); + } + + public Response getWithResponse(String resourceGroupName, String securityConnectorName, + String ownerName, String repoName, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceGroupName, + securityConnectorName, ownerName, repoName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new GitHubRepositoryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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; + } + } + + 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 new file mode 100644 index 0000000000000..7a7ea6f4781e8 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubRepositoryImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public GitHubRepositoryProperties properties() { + return this.innerModel().properties(); + } + + 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 new file mode 100644 index 0000000000000..76325ed4607fa --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public GitLabGroupProperties properties() { + return this.innerModel().properties(); + } + + 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 new file mode 100644 index 0000000000000..a5174724475eb --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupListResponseImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 new file mode 100644 index 0000000000000..ce7601333102b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupsClientImpl.java @@ -0,0 +1,568 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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("{$host}") + @ServiceInterface(name = "SecurityCenterGitLab") + public interface GitLabGroupsService { + @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("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @QueryParam("api-version") String apiVersion, @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("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @QueryParam("api-version") String apiVersion, @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}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @PathParam("groupFQName") String groupFQName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * 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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listAvailable(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, apiVersion, 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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listAvailable(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + securityConnectorName, apiVersion, 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. + * + * @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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, 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())); + } + + /** + * 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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, + apiVersion, 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 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 GitLab group fully-qualified 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 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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, groupFQName, apiVersion, 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 GitLab group fully-qualified 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 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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + securityConnectorName, groupFQName, apiVersion, 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 GitLab group fully-qualified 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 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 GitLab group fully-qualified 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 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 GitLab group fully-qualified 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 gitLab Group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GitLabGroupInner get(String resourceGroupName, String securityConnectorName, String groupFQName) { + return getWithResponse(resourceGroupName, securityConnectorName, groupFQName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink 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> 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 + * + * The nextLink 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> 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 new file mode 100644 index 0000000000000..d1480ba8ad7da --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupsImpl.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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 listAvailableWithResponse(String resourceGroupName, + String securityConnectorName, Context context) { + Response inner + = this.serviceClient().listAvailableWithResponse(resourceGroupName, securityConnectorName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new GitLabGroupListResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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; + } + } + + 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 getWithResponse(String resourceGroupName, String securityConnectorName, + String groupFQName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, securityConnectorName, groupFQName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new GitLabGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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; + } + } + + 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 new file mode 100644 index 0000000000000..df5e3c2e83e6c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public GitLabProjectProperties properties() { + return this.innerModel().properties(); + } + + 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 new file mode 100644 index 0000000000000..6fbdc3e23344f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectsClientImpl.java @@ -0,0 +1,466 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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.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("{$host}") + @ServiceInterface(name = "SecurityCenterGitLab") + public interface GitLabProjectsService { + @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("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @PathParam("groupFQName") String groupFQName, @QueryParam("api-version") String apiVersion, + @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/{projectName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @PathParam("groupFQName") String groupFQName, @PathParam("projectName") String projectName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets 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 GitLab group fully-qualified 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 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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, groupFQName, apiVersion, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets 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 GitLab group fully-qualified 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 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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, + groupFQName, apiVersion, 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 GitLab group fully-qualified 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 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 GitLab group fully-qualified 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 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 GitLab group fully-qualified 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 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 GitLab group fully-qualified 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 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)); + } + + /** + * 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 GitLab group fully-qualified name. + * @param projectName The project 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 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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, groupFQName, projectName, apiVersion, 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 GitLab group fully-qualified name. + * @param projectName The project 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 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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + securityConnectorName, groupFQName, projectName, apiVersion, 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 GitLab group fully-qualified name. + * @param projectName The project 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 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 GitLab group fully-qualified name. + * @param projectName The project 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 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 GitLab group fully-qualified name. + * @param projectName The project 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 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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink 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> 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 + * + * The nextLink 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> 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 new file mode 100644 index 0000000000000..320e60e0d33b8 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectsImpl.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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 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())); + } + + public Response getWithResponse(String resourceGroupName, String securityConnectorName, + String groupFQName, String projectName, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceGroupName, + securityConnectorName, groupFQName, projectName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new GitLabProjectImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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; + } + } + + 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 new file mode 100644 index 0000000000000..e41bff7ba5738 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabSubgroupsClientImpl.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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("{$host}") + @ServiceInterface(name = "SecurityCenterGitLab") + 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("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("securityConnectorName") String securityConnectorName, + @PathParam("groupFQName") String groupFQName, @QueryParam("api-version") String apiVersion, + @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 GitLab group fully-qualified 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 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 = "2023-09-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, groupFQName, apiVersion, 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 GitLab group fully-qualified 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 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 = "2023-09-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + securityConnectorName, groupFQName, apiVersion, 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 GitLab group fully-qualified 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 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 GitLab group fully-qualified 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 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 GitLab group fully-qualified 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 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 new file mode 100644 index 0000000000000..b7df246c9ce36 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabSubgroupsImpl.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new GitLabGroupListResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 index ec76254016772..90405669bbebc 100644 --- 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 @@ -75,22 +75,15 @@ public GovernanceAssignmentImpl withExistingAssessment(String scope, String asse } public GovernanceAssignment create() { - this.innerObject = - serviceManager - .serviceClient() - .getGovernanceAssignments() - .createOrUpdateWithResponse(scope, assessmentName, assignmentKey, this.innerModel(), Context.NONE) - .getValue(); + 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(); + this.innerObject = serviceManager.serviceClient().getGovernanceAssignments() + .createOrUpdateWithResponse(scope, assessmentName, assignmentKey, this.innerModel(), context).getValue(); return this; } @@ -105,66 +98,42 @@ public GovernanceAssignmentImpl update() { } public GovernanceAssignment apply() { - this.innerObject = - serviceManager - .serviceClient() - .getGovernanceAssignments() - .createOrUpdateWithResponse(scope, assessmentName, assignmentKey, this.innerModel(), Context.NONE) - .getValue(); + 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(); + this.innerObject = serviceManager.serviceClient().getGovernanceAssignments() + .createOrUpdateWithResponse(scope, assessmentName, assignmentKey, this.innerModel(), context).getValue(); return this; } - GovernanceAssignmentImpl( - GovernanceAssignmentInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + GovernanceAssignmentImpl(GovernanceAssignmentInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.scope = - Utils - .getValueFromIdByParameterName( - innerObject.id(), - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "scope"); - this.assessmentName = - Utils - .getValueFromIdByParameterName( - innerObject.id(), - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assessmentName"); - this.assignmentKey = - Utils - .getValueFromIdByParameterName( - innerObject.id(), - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assignmentKey"); + 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(); + 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(); + this.innerObject = serviceManager.serviceClient().getGovernanceAssignments() + .getWithResponse(scope, assessmentName, assignmentKey, context).getValue(); return this; } @@ -188,8 +157,8 @@ public GovernanceAssignmentImpl withIsGracePeriod(Boolean isGracePeriod) { return this; } - public GovernanceAssignmentImpl withGovernanceEmailNotification( - GovernanceEmailNotification governanceEmailNotification) { + public GovernanceAssignmentImpl + withGovernanceEmailNotification(GovernanceEmailNotification governanceEmailNotification) { this.innerModel().withGovernanceEmailNotification(governanceEmailNotification); 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 index 2f964e6ef3ee5..fc42a58cdcdbf 100644 --- 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 @@ -33,23 +33,28 @@ import com.azure.resourcemanager.security.models.GovernanceAssignmentsList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in GovernanceAssignmentsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final GovernanceAssignmentsService service; - /** The service client containing this operation class. */ + /** + * 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.service = RestProxy.create(GovernanceAssignmentsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -60,89 +65,68 @@ public final class GovernanceAssignmentsClientImpl implements GovernanceAssignme @Host("{$host}") @ServiceInterface(name = "SecurityCenterGovern") public interface GovernanceAssignmentsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("scope") String scope, - @PathParam("assessmentName") String assessmentName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @PathParam("assessmentName") String assessmentName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) @Get("/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("scope") String scope, - @PathParam("assessmentName") String assessmentName, - @PathParam("assignmentKey") String assignmentKey, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @PathParam("assessmentName") String assessmentName, @PathParam("assignmentKey") String assignmentKey, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) @Put("/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}") - @ExpectedResponses({200, 201}) + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("scope") String scope, - @PathParam("assessmentName") String assessmentName, - @PathParam("assignmentKey") String assignmentKey, + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @PathParam("assessmentName") String assessmentName, @PathParam("assignmentKey") String assignmentKey, @BodyParam("application/json") GovernanceAssignmentInner governanceAssignment, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, 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}) + @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("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("scope") String scope, - @PathParam("assessmentName") String assessmentName, - @PathParam("assignmentKey") String assignmentKey, - Context context); - - @Headers({"Content-Type: application/json"}) + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("scope") String scope, @PathParam("assessmentName") String assessmentName, + @PathParam("assignmentKey") String assignmentKey, Context context); + + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Get governance assignments on all of your resources inside a scope. - * + * * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param assessmentName The Assessment Key - A 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 governance assignments on all of your resources inside a scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * 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.")); + 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.")); @@ -155,40 +139,31 @@ private Mono> listSinglePageAsync(Strin 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)) + .>map(res -> new 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 assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param assessmentName The Assessment Key - A 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 governance assignments on all of your resources inside a scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String scope, String assessmentName, Context context) { + 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.")); + 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.")); @@ -199,71 +174,62 @@ private Mono> listSinglePageAsync( 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)); + 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 assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param assessmentName The Assessment Key - A 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 governance assignments on all of your resources inside a scope as paginated response with {@link - * PagedFlux}. + * @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)); + 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 assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param assessmentName The Assessment Key - A 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 governance assignments on all of your resources inside a scope as paginated response with {@link - * PagedFlux}. + * @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), + 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 assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param assessmentName The Assessment Key - A 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 governance assignments on all of your resources inside a scope as paginated response with {@link - * PagedIterable}. + * @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) { @@ -272,17 +238,17 @@ public PagedIterable list(String scope, String assess /** * Get governance assignments on all of your resources inside a scope. - * + * * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param assessmentName The Assessment Key - A 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 governance assignments on all of your resources inside a scope as paginated response with {@link - * PagedIterable}. + * @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) { @@ -291,26 +257,24 @@ public PagedIterable list(String scope, String assess /** * Get a specific governanceAssignment for the requested scope by AssignmentKey. - * + * * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param assessmentName The Assessment Key - A unique key for the assessment type. * @param assignmentKey The governance assignment key - the assessment key of the required 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 a specific governanceAssignment for the requested scope by AssignmentKey along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String scope, String assessmentName, String assignmentKey) { + 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.")); + 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.")); @@ -324,26 +288,17 @@ private Mono> getWithResponseAsync( 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)) + .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 assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param assessmentName The Assessment Key - A unique key for the assessment type. * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @param context The context to associate with this operation. @@ -351,16 +306,14 @@ private Mono> getWithResponseAsync( * @throws ManagementException 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}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String scope, String assessmentName, String assignmentKey, Context context) { + 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.")); + 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.")); @@ -374,23 +327,23 @@ private Mono> getWithResponseAsync( 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); + 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 assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param assessmentName The Assessment Key - A unique key for the assessment type. * @param assignmentKey The governance assignment key - the assessment key of the required 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 a specific governanceAssignment for the requested scope by AssignmentKey on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String scope, String assessmentName, String assignmentKey) { @@ -400,10 +353,10 @@ private Mono getAsync(String scope, String assessment /** * Get a specific governanceAssignment for the requested scope by AssignmentKey. - * + * * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param assessmentName The Assessment Key - A unique key for the assessment type. * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @param context The context to associate with this operation. @@ -413,17 +366,17 @@ private Mono getAsync(String scope, String assessment * @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) { + 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 assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param assessmentName The Assessment Key - A unique key for the assessment type. * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -438,27 +391,25 @@ public GovernanceAssignmentInner get(String scope, String assessmentName, String /** * Creates or updates a governance assignment on the given subscription. - * + * * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param assessmentName The Assessment Key - A unique key for the assessment type. * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @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}. + * @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) { + 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.")); + 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.")); @@ -478,27 +429,17 @@ private Mono> createOrUpdateWithResponseAsyn final String apiVersion = "2022-01-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - scope, - assessmentName, - assignmentKey, - governanceAssignment, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, scope, assessmentName, + assignmentKey, governanceAssignment, accept, 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 assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param assessmentName The Assessment Key - A unique key for the assessment type. * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @param governanceAssignment Governance assignment over a subscription scope. @@ -506,21 +447,15 @@ private Mono> createOrUpdateWithResponseAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @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) { + 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.")); + 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.")); @@ -540,24 +475,16 @@ private Mono> createOrUpdateWithResponseAsyn final String apiVersion = "2022-01-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - scope, - assessmentName, - assignmentKey, - governanceAssignment, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), apiVersion, scope, assessmentName, assignmentKey, + governanceAssignment, accept, context); } /** * Creates or updates a governance assignment on the given subscription. - * + * * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param assessmentName The Assessment Key - A unique key for the assessment type. * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @param governanceAssignment Governance assignment over a subscription scope. @@ -567,18 +494,18 @@ private Mono> createOrUpdateWithResponseAsyn * @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) { + 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 assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param assessmentName The Assessment Key - A unique key for the assessment type. * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @param governanceAssignment Governance assignment over a subscription scope. @@ -589,22 +516,18 @@ private Mono createOrUpdateAsync( * @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) { + 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 assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param assessmentName The Assessment Key - A unique key for the assessment type. * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @param governanceAssignment Governance assignment over a subscription scope. @@ -614,18 +537,18 @@ public Response createOrUpdateWithResponse( * @return governance assignment over a given scope. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GovernanceAssignmentInner createOrUpdate( - String scope, String assessmentName, String assignmentKey, GovernanceAssignmentInner governanceAssignment) { + 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 assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param assessmentName The Assessment Key - A unique key for the assessment type. * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -636,10 +559,8 @@ public GovernanceAssignmentInner createOrUpdate( @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.")); + 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.")); @@ -652,19 +573,17 @@ private Mono> deleteWithResponseAsync(String scope, String assess } final String apiVersion = "2022-01-01-preview"; return FluxUtil - .withContext( - context -> - service - .delete(this.client.getEndpoint(), apiVersion, scope, assessmentName, assignmentKey, context)) + .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 assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param assessmentName The Assessment Key - A unique key for the assessment type. * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @param context The context to associate with this operation. @@ -674,13 +593,11 @@ private Mono> deleteWithResponseAsync(String scope, String assess * @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) { + 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.")); + 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.")); @@ -698,10 +615,10 @@ private Mono> deleteWithResponseAsync( /** * Delete a GovernanceAssignment over a given scope. - * + * * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param assessmentName The Assessment Key - A unique key for the assessment type. * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -716,10 +633,10 @@ private Mono deleteAsync(String scope, String assessmentName, String assig /** * Delete a GovernanceAssignment over a given scope. - * + * * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param assessmentName The Assessment Key - A unique key for the assessment type. * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @param context The context to associate with this operation. @@ -729,17 +646,17 @@ private Mono deleteAsync(String scope, String assessmentName, String assig * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String scope, String assessmentName, String assignmentKey, Context context) { + 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 assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param assessmentName The Assessment Key - A unique key for the assessment type. * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -753,14 +670,15 @@ public void delete(String scope, String assessmentName, String assignmentKey) { /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 page of a governance assignments list along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return page of a governance assignments list along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -768,37 +686,28 @@ private Mono> listNextSinglePageAsync(S 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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 page of a governance assignments list along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return page of a governance assignments list along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -806,23 +715,13 @@ private Mono> listNextSinglePageAsync(S 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.")); + 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)); + 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 index d02b5180c6c05..54e9df9a52e2b 100644 --- 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 @@ -21,31 +21,28 @@ public final class GovernanceAssignmentsImpl implements GovernanceAssignments { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public GovernanceAssignmentsImpl( - GovernanceAssignmentsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + public GovernanceAssignmentsImpl(GovernanceAssignmentsClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list(String scope, String assessmentName) { PagedIterable inner = this.serviceClient().list(scope, assessmentName); - return Utils.mapPage(inner, inner1 -> new GovernanceAssignmentImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new GovernanceAssignmentImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new GovernanceAssignmentImpl(inner1, this.manager())); } - public Response getWithResponse( - String scope, String assessmentName, String assignmentKey, Context context) { - Response inner = - this.serviceClient().getWithResponse(scope, assessmentName, assignmentKey, context); + public Response getWithResponse(String scope, String assessmentName, String assignmentKey, + Context context) { + Response inner + = this.serviceClient().getWithResponse(scope, assessmentName, assignmentKey, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new GovernanceAssignmentImpl(inner.getValue(), this.manager())); } else { return null; @@ -61,8 +58,8 @@ public GovernanceAssignment get(String scope, String assessmentName, String assi } } - public Response deleteWithResponse( - String scope, String assessmentName, String assignmentKey, Context context) { + public Response deleteWithResponse(String scope, String assessmentName, String assignmentKey, + Context context) { return this.serviceClient().deleteWithResponse(scope, assessmentName, assignmentKey, context); } @@ -71,173 +68,101 @@ public void delete(String scope, String assessmentName, String assignmentKey) { } public GovernanceAssignment getById(String id) { - String scope = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "scope"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); } - String assessmentName = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assessmentName"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'assessments'.", id))); } - String assignmentKey = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assignmentKey"); + 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))); + 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 = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "scope"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); } - String assessmentName = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assessmentName"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'assessments'.", id))); } - String assignmentKey = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assignmentKey"); + 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))); + 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 = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "scope"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); } - String assessmentName = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assessmentName"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'assessments'.", id))); } - String assignmentKey = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assignmentKey"); + 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))); + 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 = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "scope"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); } - String assessmentName = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assessmentName"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'assessments'.", id))); } - String assignmentKey = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assignmentKey"); + 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))); + 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); } 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 index da9ab6f2522b3..8d633f3016568 100644 --- 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 @@ -121,22 +121,14 @@ public GovernanceRuleImpl withExistingScope(String scope) { } public GovernanceRule create() { - this.innerObject = - serviceManager - .serviceClient() - .getGovernanceRules() - .createOrUpdateWithResponse(scope, ruleId, this.innerModel(), Context.NONE) - .getValue(); + 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(); + this.innerObject = serviceManager.serviceClient().getGovernanceRules() + .createOrUpdateWithResponse(scope, ruleId, this.innerModel(), context).getValue(); return this; } @@ -151,48 +143,36 @@ public GovernanceRuleImpl update() { } public GovernanceRule apply() { - this.innerObject = - serviceManager - .serviceClient() - .getGovernanceRules() - .createOrUpdateWithResponse(scope, ruleId, this.innerModel(), Context.NONE) - .getValue(); + 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(); + this.innerObject = serviceManager.serviceClient().getGovernanceRules() + .createOrUpdateWithResponse(scope, ruleId, this.innerModel(), context).getValue(); return this; } - GovernanceRuleImpl( - GovernanceRuleInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + GovernanceRuleImpl(GovernanceRuleInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.scope = - Utils - .getValueFromIdByParameterName( - innerObject.id(), "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "scope"); - this.ruleId = - Utils - .getValueFromIdByParameterName( - innerObject.id(), "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "ruleId"); + 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(); + 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(); + this.innerObject + = serviceManager.serviceClient().getGovernanceRules().getWithResponse(scope, ruleId, context).getValue(); return this; } @@ -264,8 +244,8 @@ public GovernanceRuleImpl withOwnerSource(GovernanceRuleOwnerSource ownerSource) return this; } - public GovernanceRuleImpl withGovernanceEmailNotification( - GovernanceRuleEmailNotification governanceEmailNotification) { + public GovernanceRuleImpl + withGovernanceEmailNotification(GovernanceRuleEmailNotification governanceEmailNotification) { this.innerModel().withGovernanceEmailNotification(governanceEmailNotification); 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 index 011360e5c693e..9edfb6e6a036b 100644 --- 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 @@ -42,22 +42,28 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in GovernanceRulesClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final GovernanceRulesService service; - /** The service client containing this operation class. */ + /** + * 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.service + = RestProxy.create(GovernanceRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -68,110 +74,84 @@ public final class GovernanceRulesClientImpl implements GovernanceRulesClient { @Host("{$host}") @ServiceInterface(name = "SecurityCenterGovern") public interface GovernanceRulesService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/{scope}/providers/Microsoft.Security/governanceRules") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("scope") String scope, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("scope") String scope, - @PathParam("ruleId") String ruleId, - @HeaderParam("Accept") String accept, - Context context); + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @PathParam("ruleId") String ruleId, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Put("/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}") - @ExpectedResponses({200, 201}) + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("scope") String scope, - @PathParam("ruleId") String ruleId, - @BodyParam("application/json") GovernanceRuleInner governanceRule, - @HeaderParam("Accept") String accept, - Context context); + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @PathParam("ruleId") String ruleId, @BodyParam("application/json") GovernanceRuleInner governanceRule, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}") - @ExpectedResponses({200, 202, 204}) + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("scope") String scope, - @PathParam("ruleId") String ruleId, - Context context); + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @PathParam("ruleId") String ruleId, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Post("/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}/execute") - @ExpectedResponses({202}) + @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> execute( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("scope") String scope, + Mono>> execute(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, @PathParam("ruleId") String ruleId, @BodyParam("application/json") ExecuteGovernanceRuleParams executeGovernanceRuleParams, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}") - @ExpectedResponses({200, 202}) + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono operationResults( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("scope") String scope, - @PathParam("ruleId") String ruleId, - @PathParam("operationId") String operationId, - @HeaderParam("Accept") String accept, - Context context); + Mono operationResults(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("scope") String scope, + @PathParam("ruleId") String ruleId, @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Get a list of all relevant governance rules over a scope. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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}. + * 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.")); + 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.")); @@ -180,39 +160,30 @@ private Mono> listSinglePageAsync(String scop 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)) + .>map(res -> new 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 scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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}. + * 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.")); + 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.")); @@ -220,26 +191,18 @@ private Mono> listSinglePageAsync(String scop 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)); + 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 scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -252,11 +215,11 @@ private PagedFlux listAsync(String scope) { /** * Get a list of all relevant governance rules over a scope. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -265,17 +228,17 @@ private PagedFlux listAsync(String scope) { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String scope, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(scope, context), nextLink -> listNextSinglePageAsync(nextLink, 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 scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -288,11 +251,11 @@ public PagedIterable list(String scope) { /** * Get a list of all relevant governance rules over a scope. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -306,25 +269,23 @@ public PagedIterable list(String scope, Context context) { /** * Get a specific governance rule for the requested scope by ruleId. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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}. + * 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.")); + 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.")); @@ -341,26 +302,24 @@ private Mono> getWithResponseAsync(String scope, S /** * Get a specific governance rule for the requested scope by ruleId. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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}. + * 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.")); + 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.")); @@ -376,11 +335,11 @@ private Mono> getWithResponseAsync(String scope, S /** * Get a specific governance rule for the requested scope by ruleId. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -394,11 +353,11 @@ private Mono getAsync(String scope, String ruleId) { /** * Get a specific governance rule for the requested scope by ruleId. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -413,11 +372,11 @@ public Response getWithResponse(String scope, String ruleId /** * Get a specific governance rule for the requested scope by ruleId. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -431,11 +390,11 @@ public GovernanceRuleInner get(String scope, String ruleId) { /** * Creates or updates a governance rule over a given scope. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -444,13 +403,11 @@ public GovernanceRuleInner get(String scope, String ruleId) { * @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) { + 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.")); + 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.")); @@ -466,21 +423,18 @@ private Mono> createOrUpdateWithResponseAsync( final String apiVersion = "2022-01-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), apiVersion, scope, ruleId, governanceRule, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, scope, ruleId, + governanceRule, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates or updates a governance rule over a given scope. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -490,13 +444,11 @@ private Mono> createOrUpdateWithResponseAsync( * @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) { + 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.")); + 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.")); @@ -512,17 +464,17 @@ private Mono> createOrUpdateWithResponseAsync( final String apiVersion = "2022-01-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate(this.client.getEndpoint(), apiVersion, scope, ruleId, governanceRule, accept, context); + return service.createOrUpdate(this.client.getEndpoint(), apiVersion, scope, ruleId, governanceRule, accept, + context); } /** * Creates or updates a governance rule over a given scope. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -531,19 +483,19 @@ private Mono> createOrUpdateWithResponseAsync( * @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) { + 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 scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -553,18 +505,18 @@ private Mono createOrUpdateAsync( * @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) { + 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 scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -579,11 +531,11 @@ public GovernanceRuleInner createOrUpdate(String scope, String ruleId, Governanc /** * Delete a Governance rule over a given scope. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -593,10 +545,8 @@ public GovernanceRuleInner createOrUpdate(String scope, String ruleId, Governanc @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.")); + 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.")); @@ -612,11 +562,11 @@ private Mono>> deleteWithResponseAsync(String scope, S /** * Delete a Governance rule over a given scope. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -627,10 +577,8 @@ private Mono>> deleteWithResponseAsync(String scope, S @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.")); + 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.")); @@ -645,11 +593,11 @@ private Mono>> deleteWithResponseAsync(String scope, S /** * Delete a Governance rule over a given scope. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -659,19 +607,17 @@ private Mono>> deleteWithResponseAsync(String scope, S @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()); + 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 scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -683,18 +629,17 @@ private PollerFlux, Void> beginDeleteAsync(String scope, String 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); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Delete a Governance rule over a given scope. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -708,11 +653,11 @@ public SyncPoller, Void> beginDelete(String scope, String ruleI /** * Delete a Governance rule over a given scope. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -727,11 +672,11 @@ public SyncPoller, Void> beginDelete(String scope, String ruleI /** * Delete a Governance rule over a given scope. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -745,11 +690,11 @@ private Mono deleteAsync(String scope, String ruleId) { /** * Delete a Governance rule over a given scope. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -764,11 +709,11 @@ private Mono deleteAsync(String scope, String ruleId, Context context) { /** * Delete a Governance rule over a given scope. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -781,11 +726,11 @@ public void delete(String scope, String ruleId) { /** * Delete a Governance rule over a given scope. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -799,11 +744,11 @@ public void delete(String scope, String ruleId, Context context) { /** * Execute a governance rule. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -812,13 +757,11 @@ public void delete(String scope, String ruleId, Context context) { * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> executeWithResponseAsync( - String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams) { + 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.")); + 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.")); @@ -832,27 +775,18 @@ private Mono>> executeWithResponseAsync( final String apiVersion = "2022-01-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .execute( - this.client.getEndpoint(), - apiVersion, - scope, - ruleId, - executeGovernanceRuleParams, - accept, - context)) + .withContext(context -> service.execute(this.client.getEndpoint(), apiVersion, scope, ruleId, + executeGovernanceRuleParams, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Execute a governance rule. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -862,13 +796,11 @@ private Mono>> executeWithResponseAsync( * @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) { + 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.")); + 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.")); @@ -882,18 +814,17 @@ private Mono>> executeWithResponseAsync( final String apiVersion = "2022-01-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .execute( - this.client.getEndpoint(), apiVersion, scope, ruleId, executeGovernanceRuleParams, accept, context); + return service.execute(this.client.getEndpoint(), apiVersion, scope, ruleId, executeGovernanceRuleParams, + accept, context); } /** * Execute a governance rule. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -902,22 +833,20 @@ private Mono>> executeWithResponseAsync( * @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) { + 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()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Execute a governance rule. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -928,19 +857,17 @@ private PollerFlux, Void> beginExecuteAsync( 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()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Execute a governance rule. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -950,23 +877,22 @@ private PollerFlux, Void> beginExecuteAsync(String scope, Strin * @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) { + 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); + 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 scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -981,11 +907,11 @@ public SyncPoller, Void> beginExecute(String scope, String rule /** * Execute a governance rule. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -995,18 +921,18 @@ public SyncPoller, Void> beginExecute(String scope, String rule * @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) { + 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 scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -1015,20 +941,19 @@ public SyncPoller, Void> beginExecute( * @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() + 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 scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -1038,18 +963,17 @@ private Mono executeAsync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono executeAsync(String scope, String ruleId) { final ExecuteGovernanceRuleParams executeGovernanceRuleParams = null; - return beginExecuteAsync(scope, ruleId, executeGovernanceRuleParams) - .last() + return beginExecuteAsync(scope, ruleId, executeGovernanceRuleParams).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Execute a governance rule. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -1059,20 +983,19 @@ private Mono executeAsync(String scope, String ruleId) { * @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() + 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 scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -1086,11 +1009,11 @@ public void execute(String scope, String ruleId) { /** * Execute a governance rule. - * + * * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @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. @@ -1099,34 +1022,32 @@ public void execute(String scope, String ruleId) { * @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) { + 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 rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). * @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}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono operationResultsWithResponseAsync( - String scope, String ruleId, String operationId) { + 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.")); + 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.")); @@ -1140,21 +1061,18 @@ private Mono operationResultsWithRespon 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)) + .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 rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). * @param operationId The governance rule long running operation unique key. * @param context The context to associate with this operation. @@ -1162,16 +1080,14 @@ private Mono operationResultsWithRespon * @throws 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}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono operationResultsWithResponseAsync( - String scope, String ruleId, String operationId, Context context) { + 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.")); + 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.")); @@ -1185,39 +1101,39 @@ private Mono operationResultsWithRespon 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); + 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 rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). * @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}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono operationResultsAsync( - String scope, String ruleId, String operationId) { + 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 rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). * @param operationId The governance rule long running operation unique key. * @param context The context to associate with this operation. @@ -1227,18 +1143,18 @@ private Mono operationResultsAsync( * @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) { + 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 rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. + * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: + * 'subscriptions/{subscriptionId}'), or security connector (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). * @param operationId The governance rule long running operation unique key. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1253,14 +1169,15 @@ public OperationResultAutoGeneratedInner operationResults(String scope, String r /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 page of a governance rules list along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return page of a governance rules list along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1268,37 +1185,28 @@ private Mono> listNextSinglePageAsync(String 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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 page of a governance rules list along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return page of a governance rules list along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -1306,23 +1214,13 @@ private Mono> listNextSinglePageAsync(String 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.")); + 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)); + 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 index 30860d8f1e41e..d225d2c02b165 100644 --- 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 @@ -25,29 +25,26 @@ public final class GovernanceRulesImpl implements GovernanceRules { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public GovernanceRulesImpl( - GovernanceRulesClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + public GovernanceRulesImpl(GovernanceRulesClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list(String scope) { PagedIterable inner = this.serviceClient().list(scope); - return Utils.mapPage(inner, inner1 -> new GovernanceRuleImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new GovernanceRuleImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new GovernanceRuleImpl(inner1, this.manager())); } public Response getWithResponse(String scope, String ruleId, Context context) { Response inner = this.serviceClient().getWithResponse(scope, ruleId, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new GovernanceRuleImpl(inner.getValue(), this.manager())); } else { return null; @@ -75,20 +72,17 @@ public void execute(String scope, String ruleId) { this.serviceClient().execute(scope, ruleId); } - public void execute( - String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { + 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); + 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(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new OperationResultAutoGeneratedImpl(inner.getValue(), this.manager())); } else { return null; @@ -105,101 +99,65 @@ public OperationResultAutoGenerated operationResults(String scope, String ruleId } public GovernanceRule getById(String id) { - String scope = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "scope"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); } - String ruleId = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "ruleId"); + 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))); + 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 = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "scope"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); } - String ruleId = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "ruleId"); + 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))); + 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 = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "scope"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); } - String ruleId = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "ruleId"); + 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))); + 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 = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "scope"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); } - String ruleId = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "ruleId"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'governanceRules'.", id))); } this.delete(scope, ruleId, context); } 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 index e93fab68ae8e3..f238c398a50cb 100644 --- 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 @@ -13,6 +13,7 @@ import com.azure.resourcemanager.security.models.StatusAutoGenerated; import java.util.Collections; import java.util.List; +import java.util.Map; public final class HealthReportImpl implements HealthReport { private HealthReportInner innerObject; @@ -61,6 +62,24 @@ public List affectedDefendersPlans() { } } + 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) { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportOperationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportOperationsClientImpl.java deleted file mode 100644 index d2c16f0a8577c..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportOperationsClientImpl.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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.HealthReportOperationsClient; -import com.azure.resourcemanager.security.fluent.models.HealthReportInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in HealthReportOperationsClient. */ -public final class HealthReportOperationsClientImpl implements HealthReportOperationsClient { - /** The proxy service used to perform REST calls. */ - private final HealthReportOperationsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of HealthReportOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - HealthReportOperationsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create(HealthReportOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterHealthReportOperations to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterHealth") - public interface HealthReportOperationsService { - @Headers({"Content-Type: application/json"}) - @Get("/{resourceId}/providers/Microsoft.Security/healthReports/{healthReportName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("healthReportName") String healthReportName, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get health report of resource. - * - * @param resourceId The identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report 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 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-02-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 identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report 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 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-02-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 identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report 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 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 identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report 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 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 identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report 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 health report of resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HealthReportInner get(String resourceId, String healthReportName) { - return getWithResponse(resourceId, healthReportName, Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportOperationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportOperationsImpl.java deleted file mode 100644 index 6824b37162f94..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportOperationsImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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.HealthReportOperationsClient; -import com.azure.resourcemanager.security.fluent.models.HealthReportInner; -import com.azure.resourcemanager.security.models.HealthReport; -import com.azure.resourcemanager.security.models.HealthReportOperations; - -public final class HealthReportOperationsImpl implements HealthReportOperations { - private static final ClientLogger LOGGER = new ClientLogger(HealthReportOperationsImpl.class); - - private final HealthReportOperationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public HealthReportOperationsImpl( - HealthReportOperationsClient 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); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new HealthReportImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - 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; - } - } - - private HealthReportOperationsClient 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/HealthReportsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsClientImpl.java index 06047bcaac586..f1e296fdb5573 100644 --- 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 @@ -30,22 +30,28 @@ import com.azure.resourcemanager.security.models.HealthReportsList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in HealthReportsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final HealthReportsService service; - /** The service client containing this operation class. */ + /** + * 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.service + = RestProxy.create(HealthReportsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -56,64 +62,59 @@ public final class HealthReportsClientImpl implements HealthReportsClient { @Host("{$host}") @ServiceInterface(name = "SecurityCenterHealth") public interface HealthReportsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/{scope}/providers/Microsoft.Security/healthReports") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") 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("/{resourceId}/providers/Microsoft.Security/healthReports/{healthReportName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, + @PathParam(value = "resourceId", encoded = true) String resourceId, + @PathParam("healthReportName") String healthReportName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context 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 scope at which the operation is performed. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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}. + * {@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.")); + 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-02-01-preview"; + 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)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -121,47 +122,37 @@ private Mono> listSinglePageAsync(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 scope at which the operation is performed. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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}. + * {@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.")); + 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-02-01-preview"; + 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)); + 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 scope at which the operation is performed. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -177,7 +168,7 @@ private PagedFlux listAsync(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 scope at which the operation is performed. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -187,15 +178,15 @@ private PagedFlux listAsync(String scope) { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String scope, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(scope, context), nextLink -> listNextSinglePageAsync(nextLink, 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 scope at which the operation is performed. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -211,7 +202,7 @@ public 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 scope at which the operation is performed. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -224,11 +215,120 @@ public PagedIterable list(String scope, Context context) { return new PagedIterable<>(listAsync(scope, context)); } + /** + * Get health report of resource. + * + * @param resourceId The identifier of the resource. + * @param healthReportName The health report Key - Unique key for the health report 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 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 identifier of the resource. + * @param healthReportName The health report Key - Unique key for the health report 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 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 identifier of the resource. + * @param healthReportName The health report Key - Unique key for the health report 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 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 identifier of the resource. + * @param healthReportName The health report Key - Unique key for the health report 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 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 identifier of the resource. + * @param healthReportName The health report Key - Unique key for the health report 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 health report of resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HealthReportInner get(String resourceId, String healthReportName) { + return getWithResponse(resourceId, healthReportName, Context.NONE).getValue(); + } + /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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. @@ -240,31 +340,22 @@ private Mono> listNextSinglePageAsync(String ne 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -277,23 +368,13 @@ private Mono> listNextSinglePageAsync(String ne 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.")); + 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)); + 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 index cf87726c02728..4fea8a3b2f191 100644 --- 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 @@ -5,6 +5,8 @@ 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; @@ -19,20 +21,39 @@ public final class HealthReportsImpl implements HealthReports { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public HealthReportsImpl( - HealthReportsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + public HealthReportsImpl(HealthReportsClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list(String scope) { PagedIterable inner = this.serviceClient().list(scope); - return Utils.mapPage(inner, inner1 -> new HealthReportImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new HealthReportImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HealthReportImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceId, String healthReportName, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceId, healthReportName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new HealthReportImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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; + } } private HealthReportsClient serviceClient() { 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 index c766c7e38b84a..23db3021a2bd3 100644 --- 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 @@ -33,26 +33,28 @@ 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. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final InformationProtectionPoliciesService service; - /** The service client containing this operation class. */ + /** + * 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.service = RestProxy.create(InformationProtectionPoliciesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -63,60 +65,47 @@ public final class InformationProtectionPoliciesClientImpl implements Informatio @Host("{$host}") @ServiceInterface(name = "SecurityCenterInform") public interface InformationProtectionPoliciesService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("informationProtectionPolicyName") - InformationProtectionPolicyName informationProtectionPolicyName, - @HeaderParam("Accept") String accept, - Context context); + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("informationProtectionPolicyName") InformationProtectionPolicyName informationProtectionPolicyName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Put("/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}") - @ExpectedResponses({200, 201}) + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("informationProtectionPolicyName") - InformationProtectionPolicyName informationProtectionPolicyName, + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("informationProtectionPolicyName") InformationProtectionPolicyName informationProtectionPolicyName, @BodyParam("application/json") InformationProtectionPolicyInner informationProtectionPolicy, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/{scope}/providers/Microsoft.Security/informationProtectionPolicies") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") 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"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Details of the information protection policy. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @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. @@ -124,44 +113,32 @@ Mono> listNext( * @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) { + 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.")); + 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.")); + 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)) + .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 Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @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. @@ -170,35 +147,31 @@ private Mono> getWithResponseAsync( * @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) { + 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.")); + 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.")); + 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); + return service.get(this.client.getEndpoint(), apiVersion, scope, informationProtectionPolicyName, accept, + context); } /** * Details of the information protection policy. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @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. @@ -206,17 +179,17 @@ private Mono> getWithResponseAsync( * @return information protection policy on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String scope, InformationProtectionPolicyName informationProtectionPolicyName) { + 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 Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @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. @@ -225,16 +198,16 @@ private Mono getAsync( * @return information protection policy along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String scope, InformationProtectionPolicyName informationProtectionPolicyName, Context context) { + public Response getWithResponse(String scope, + InformationProtectionPolicyName informationProtectionPolicyName, Context context) { return getWithResponseAsync(scope, informationProtectionPolicyName, context).block(); } /** * Details of the information protection policy. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @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. @@ -242,16 +215,16 @@ public Response getWithResponse( * @return information protection policy. */ @ServiceMethod(returns = ReturnType.SINGLE) - public InformationProtectionPolicyInner get( - String scope, InformationProtectionPolicyName informationProtectionPolicyName) { + public InformationProtectionPolicyInner get(String scope, + InformationProtectionPolicyName informationProtectionPolicyName) { return getWithResponse(scope, informationProtectionPolicyName, Context.NONE).getValue(); } /** * Details of the information protection policy. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param informationProtectionPolicyName Name of the information protection policy. * @param informationProtectionPolicy Information protection policy. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -260,55 +233,39 @@ public InformationProtectionPolicyInner get( * @return information protection policy along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String scope, + 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.")); + 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.")); + 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.")); + 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 accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - scope, - informationProtectionPolicyName, - informationProtectionPolicy, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, scope, + informationProtectionPolicyName, informationProtectionPolicy, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Details of the information protection policy. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param informationProtectionPolicyName Name of the information protection policy. * @param informationProtectionPolicy Information protection policy. * @param context The context to associate with this operation. @@ -318,53 +275,38 @@ private Mono> createOrUpdateWithRespo * @return information protection policy along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String scope, + private Mono> createOrUpdateWithResponseAsync(String scope, InformationProtectionPolicyName informationProtectionPolicyName, - InformationProtectionPolicyInner informationProtectionPolicy, - Context context) { + InformationProtectionPolicyInner informationProtectionPolicy, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + 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.")); + 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 accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - scope, - informationProtectionPolicyName, - informationProtectionPolicy, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), apiVersion, scope, informationProtectionPolicyName, + informationProtectionPolicy, accept, context); } /** * Details of the information protection policy. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param informationProtectionPolicyName Name of the information protection policy. * @param informationProtectionPolicy Information protection policy. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -373,8 +315,7 @@ private Mono> createOrUpdateWithRespo * @return information protection policy on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String scope, + private Mono createOrUpdateAsync(String scope, InformationProtectionPolicyName informationProtectionPolicyName, InformationProtectionPolicyInner informationProtectionPolicy) { return createOrUpdateWithResponseAsync(scope, informationProtectionPolicyName, informationProtectionPolicy) @@ -383,9 +324,9 @@ private Mono createOrUpdateAsync( /** * Details of the information protection policy. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param informationProtectionPolicyName Name of the information protection policy. * @param informationProtectionPolicy Information protection policy. * @param context The context to associate with this operation. @@ -395,21 +336,18 @@ private Mono createOrUpdateAsync( * @return information protection policy along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String scope, + public Response createOrUpdateWithResponse(String scope, InformationProtectionPolicyName informationProtectionPolicyName, - InformationProtectionPolicyInner informationProtectionPolicy, - Context context) { - return createOrUpdateWithResponseAsync( - scope, informationProtectionPolicyName, informationProtectionPolicy, context) - .block(); + InformationProtectionPolicyInner informationProtectionPolicy, Context context) { + return createOrUpdateWithResponseAsync(scope, informationProtectionPolicyName, informationProtectionPolicy, + context).block(); } /** * Details of the information protection policy. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param informationProtectionPolicyName Name of the information protection policy. * @param informationProtectionPolicy Information protection policy. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -418,33 +356,29 @@ public Response createOrUpdateWithResponse( * @return information protection policy. */ @ServiceMethod(returns = ReturnType.SINGLE) - public InformationProtectionPolicyInner createOrUpdate( - String scope, + public InformationProtectionPolicyInner createOrUpdate(String scope, InformationProtectionPolicyName informationProtectionPolicyName, InformationProtectionPolicyInner informationProtectionPolicy) { - return createOrUpdateWithResponse( - scope, informationProtectionPolicyName, informationProtectionPolicy, Context.NONE) - .getValue(); + return createOrUpdateWithResponse(scope, informationProtectionPolicyName, informationProtectionPolicy, + Context.NONE).getValue(); } /** * Information protection policies of a specific management group. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * {@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.")); + 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.")); @@ -453,37 +387,28 @@ private Mono> listSinglePageAsyn 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)) + .>map(res -> new 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 Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * {@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.")); + 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.")); @@ -491,24 +416,16 @@ private Mono> listSinglePageAsyn 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)); + 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 Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -521,9 +438,9 @@ private PagedFlux listAsync(String scope) { /** * Information protection policies of a specific management group. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -532,15 +449,15 @@ private PagedFlux listAsync(String scope) { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String scope, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(scope, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(scope, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Information protection policies of a specific management group. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -553,9 +470,9 @@ public PagedIterable list(String scope) { /** * Information protection policies of a specific management group. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -569,14 +486,15 @@ public PagedIterable list(String scope, Contex /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 information protection policies response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -584,62 +502,43 @@ private Mono> listNextSinglePage 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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 information protection policies response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { + 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.")); + 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)); + 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 index 708c43674c306..a4e09b7273f7a 100644 --- 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 @@ -22,30 +22,26 @@ public final class InformationProtectionPoliciesImpl implements InformationProte private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public InformationProtectionPoliciesImpl( - InformationProtectionPoliciesClient innerClient, + 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); + public Response getWithResponse(String scope, + InformationProtectionPolicyName informationProtectionPolicyName, Context context) { + Response inner + = this.serviceClient().getWithResponse(scope, informationProtectionPolicyName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new InformationProtectionPolicyImpl(inner.getValue(), this.manager())); } else { return null; } } - public InformationProtectionPolicy get( - String scope, InformationProtectionPolicyName informationProtectionPolicyName) { + public InformationProtectionPolicy get(String scope, + InformationProtectionPolicyName informationProtectionPolicyName) { InformationProtectionPolicyInner inner = this.serviceClient().get(scope, informationProtectionPolicyName); if (inner != null) { return new InformationProtectionPolicyImpl(inner, this.manager()); @@ -56,79 +52,53 @@ public InformationProtectionPolicy get( public PagedIterable list(String scope) { PagedIterable inner = this.serviceClient().list(scope); - return Utils.mapPage(inner, inner1 -> new InformationProtectionPolicyImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new InformationProtectionPolicyImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new InformationProtectionPolicyImpl(inner1, this.manager())); } public InformationProtectionPolicy getById(String id) { - String scope = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}", - "scope"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); } - String informationProtectionPolicyNameLocal = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}", - "informationProtectionPolicyName"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'informationProtectionPolicies'.", id))); } - InformationProtectionPolicyName informationProtectionPolicyName = - InformationProtectionPolicyName.fromString(informationProtectionPolicyNameLocal); + InformationProtectionPolicyName informationProtectionPolicyName + = InformationProtectionPolicyName.fromString(informationProtectionPolicyNameLocal); return this.getWithResponse(scope, informationProtectionPolicyName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String scope = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}", - "scope"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); } - String informationProtectionPolicyNameLocal = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}", - "informationProtectionPolicyName"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'informationProtectionPolicies'.", id))); } - InformationProtectionPolicyName informationProtectionPolicyName = - InformationProtectionPolicyName.fromString(informationProtectionPolicyNameLocal); + InformationProtectionPolicyName informationProtectionPolicyName + = InformationProtectionPolicyName.fromString(informationProtectionPolicyNameLocal); return this.getWithResponse(scope, informationProtectionPolicyName, context); } 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 index a470297b2563c..f09b0bbb51144 100644 --- 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 @@ -76,27 +76,20 @@ public InformationProtectionPolicyImpl withExistingScope(String scope) { } public InformationProtectionPolicy create() { - this.innerObject = - serviceManager - .serviceClient() - .getInformationProtectionPolicies() - .createOrUpdateWithResponse(scope, informationProtectionPolicyName, this.innerModel(), Context.NONE) - .getValue(); + 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(); + this.innerObject = serviceManager.serviceClient().getInformationProtectionPolicies() + .createOrUpdateWithResponse(scope, informationProtectionPolicyName, this.innerModel(), context).getValue(); return this; } - InformationProtectionPolicyImpl( - InformationProtectionPolicyName name, com.azure.resourcemanager.security.SecurityManager serviceManager) { + InformationProtectionPolicyImpl(InformationProtectionPolicyName name, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = new InformationProtectionPolicyInner(); this.serviceManager = serviceManager; this.informationProtectionPolicyName = name; @@ -107,63 +100,40 @@ public InformationProtectionPolicyImpl update() { } public InformationProtectionPolicy apply() { - this.innerObject = - serviceManager - .serviceClient() - .getInformationProtectionPolicies() - .createOrUpdateWithResponse(scope, informationProtectionPolicyName, this.innerModel(), Context.NONE) - .getValue(); + 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(); + this.innerObject = serviceManager.serviceClient().getInformationProtectionPolicies() + .createOrUpdateWithResponse(scope, informationProtectionPolicyName, this.innerModel(), context).getValue(); return this; } - InformationProtectionPolicyImpl( - InformationProtectionPolicyInner innerObject, + InformationProtectionPolicyImpl(InformationProtectionPolicyInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.scope = - Utils - .getValueFromIdByParameterName( - innerObject.id(), - "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}", - "scope"); - this.informationProtectionPolicyName = - InformationProtectionPolicyName - .fromString( - Utils - .getValueFromIdByParameterName( - innerObject.id(), - "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}", - "informationProtectionPolicyName")); + 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(); + 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(); + this.innerObject = serviceManager.serviceClient().getInformationProtectionPolicies() + .getWithResponse(scope, informationProtectionPolicyName, context).getValue(); return this; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingImpl.java deleted file mode 100644 index 0100de28a14d0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingImpl.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IngestionSettingInner; -import com.azure.resourcemanager.security.models.ConnectionStrings; -import com.azure.resourcemanager.security.models.IngestionSetting; -import com.azure.resourcemanager.security.models.IngestionSettingToken; - -public final class IngestionSettingImpl implements IngestionSetting, IngestionSetting.Definition { - private IngestionSettingInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IngestionSettingImpl( - IngestionSettingInner 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 IngestionSettingInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String ingestionSettingName; - - public IngestionSetting create() { - this.innerObject = - serviceManager - .serviceClient() - .getIngestionSettings() - .createWithResponse(ingestionSettingName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public IngestionSetting create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getIngestionSettings() - .createWithResponse(ingestionSettingName, this.innerModel(), context) - .getValue(); - return this; - } - - IngestionSettingImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new IngestionSettingInner(); - this.serviceManager = serviceManager; - this.ingestionSettingName = name; - } - - public IngestionSetting refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getIngestionSettings() - .getWithResponse(ingestionSettingName, Context.NONE) - .getValue(); - return this; - } - - public IngestionSetting refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getIngestionSettings() - .getWithResponse(ingestionSettingName, context) - .getValue(); - return this; - } - - public Response listTokensWithResponse(Context context) { - return serviceManager.ingestionSettings().listTokensWithResponse(ingestionSettingName, context); - } - - public IngestionSettingToken listTokens() { - return serviceManager.ingestionSettings().listTokens(ingestionSettingName); - } - - public Response listConnectionStringsWithResponse(Context context) { - return serviceManager.ingestionSettings().listConnectionStringsWithResponse(ingestionSettingName, context); - } - - public ConnectionStrings listConnectionStrings() { - return serviceManager.ingestionSettings().listConnectionStrings(ingestionSettingName); - } - - public IngestionSettingImpl withProperties(Object properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingTokenImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingTokenImpl.java deleted file mode 100644 index 260f3548df8fc..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingTokenImpl.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.IngestionSettingTokenInner; -import com.azure.resourcemanager.security.models.IngestionSettingToken; - -public final class IngestionSettingTokenImpl implements IngestionSettingToken { - private IngestionSettingTokenInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IngestionSettingTokenImpl( - IngestionSettingTokenInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String token() { - return this.innerModel().token(); - } - - public IngestionSettingTokenInner 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/IngestionSettingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingsClientImpl.java deleted file mode 100644 index 0ded97111c933..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingsClientImpl.java +++ /dev/null @@ -1,1030 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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.IngestionSettingsClient; -import com.azure.resourcemanager.security.fluent.models.ConnectionStringsInner; -import com.azure.resourcemanager.security.fluent.models.IngestionSettingInner; -import com.azure.resourcemanager.security.fluent.models.IngestionSettingTokenInner; -import com.azure.resourcemanager.security.models.IngestionSettingList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in IngestionSettingsClient. */ -public final class IngestionSettingsClientImpl implements IngestionSettingsClient { - /** The proxy service used to perform REST calls. */ - private final IngestionSettingsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of IngestionSettingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - IngestionSettingsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(IngestionSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterIngestionSettings to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterIngest") - public interface IngestionSettingsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ingestionSettingName") String ingestionSettingName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ingestionSettingName") String ingestionSettingName, - @BodyParam("application/json") IngestionSettingInner ingestionSetting, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ingestionSettingName") String ingestionSettingName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listTokens") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listTokens( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ingestionSettingName") String ingestionSettingName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listConnectionStrings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listConnectionStrings( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ingestionSettingName") String ingestionSettingName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Settings for ingesting security data and logs to correlate with resources 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 ingestion settings 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-01-15-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 for ingesting security data and logs to correlate with resources 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 ingestion settings 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-01-15-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 for ingesting security data and logs to correlate with resources 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 ingestion settings as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Settings for ingesting security data and logs to correlate with resources 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 ingestion settings 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 for ingesting security data and logs to correlate with resources 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 ingestion settings as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Settings for ingesting security data and logs to correlate with resources 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 ingestion settings as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion 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 how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String ingestionSettingName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion 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 how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String ingestionSettingName, 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 (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - accept, - context); - } - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion 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 how to correlate scan data and logs with resources associated with the subscription on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String ingestionSettingName) { - return getWithResponseAsync(ingestionSettingName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion 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 how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String ingestionSettingName, Context context) { - return getWithResponseAsync(ingestionSettingName, context).block(); - } - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion 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 how to correlate scan data and logs with resources associated with the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IngestionSettingInner get(String ingestionSettingName) { - return getWithResponse(ingestionSettingName, Context.NONE).getValue(); - } - - /** - * Create setting for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param ingestionSetting Ingestion 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 how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String ingestionSettingName, IngestionSettingInner ingestionSetting) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - if (ingestionSetting == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSetting is required and cannot be null.")); - } else { - ingestionSetting.validate(); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - ingestionSetting, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create setting for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param ingestionSetting Ingestion 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 how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String ingestionSettingName, IngestionSettingInner ingestionSetting, 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 (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - if (ingestionSetting == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSetting is required and cannot be null.")); - } else { - ingestionSetting.validate(); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - ingestionSetting, - accept, - context); - } - - /** - * Create setting for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param ingestionSetting Ingestion 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 how to correlate scan data and logs with resources associated with the subscription on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String ingestionSettingName, IngestionSettingInner ingestionSetting) { - return createWithResponseAsync(ingestionSettingName, ingestionSetting) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create setting for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param ingestionSetting Ingestion 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 how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String ingestionSettingName, IngestionSettingInner ingestionSetting, Context context) { - return createWithResponseAsync(ingestionSettingName, ingestionSetting, context).block(); - } - - /** - * Create setting for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param ingestionSetting Ingestion 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 how to correlate scan data and logs with resources associated with the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IngestionSettingInner create(String ingestionSettingName, IngestionSettingInner ingestionSetting) { - return createWithResponse(ingestionSettingName, ingestionSetting, Context.NONE).getValue(); - } - - /** - * Deletes the ingestion settings for this subscription. - * - * @param ingestionSettingName Name of the ingestion 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 ingestionSettingName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the ingestion settings for this subscription. - * - * @param ingestionSettingName Name of the ingestion 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 ingestionSettingName, 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 (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - accept, - context); - } - - /** - * Deletes the ingestion settings for this subscription. - * - * @param ingestionSettingName Name of the ingestion 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 ingestionSettingName) { - return deleteWithResponseAsync(ingestionSettingName).flatMap(ignored -> Mono.empty()); - } - - /** - * Deletes the ingestion settings for this subscription. - * - * @param ingestionSettingName Name of the ingestion 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 ingestionSettingName, Context context) { - return deleteWithResponseAsync(ingestionSettingName, context).block(); - } - - /** - * Deletes the ingestion settings for this subscription. - * - * @param ingestionSettingName Name of the ingestion 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 ingestionSettingName) { - deleteWithResponse(ingestionSettingName, Context.NONE); - } - - /** - * Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - * - * @param ingestionSettingName Name of the ingestion 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 how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTokensWithResponseAsync(String ingestionSettingName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listTokens( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - * - * @param ingestionSettingName Name of the ingestion 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 how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTokensWithResponseAsync( - String ingestionSettingName, 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 (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listTokens( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - accept, - context); - } - - /** - * Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - * - * @param ingestionSettingName Name of the ingestion 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 how to correlate scan data and logs with resources associated with the subscription on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listTokensAsync(String ingestionSettingName) { - return listTokensWithResponseAsync(ingestionSettingName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - * - * @param ingestionSettingName Name of the ingestion 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 how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listTokensWithResponse(String ingestionSettingName, Context context) { - return listTokensWithResponseAsync(ingestionSettingName, context).block(); - } - - /** - * Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - * - * @param ingestionSettingName Name of the ingestion 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 how to correlate scan data and logs with resources associated with the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IngestionSettingTokenInner listTokens(String ingestionSettingName) { - return listTokensWithResponse(ingestionSettingName, Context.NONE).getValue(); - } - - /** - * Connection strings for ingesting security scan logs and data. - * - * @param ingestionSettingName Name of the ingestion 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 connection string for ingesting security data and logs along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConnectionStringsWithResponseAsync(String ingestionSettingName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listConnectionStrings( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Connection strings for ingesting security scan logs and data. - * - * @param ingestionSettingName Name of the ingestion 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 connection string for ingesting security data and logs along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConnectionStringsWithResponseAsync( - String ingestionSettingName, 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 (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listConnectionStrings( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - accept, - context); - } - - /** - * Connection strings for ingesting security scan logs and data. - * - * @param ingestionSettingName Name of the ingestion 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 connection string for ingesting security data and logs on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listConnectionStringsAsync(String ingestionSettingName) { - return listConnectionStringsWithResponseAsync(ingestionSettingName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Connection strings for ingesting security scan logs and data. - * - * @param ingestionSettingName Name of the ingestion 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 connection string for ingesting security data and logs along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listConnectionStringsWithResponse( - String ingestionSettingName, Context context) { - return listConnectionStringsWithResponseAsync(ingestionSettingName, context).block(); - } - - /** - * Connection strings for ingesting security scan logs and data. - * - * @param ingestionSettingName Name of the ingestion 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 connection string for ingesting security data and logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectionStringsInner listConnectionStrings(String ingestionSettingName) { - return listConnectionStringsWithResponse(ingestionSettingName, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink 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 ingestion 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 - *

The nextLink 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 ingestion 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/IngestionSettingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingsImpl.java deleted file mode 100644 index da9c5111770eb..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingsImpl.java +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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.IngestionSettingsClient; -import com.azure.resourcemanager.security.fluent.models.ConnectionStringsInner; -import com.azure.resourcemanager.security.fluent.models.IngestionSettingInner; -import com.azure.resourcemanager.security.fluent.models.IngestionSettingTokenInner; -import com.azure.resourcemanager.security.models.ConnectionStrings; -import com.azure.resourcemanager.security.models.IngestionSetting; -import com.azure.resourcemanager.security.models.IngestionSettingToken; -import com.azure.resourcemanager.security.models.IngestionSettings; - -public final class IngestionSettingsImpl implements IngestionSettings { - private static final ClientLogger LOGGER = new ClientLogger(IngestionSettingsImpl.class); - - private final IngestionSettingsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public IngestionSettingsImpl( - IngestionSettingsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new IngestionSettingImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new IngestionSettingImpl(inner1, this.manager())); - } - - public Response getWithResponse(String ingestionSettingName, Context context) { - Response inner = this.serviceClient().getWithResponse(ingestionSettingName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IngestionSettingImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public IngestionSetting get(String ingestionSettingName) { - IngestionSettingInner inner = this.serviceClient().get(ingestionSettingName); - if (inner != null) { - return new IngestionSettingImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String ingestionSettingName, Context context) { - return this.serviceClient().deleteWithResponse(ingestionSettingName, context); - } - - public void delete(String ingestionSettingName) { - this.serviceClient().delete(ingestionSettingName); - } - - public Response listTokensWithResponse(String ingestionSettingName, Context context) { - Response inner = - this.serviceClient().listTokensWithResponse(ingestionSettingName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IngestionSettingTokenImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public IngestionSettingToken listTokens(String ingestionSettingName) { - IngestionSettingTokenInner inner = this.serviceClient().listTokens(ingestionSettingName); - if (inner != null) { - return new IngestionSettingTokenImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listConnectionStringsWithResponse(String ingestionSettingName, Context context) { - Response inner = - this.serviceClient().listConnectionStringsWithResponse(ingestionSettingName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ConnectionStringsImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ConnectionStrings listConnectionStrings(String ingestionSettingName) { - ConnectionStringsInner inner = this.serviceClient().listConnectionStrings(ingestionSettingName); - if (inner != null) { - return new ConnectionStringsImpl(inner, this.manager()); - } else { - return null; - } - } - - public IngestionSetting getById(String id) { - String ingestionSettingName = Utils.getValueFromIdByName(id, "ingestionSettings"); - if (ingestionSettingName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'ingestionSettings'.", id))); - } - return this.getWithResponse(ingestionSettingName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String ingestionSettingName = Utils.getValueFromIdByName(id, "ingestionSettings"); - if (ingestionSettingName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'ingestionSettings'.", id))); - } - return this.getWithResponse(ingestionSettingName, context); - } - - public void deleteById(String id) { - String ingestionSettingName = Utils.getValueFromIdByName(id, "ingestionSettings"); - if (ingestionSettingName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'ingestionSettings'.", id))); - } - this.deleteWithResponse(ingestionSettingName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String ingestionSettingName = Utils.getValueFromIdByName(id, "ingestionSettings"); - if (ingestionSettingName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'ingestionSettings'.", id))); - } - return this.deleteWithResponse(ingestionSettingName, context); - } - - private IngestionSettingsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public IngestionSettingImpl define(String name) { - return new IngestionSettingImpl(name, this.manager()); - } -} 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 index b6ba40c4985e0..261157ce0e67e 100644 --- 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 @@ -18,8 +18,7 @@ public final class IoTSecurityAggregatedAlertImpl implements IoTSecurityAggregat private final com.azure.resourcemanager.security.SecurityManager serviceManager; - IoTSecurityAggregatedAlertImpl( - IoTSecurityAggregatedAlertInner innerObject, + IoTSecurityAggregatedAlertImpl(IoTSecurityAggregatedAlertInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 index 8b33589368a06..9ca207df4dd14 100644 --- 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 @@ -15,8 +15,7 @@ public final class IoTSecurityAggregatedRecommendationImpl implements IoTSecurit private final com.azure.resourcemanager.security.SecurityManager serviceManager; - IoTSecurityAggregatedRecommendationImpl( - IoTSecurityAggregatedRecommendationInner innerObject, + IoTSecurityAggregatedRecommendationImpl(IoTSecurityAggregatedRecommendationInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 index 40b21a2f14043..0672331599ce9 100644 --- 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 @@ -19,8 +19,7 @@ public final class IoTSecuritySolutionAnalyticsModelImpl implements IoTSecurityS private final com.azure.resourcemanager.security.SecurityManager serviceManager; - IoTSecuritySolutionAnalyticsModelImpl( - IoTSecuritySolutionAnalyticsModelInner innerObject, + IoTSecuritySolutionAnalyticsModelImpl(IoTSecuritySolutionAnalyticsModelInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 index f8cf0fe29c555..5a154b64a23e4 100644 --- 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 @@ -17,8 +17,7 @@ public final class IoTSecuritySolutionAnalyticsModelListImpl implements IoTSecur private final com.azure.resourcemanager.security.SecurityManager serviceManager; - IoTSecuritySolutionAnalyticsModelListImpl( - IoTSecuritySolutionAnalyticsModelListInner innerObject, + IoTSecuritySolutionAnalyticsModelListImpl(IoTSecuritySolutionAnalyticsModelListInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -27,12 +26,9 @@ public final class IoTSecuritySolutionAnalyticsModelListImpl implements IoTSecur 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())); + return Collections.unmodifiableList( + inner.stream().map(inner1 -> new IoTSecuritySolutionAnalyticsModelImpl(inner1, this.manager())) + .collect(Collectors.toList())); } else { return Collections.emptyList(); } 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 index 849907cb0bb67..ff865c0027bc0 100644 --- 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 @@ -162,22 +162,14 @@ public IoTSecuritySolutionModelImpl withExistingResourceGroup(String resourceGro } public IoTSecuritySolutionModel create() { - this.innerObject = - serviceManager - .serviceClient() - .getIotSecuritySolutions() - .createOrUpdateWithResponse(resourceGroupName, solutionName, this.innerModel(), Context.NONE) - .getValue(); + 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(); + this.innerObject = serviceManager.serviceClient().getIotSecuritySolutions() + .createOrUpdateWithResponse(resourceGroupName, solutionName, this.innerModel(), context).getValue(); return this; } @@ -193,50 +185,36 @@ public IoTSecuritySolutionModelImpl update() { } public IoTSecuritySolutionModel apply() { - this.innerObject = - serviceManager - .serviceClient() - .getIotSecuritySolutions() - .updateWithResponse(resourceGroupName, solutionName, updateUpdateIotSecuritySolutionData, Context.NONE) - .getValue(); + 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(); + this.innerObject = serviceManager.serviceClient().getIotSecuritySolutions() + .updateWithResponse(resourceGroupName, solutionName, updateUpdateIotSecuritySolutionData, context) + .getValue(); return this; } - IoTSecuritySolutionModelImpl( - IoTSecuritySolutionModelInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + IoTSecuritySolutionModelImpl(IoTSecuritySolutionModelInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.solutionName = Utils.getValueFromIdByName(innerObject.id(), "iotSecuritySolutions"); + 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(); + 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(); + this.innerObject = serviceManager.serviceClient().getIotSecuritySolutions() + .getByResourceGroupWithResponse(resourceGroupName, solutionName, context).getValue(); return this; } @@ -300,8 +278,8 @@ public IoTSecuritySolutionModelImpl withUserDefinedResources(UserDefinedResource } } - public IoTSecuritySolutionModelImpl withRecommendationsConfiguration( - List recommendationsConfiguration) { + public IoTSecuritySolutionModelImpl + withRecommendationsConfiguration(List recommendationsConfiguration) { if (isInCreateMode()) { this.innerModel().withRecommendationsConfiguration(recommendationsConfiguration); return this; @@ -316,8 +294,8 @@ public IoTSecuritySolutionModelImpl withUnmaskedIpLoggingStatus(UnmaskedIpLoggin return this; } - public IoTSecuritySolutionModelImpl withAdditionalWorkspaces( - List additionalWorkspaces) { + public IoTSecuritySolutionModelImpl + withAdditionalWorkspaces(List additionalWorkspaces) { this.innerModel().withAdditionalWorkspaces(additionalWorkspaces); return this; } 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 index d047f7931d33d..d7feb1c6f78a1 100644 --- 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 @@ -26,24 +26,28 @@ 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. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final IotSecuritySolutionAnalyticsService service; - /** The service client containing this operation class. */ + /** + * 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.service = RestProxy.create(IotSecuritySolutionAnalyticsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -54,61 +58,47 @@ public final class IotSecuritySolutionAnalyticsClientImpl implements IotSecurity @Host("{$host}") @ServiceInterface(name = "SecurityCenterIotSec") public interface IotSecuritySolutionAnalyticsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") 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); + Mono> list(@HostParam("$host") 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/default") - @ExpectedResponses({200}) + @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("$host") 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); + Mono> get(@HostParam("$host") 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 in an array. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String resourceGroupName, String solutionName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -120,47 +110,34 @@ private Mono> listWithRespo 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)) + .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 within the user's subscription. The name is case - * insensitive. + * 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}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String resourceGroupName, String solutionName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -172,22 +149,15 @@ private Mono> listWithRespo 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); + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -201,9 +171,9 @@ private Mono listAsync(String resour /** * Use this method to get IoT security Analytics metrics in an array. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -212,16 +182,16 @@ private Mono listAsync(String resour * @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) { + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -235,30 +205,26 @@ public IoTSecuritySolutionAnalyticsModelListInner list(String resourceGroupName, /** * Use this method to get IoT Security Analytics metrics. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String solutionName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -270,47 +236,34 @@ private Mono> getWithResponseAs 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)) + .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 within the user's subscription. The name is case - * insensitive. + * 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String solutionName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -322,22 +275,15 @@ private Mono> getWithResponseAs 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); + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -351,9 +297,9 @@ private Mono getAsync(String resourceGro /** * Use this method to get IoT Security Analytics metrics. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -362,16 +308,16 @@ private Mono getAsync(String resourceGro * @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) { + 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 within the user's subscription. The name is case - * insensitive. + * 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. 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 index 23c075d86a6d1..269039c13994d 100644 --- 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 @@ -22,22 +22,18 @@ public final class IotSecuritySolutionAnalyticsImpl implements IotSecuritySoluti private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public IotSecuritySolutionAnalyticsImpl( - IotSecuritySolutionAnalyticsClient innerClient, + public IotSecuritySolutionAnalyticsImpl(IotSecuritySolutionAnalyticsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response listWithResponse( - String resourceGroupName, String solutionName, Context context) { - Response inner = - this.serviceClient().listWithResponse(resourceGroupName, solutionName, context); + public Response listWithResponse(String resourceGroupName, + String solutionName, Context context) { + Response inner + = this.serviceClient().listWithResponse(resourceGroupName, solutionName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new IoTSecuritySolutionAnalyticsModelListImpl(inner.getValue(), this.manager())); } else { return null; @@ -53,15 +49,12 @@ public IoTSecuritySolutionAnalyticsModelList list(String resourceGroupName, Stri } } - public Response getWithResponse( - String resourceGroupName, String solutionName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, solutionName, context); + public Response getWithResponse(String resourceGroupName, String solutionName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, solutionName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new IoTSecuritySolutionAnalyticsModelImpl(inner.getValue(), this.manager())); } else { return null; 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 index 9ec5cec7cd575..6fc478c09d4f1 100644 --- 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 @@ -37,24 +37,24 @@ */ public final class IotSecuritySolutionsAnalyticsAggregatedAlertsClientImpl implements IotSecuritySolutionsAnalyticsAggregatedAlertsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final IotSecuritySolutionsAnalyticsAggregatedAlertsService service; - /** The service client containing this operation class. */ + /** + * 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.service = RestProxy.create(IotSecuritySolutionsAnalyticsAggregatedAlertsService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -65,89 +65,67 @@ public final class IotSecuritySolutionsAnalyticsAggregatedAlertsClientImpl @Host("{$host}") @ServiceInterface(name = "SecurityCenterIotSec") public interface IotSecuritySolutionsAnalyticsAggregatedAlertsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts") - @ExpectedResponses({200}) + @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("$host") 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); + Mono> list(@HostParam("$host") 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( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName}") - @ExpectedResponses({200}) + @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("$host") 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, + Mono> get(@HostParam("$host") 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"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName}/dismiss") - @ExpectedResponses({200}) + @Headers({ "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("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> dismiss(@HostParam("$host") 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, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("solutionName") String solutionName, + @PathParam("aggregatedAlertName") String aggregatedAlertName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Use this method to get the aggregated alert list of yours IoT Security solution. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String solutionName, Integer top) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -159,35 +137,18 @@ private Mono> listSinglePageAsync 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)) + .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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -195,22 +156,18 @@ private Mono> listSinglePageAsync * @throws ManagementException thrown 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}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String solutionName, Integer top, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -223,31 +180,17 @@ private Mono> listSinglePageAsync 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)); + .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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -256,18 +199,17 @@ private Mono> listSinglePageAsync * @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), + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -277,16 +219,15 @@ private PagedFlux listAsync( @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String solutionName) { final Integer top = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, solutionName, 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -296,18 +237,17 @@ private PagedFlux listAsync(String resourceGrou * @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), + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -322,9 +262,9 @@ public PagedIterable list(String resourceGroupN /** * Use this method to get the aggregated alert list of yours IoT Security solution. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -334,39 +274,35 @@ public PagedIterable list(String resourceGroupN * @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) { + public PagedIterable list(String resourceGroupName, String solutionName, + Integer top, Context context) { return new PagedIterable<>(listAsync(resourceGroupName, solutionName, top, 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 within the user's subscription. The name is case - * insensitive. + * 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String solutionName, String aggregatedAlertName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -382,27 +318,17 @@ private Mono> getWithResponseAsync( 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)) + .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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -410,22 +336,18 @@ private Mono> getWithResponseAsync( * @throws 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String solutionName, String aggregatedAlertName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -441,24 +363,16 @@ private Mono> getWithResponseAsync( 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); + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -467,8 +381,8 @@ private Mono> getWithResponseAsync( * @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) { + private Mono getAsync(String resourceGroupName, String solutionName, + String aggregatedAlertName) { return getWithResponseAsync(resourceGroupName, solutionName, aggregatedAlertName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -476,9 +390,9 @@ private Mono getAsync( /** * 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -488,17 +402,17 @@ private Mono getAsync( * @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) { + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -507,16 +421,16 @@ public Response getWithResponse( * @return security Solution Aggregated Alert information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public IoTSecurityAggregatedAlertInner get( - String resourceGroupName, String solutionName, String aggregatedAlertName) { + public IoTSecurityAggregatedAlertInner get(String resourceGroupName, String solutionName, + String aggregatedAlertName) { return getWithResponse(resourceGroupName, solutionName, aggregatedAlertName, Context.NONE).getValue(); } /** * Use this method to dismiss an aggregated IoT Security Solution Alert. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -525,19 +439,15 @@ public IoTSecurityAggregatedAlertInner get( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> dismissWithResponseAsync( - String resourceGroupName, String solutionName, String aggregatedAlertName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -553,26 +463,16 @@ private Mono> dismissWithResponseAsync( final String apiVersion = "2019-08-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .dismiss( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - aggregatedAlertName, - accept, - context)) + .withContext(context -> service.dismiss(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 dismiss an aggregated IoT Security Solution Alert. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -582,19 +482,15 @@ private Mono> dismissWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -610,23 +506,15 @@ private Mono> dismissWithResponseAsync( final String apiVersion = "2019-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .dismiss( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - aggregatedAlertName, - accept, - context); + return service.dismiss(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, solutionName, aggregatedAlertName, accept, context); } /** * Use this method to dismiss an aggregated IoT Security Solution Alert. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -642,9 +530,9 @@ private Mono dismissAsync(String resourceGroupName, String solutionName, S /** * Use this method to dismiss an aggregated IoT Security Solution Alert. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -654,16 +542,16 @@ private Mono dismissAsync(String resourceGroupName, String solutionName, S * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response dismissWithResponse( - String resourceGroupName, String solutionName, String aggregatedAlertName, Context context) { + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -677,14 +565,15 @@ public void dismiss(String resourceGroupName, String solutionName, String aggreg /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 IoT Security solution aggregated alert data along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -692,62 +581,43 @@ private Mono> listNextSinglePageA 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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 IoT Security solution aggregated alert data along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { + 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.")); + 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)); + 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 index be131cbc54315..5875a3586a2d1 100644 --- 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 @@ -16,8 +16,8 @@ public final class IotSecuritySolutionsAnalyticsAggregatedAlertsImpl implements IotSecuritySolutionsAnalyticsAggregatedAlerts { - private static final ClientLogger LOGGER = - new ClientLogger(IotSecuritySolutionsAnalyticsAggregatedAlertsImpl.class); + private static final ClientLogger LOGGER + = new ClientLogger(IotSecuritySolutionsAnalyticsAggregatedAlertsImpl.class); private final IotSecuritySolutionsAnalyticsAggregatedAlertsClient innerClient; @@ -31,27 +31,26 @@ public IotSecuritySolutionsAnalyticsAggregatedAlertsImpl( } public PagedIterable list(String resourceGroupName, String solutionName) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, solutionName); - return Utils.mapPage(inner, inner1 -> new IoTSecurityAggregatedAlertImpl(inner1, this.manager())); + 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 Utils.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 getWithResponse( - String resourceGroupName, String solutionName, String aggregatedAlertName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, solutionName, aggregatedAlertName, context); + public Response getWithResponse(String resourceGroupName, String solutionName, + String aggregatedAlertName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, solutionName, aggregatedAlertName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new IoTSecurityAggregatedAlertImpl(inner.getValue(), this.manager())); } else { return null; @@ -59,8 +58,8 @@ public Response getWithResponse( } public IoTSecurityAggregatedAlert get(String resourceGroupName, String solutionName, String aggregatedAlertName) { - IoTSecurityAggregatedAlertInner inner = - this.serviceClient().get(resourceGroupName, solutionName, aggregatedAlertName); + IoTSecurityAggregatedAlertInner inner + = this.serviceClient().get(resourceGroupName, solutionName, aggregatedAlertName); if (inner != null) { return new IoTSecurityAggregatedAlertImpl(inner, this.manager()); } else { @@ -68,8 +67,8 @@ public IoTSecurityAggregatedAlert get(String resourceGroupName, String solutionN } } - public Response dismissWithResponse( - String resourceGroupName, String solutionName, String aggregatedAlertName, Context context) { + public Response dismissWithResponse(String resourceGroupName, String solutionName, String aggregatedAlertName, + Context context) { return this.serviceClient().dismissWithResponse(resourceGroupName, solutionName, aggregatedAlertName, context); } 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 index 606ce1248876c..198d7643de705 100644 --- 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 @@ -36,103 +36,86 @@ */ public final class IotSecuritySolutionsAnalyticsRecommendationsClientImpl implements IotSecuritySolutionsAnalyticsRecommendationsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final IotSecuritySolutionsAnalyticsRecommendationsService service; - /** The service client containing this operation class. */ + /** + * 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.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. + * The interface defining all the services for SecurityCenterIotSecuritySolutionsAnalyticsRecommendations to be + * used by the proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "SecurityCenterIotSec") public interface IotSecuritySolutionsAnalyticsRecommendationsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations/{aggregatedRecommendationName}") - @ExpectedResponses({200}) + @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("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("solutionName") String solutionName, + Mono> get(@HostParam("$host") 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); + @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}) + @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("$host") 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); + Mono> list(@HostParam("$host") 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"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") 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 within the user's subscription. The name is case - * insensitive. + * 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String solutionName, String aggregatedRecommendationName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -142,35 +125,23 @@ private Mono> getWithResponse 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.")); + 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)) + .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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -178,22 +149,18 @@ private Mono> getWithResponse * @throws 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String solutionName, String aggregatedRecommendationName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -203,32 +170,22 @@ private Mono> getWithResponse 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.")); + 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); + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -237,8 +194,8 @@ private Mono> getWithResponse * @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) { + private Mono getAsync(String resourceGroupName, String solutionName, + String aggregatedRecommendationName) { return getWithResponseAsync(resourceGroupName, solutionName, aggregatedRecommendationName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -246,9 +203,9 @@ private Mono getAsync( /** * 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -258,17 +215,17 @@ private Mono getAsync( * @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) { + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -277,38 +234,34 @@ public Response getWithResponse( * @return ioT Security solution recommendation information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public IoTSecurityAggregatedRecommendationInner get( - String resourceGroupName, String solutionName, String aggregatedRecommendationName) { + 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 within the user's subscription. The name is case - * insensitive. + * 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}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String solutionName, Integer top) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -320,35 +273,19 @@ private Mono> listSingle 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)) + .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)) + res -> new 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -356,22 +293,18 @@ private Mono> listSingle * @throws ManagementException thrown 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}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String solutionName, Integer top, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -384,31 +317,17 @@ private Mono> listSingle 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)); + .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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -417,18 +336,17 @@ private Mono> listSingle * @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), + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -436,19 +354,18 @@ private PagedFlux listAsync( * @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) { + private PagedFlux listAsync(String resourceGroupName, + String solutionName) { final Integer top = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, solutionName, 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -458,24 +375,23 @@ private PagedFlux listAsync( * @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), + 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 within the user's subscription. The name is case - * insensitive. + * 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}. + * @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) { @@ -485,34 +401,35 @@ public PagedIterable list(String resou /** * 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 within the user's subscription. The name is case - * insensitive. + * 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}. + * @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) { + 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 - *

The nextLink parameter. + * + * The nextLink 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 IoT Security solution aggregated recommendations along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -520,62 +437,44 @@ private Mono> listNextSi 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.")); + 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)) + 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)) + res -> new 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 - *

The nextLink parameter. + * + * The nextLink 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 IoT Security solution aggregated recommendations along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { + 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.")); + 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)); + 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 index 785dc37759abd..bff70b76b0ff7 100644 --- 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 @@ -29,27 +29,22 @@ public IotSecuritySolutionsAnalyticsRecommendationsImpl( this.serviceManager = serviceManager; } - public Response getWithResponse( - String resourceGroupName, String solutionName, String aggregatedRecommendationName, Context context) { - Response inner = - this - .serviceClient() - .getWithResponse(resourceGroupName, solutionName, aggregatedRecommendationName, context); + public Response getWithResponse(String resourceGroupName, String solutionName, + String aggregatedRecommendationName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, solutionName, aggregatedRecommendationName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new IoTSecurityAggregatedRecommendationImpl(inner.getValue(), this.manager())); } else { return null; } } - public IoTSecurityAggregatedRecommendation get( - String resourceGroupName, String solutionName, String aggregatedRecommendationName) { - IoTSecurityAggregatedRecommendationInner inner = - this.serviceClient().get(resourceGroupName, solutionName, aggregatedRecommendationName); + 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 { @@ -58,16 +53,18 @@ public IoTSecurityAggregatedRecommendation get( } public PagedIterable list(String resourceGroupName, String solutionName) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, solutionName); - return Utils.mapPage(inner, inner1 -> new IoTSecurityAggregatedRecommendationImpl(inner1, this.manager())); + 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 Utils.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() { 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 index c91df12da6ce3..21b11d9928785 100644 --- 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 @@ -35,141 +35,113 @@ 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. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final IotSecuritySolutionsService service; - /** The service client containing this operation class. */ + /** + * 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.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. + * The interface defining all the services for SecurityCenterIotSecuritySolutions to be used by the proxy service + * to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "SecurityCenterIotSec") public interface IotSecuritySolutionsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotSecuritySolutions") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") 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( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") 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); + Mono> listByResourceGroup(@HostParam("$host") 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") 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); + Mono> getByResourceGroup(@HostParam("$host") 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"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("solutionName") String solutionName, + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("solutionName") String solutionName, @BodyParam("application/json") IoTSecuritySolutionModelInner iotSecuritySolutionData, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("solutionName") String solutionName, + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("solutionName") String solutionName, @BodyParam("application/json") UpdateIotSecuritySolutionData updateIotSecuritySolutionData, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") 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); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("solutionName") String solutionName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context 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. @@ -179,45 +151,26 @@ Mono> listByResourceGroupNext( @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)) + .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. @@ -228,36 +181,25 @@ private Mono> listSinglePageAsync(S @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)); + .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. @@ -266,13 +208,13 @@ private Mono> listSinglePageAsync(S */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String filter) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + 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}. @@ -280,13 +222,13 @@ private PagedFlux listAsync(String filter) { @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { final String filter = null; - return new PagedFlux<>( - () -> listSinglePageAsync(filter), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + 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. @@ -296,14 +238,13 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, 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}. @@ -316,7 +257,7 @@ public 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. @@ -331,9 +272,9 @@ public PagedIterable list(String filter, Context /** * Use this method to get the list IoT Security solutions organized by resource group. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -341,19 +282,15 @@ public PagedIterable list(String filter, Context * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -362,34 +299,18 @@ private Mono> listByResourceGroupSi 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)) + .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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -398,19 +319,15 @@ private Mono> listByResourceGroupSi * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -420,30 +337,17 @@ private Mono> listByResourceGroupSi 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)); + .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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -452,16 +356,15 @@ private Mono> listByResourceGroupSi */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -470,16 +373,15 @@ private PagedFlux listByResourceGroupAsync(String @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { final String filter = null; - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -488,18 +390,17 @@ private PagedFlux listByResourceGroupAsync(String * @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), + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -513,9 +414,9 @@ public PagedIterable listByResourceGroup(String r /** * Use this method to get the list IoT Security solutions organized by resource group. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -524,37 +425,33 @@ public PagedIterable listByResourceGroup(String r * @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) { + public PagedIterable listByResourceGroup(String resourceGroupName, String filter, + Context context) { return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, 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 within the user's subscription. The name is case - * insensitive. + * 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}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String solutionName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -566,47 +463,34 @@ private Mono> getByResourceGroupWithResp 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)) + .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 within the user's subscription. The name is case - * insensitive. + * 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}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String solutionName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -618,22 +502,15 @@ private Mono> getByResourceGroupWithResp 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); + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -648,9 +525,9 @@ private Mono getByResourceGroupAsync(String resou /** * User this method to get details of a specific IoT Security solution based on solution name. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -659,16 +536,16 @@ private Mono getByResourceGroupAsync(String resou * @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) { + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -682,31 +559,27 @@ public IoTSecuritySolutionModelInner getByResourceGroup(String resourceGroupName /** * Use this method to create or update yours IoT Security solution. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String solutionName, IoTSecuritySolutionModelInner iotSecuritySolutionData) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -716,35 +589,23 @@ private Mono> createOrUpdateWithResponse 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.")); + return Mono.error( + new IllegalArgumentException("Parameter iotSecuritySolutionData is required and cannot be null.")); } else { iotSecuritySolutionData.validate(); } final String apiVersion = "2019-08-01"; final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - iotSecuritySolutionData, - accept, - context)) + return FluxUtil.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, solutionName, iotSecuritySolutionData, accept, 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -752,25 +613,18 @@ private Mono> createOrUpdateWithResponse * @throws 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}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String solutionName, - IoTSecuritySolutionModelInner iotSecuritySolutionData, - Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -780,32 +634,23 @@ private Mono> createOrUpdateWithResponse 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.")); + return Mono.error( + new IllegalArgumentException("Parameter iotSecuritySolutionData is required and cannot be null.")); } else { iotSecuritySolutionData.validate(); } final String apiVersion = "2019-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - iotSecuritySolutionData, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, solutionName, iotSecuritySolutionData, accept, context); } /** * Use this method to create or update yours IoT Security solution. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param solutionName The name of the IoT Security solution. * @param iotSecuritySolutionData The security solution data. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -814,17 +659,17 @@ private Mono> createOrUpdateWithResponse * @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) { + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -834,20 +679,17 @@ private Mono createOrUpdateAsync( * @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) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param solutionName The name of the IoT Security solution. * @param iotSecuritySolutionData The security solution data. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -856,8 +698,8 @@ public Response createOrUpdateWithResponse( * @return ioT Security solution configuration and resource information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public IoTSecuritySolutionModelInner createOrUpdate( - String resourceGroupName, String solutionName, IoTSecuritySolutionModelInner iotSecuritySolutionData) { + public IoTSecuritySolutionModelInner createOrUpdate(String resourceGroupName, String solutionName, + IoTSecuritySolutionModelInner iotSecuritySolutionData) { return createOrUpdateWithResponse(resourceGroupName, solutionName, iotSecuritySolutionData, Context.NONE) .getValue(); } @@ -865,31 +707,27 @@ public IoTSecuritySolutionModelInner createOrUpdate( /** * 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 within the user's subscription. The name is case - * insensitive. + * 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}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String solutionName, UpdateIotSecuritySolutionData updateIotSecuritySolutionData) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -899,10 +737,8 @@ private Mono> updateWithResponseAsync( 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter updateIotSecuritySolutionData is required and cannot be null.")); } else { updateIotSecuritySolutionData.validate(); } @@ -910,26 +746,17 @@ private Mono> updateWithResponseAsync( final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - updateIotSecuritySolutionData, - accept, - context)) + context -> service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, solutionName, updateIotSecuritySolutionData, accept, 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -937,25 +764,18 @@ private Mono> updateWithResponseAsync( * @throws 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}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, - String solutionName, - UpdateIotSecuritySolutionData updateIotSecuritySolutionData, - Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -965,34 +785,24 @@ private Mono> updateWithResponseAsync( 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter updateIotSecuritySolutionData is required and cannot be null.")); } else { updateIotSecuritySolutionData.validate(); } final String apiVersion = "2019-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - updateIotSecuritySolutionData, - accept, - context); + return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + solutionName, updateIotSecuritySolutionData, accept, 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param solutionName The name of the IoT Security solution. * @param updateIotSecuritySolutionData The security solution data. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1001,8 +811,8 @@ private Mono> updateWithResponseAsync( * @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) { + private Mono updateAsync(String resourceGroupName, String solutionName, + UpdateIotSecuritySolutionData updateIotSecuritySolutionData) { return updateWithResponseAsync(resourceGroupName, solutionName, updateIotSecuritySolutionData) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -1010,9 +820,9 @@ private Mono updateAsync( /** * 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -1022,20 +832,17 @@ private Mono updateAsync( * @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) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param solutionName The name of the IoT Security solution. * @param updateIotSecuritySolutionData The security solution data. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1044,17 +851,17 @@ public Response updateWithResponse( * @return ioT Security solution configuration and resource information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public IoTSecuritySolutionModelInner update( - String resourceGroupName, String solutionName, UpdateIotSecuritySolutionData updateIotSecuritySolutionData) { + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -1064,16 +871,12 @@ public IoTSecuritySolutionModelInner update( @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1085,25 +888,16 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S final String apiVersion = "2019-08-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - accept, - context)) + .withContext(context -> service.delete(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 delete yours IoT Security solution. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -1112,19 +906,15 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String solutionName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1136,22 +926,15 @@ private Mono> deleteWithResponseAsync( final String apiVersion = "2019-08-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - accept, - context); + return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + solutionName, accept, context); } /** * Use this method to delete yours IoT Security solution. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -1165,9 +948,9 @@ private Mono deleteAsync(String resourceGroupName, String solutionName) { /** * Use this method to delete yours IoT Security solution. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -1182,9 +965,9 @@ public Response deleteWithResponse(String resourceGroupName, String soluti /** * Use this method to delete yours IoT Security solution. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -1197,9 +980,10 @@ public void delete(String resourceGroupName, String solutionName) { /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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. @@ -1211,32 +995,24 @@ private Mono> listBySubscriptionNex 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.")); + 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)) + .>map(res -> new 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -1244,37 +1020,28 @@ private Mono> listBySubscriptionNex * @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) { + 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.")); + 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)); + 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -1286,32 +1053,24 @@ private Mono> listByResourceGroupNe 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.")); + 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)) + .>map(res -> new 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -1319,29 +1078,19 @@ private Mono> listByResourceGroupNe * @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) { + 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.")); + 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)); + 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/IotSecuritySolutionsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsImpl.java index 157e75226a149..d1c50ef8066f5 100644 --- 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 @@ -21,44 +21,41 @@ public final class IotSecuritySolutionsImpl implements IotSecuritySolutions { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public IotSecuritySolutionsImpl( - IotSecuritySolutionsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + public IotSecuritySolutionsImpl(IotSecuritySolutionsClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new IoTSecuritySolutionModelImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new IoTSecuritySolutionModelImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IoTSecuritySolutionModelImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new IoTSecuritySolutionModelImpl(inner1, this.manager())); + 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 Utils.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 Response getByResourceGroupWithResponse( - String resourceGroupName, String solutionName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, solutionName, context); + public Response getByResourceGroupWithResponse(String resourceGroupName, + String solutionName, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, solutionName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new IoTSecuritySolutionModelImpl(inner.getValue(), this.manager())); } else { return null; @@ -74,8 +71,8 @@ public IoTSecuritySolutionModel getByResourceGroup(String resourceGroupName, Str } } - public Response deleteByResourceGroupWithResponse( - String resourceGroupName, String solutionName, Context context) { + public Response deleteByResourceGroupWithResponse(String resourceGroupName, String solutionName, + Context context) { return this.serviceClient().deleteWithResponse(resourceGroupName, solutionName, context); } @@ -84,89 +81,57 @@ public void deleteByResourceGroup(String resourceGroupName, String solutionName) } public IoTSecuritySolutionModel getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String solutionName = Utils.getValueFromIdByName(id, "iotSecuritySolutions"); + 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))); + 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 = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String solutionName = Utils.getValueFromIdByName(id, "iotSecuritySolutions"); + 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))); + 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 = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String solutionName = Utils.getValueFromIdByName(id, "iotSecuritySolutions"); + 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))); + 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 = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String solutionName = Utils.getValueFromIdByName(id, "iotSecuritySolutions"); + 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))); + 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); } 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 index 1a990d30535c8..9d5befbcde10a 100644 --- 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 @@ -36,23 +36,28 @@ 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. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final JitNetworkAccessPoliciesService service; - /** The service client containing this operation class. */ + /** + * 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.service = RestProxy.create(JitNetworkAccessPoliciesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -63,164 +68,121 @@ public final class JitNetworkAccessPoliciesClientImpl implements JitNetworkAcces @Host("{$host}") @ServiceInterface(name = "SecurityCenterJitNet") public interface JitNetworkAccessPoliciesService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/jitNetworkAccessPolicies") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByRegion( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByRegion(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("ascLocation") String ascLocation, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/jitNetworkAccessPolicies") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/jitNetworkAccessPolicies") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, + Mono> listByResourceGroup(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupAndRegion( - @HostParam("$host") String endpoint, + Mono> listByResourceGroupAndRegion(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ascLocation") String ascLocation, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}") - @ExpectedResponses({200}) + @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("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ascLocation") String ascLocation, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, @PathParam("jitNetworkAccessPolicyName") String jitNetworkAccessPolicyName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, + Mono> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ascLocation") String ascLocation, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, @PathParam("jitNetworkAccessPolicyName") String jitNetworkAccessPolicyName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") JitNetworkAccessPolicyInner body, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") JitNetworkAccessPolicyInner body, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}") - @ExpectedResponses({200, 204}) + @Headers({ "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("$host") String endpoint, + Mono> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ascLocation") String ascLocation, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, @PathParam("jitNetworkAccessPolicyName") String jitNetworkAccessPolicyName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}/{jitNetworkAccessPolicyInitiateType}") - @ExpectedResponses({202}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}/{jitNetworkAccessPolicyInitiateType}") + @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> initiate( - @HostParam("$host") String endpoint, + Mono> initiate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ascLocation") String ascLocation, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, @PathParam("jitNetworkAccessPolicyName") String jitNetworkAccessPolicyName, @PathParam("jitNetworkAccessPolicyInitiateType") String jitNetworkAccessPolicyInitiateType, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") JitNetworkAccessPolicyInitiateRequest body, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByRegionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupAndRegionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context 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 response body along with {@link PagedResponse} on successful completion of {@link Mono}. @@ -228,39 +190,26 @@ Mono> listByResourceGroupAndRegionNext( @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), 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())); } /** * 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. @@ -270,36 +219,24 @@ private Mono> listSinglePageAsync() { @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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(), this.client.getSubscriptionId(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, 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}. @@ -311,7 +248,7 @@ private PagedFlux 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. @@ -320,13 +257,13 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, 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}. @@ -338,7 +275,7 @@ public 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 ManagementException thrown if the request is rejected by server. @@ -352,9 +289,9 @@ public PagedIterable list(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. + * 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. @@ -363,16 +300,12 @@ public PagedIterable list(Context context) { @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -380,33 +313,18 @@ private Mono> listByRegionSinglePageA final String apiVersion = "2020-01-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByRegion( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - ascLocation, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByRegion(this.client.getEndpoint(), this.client.getSubscriptionId(), + ascLocation, 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())); } /** * 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. + * 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. @@ -414,19 +332,15 @@ private Mono> listByRegionSinglePageA * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -435,24 +349,17 @@ private Mono> listByRegionSinglePageA final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByRegion( - this.client.getEndpoint(), this.client.getSubscriptionId(), ascLocation, apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByRegion(this.client.getEndpoint(), this.client.getSubscriptionId(), ascLocation, apiVersion, 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. + * 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. @@ -460,15 +367,15 @@ private Mono> listByRegionSinglePageA */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByRegionAsync(String ascLocation) { - return new PagedFlux<>( - () -> listByRegionSinglePageAsync(ascLocation), nextLink -> listByRegionNextSinglePageAsync(nextLink)); + 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. + * 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. @@ -477,16 +384,15 @@ private PagedFlux listByRegionAsync(String ascLocat */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByRegionAsync(String ascLocation, Context context) { - return new PagedFlux<>( - () -> listByRegionSinglePageAsync(ascLocation, 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. + * 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. @@ -499,9 +405,9 @@ public PagedIterable listByRegion(String ascLocatio /** * 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. + * 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. @@ -515,28 +421,24 @@ public PagedIterable listByRegion(String ascLocatio /** * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -545,33 +447,18 @@ private Mono> listByResourceGroupSing final String apiVersion = "2020-01-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, 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())); } /** * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -579,19 +466,15 @@ private Mono> listByResourceGroupSing * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -601,29 +484,17 @@ private Mono> listByResourceGroupSing final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + apiVersion, 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -631,16 +502,15 @@ private Mono> listByResourceGroupSing */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -649,16 +519,15 @@ private PagedFlux listByResourceGroupAsync(String r */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -671,9 +540,9 @@ public PagedIterable listByResourceGroup(String res /** * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -687,30 +556,26 @@ public PagedIterable listByResourceGroup(String res /** * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -722,36 +587,20 @@ private Mono> listByResourceGroupAndR final String apiVersion = "2020-01-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByResourceGroupAndRegion( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByResourceGroupAndRegion(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, ascLocation, 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())); } /** * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -759,19 +608,15 @@ private Mono> listByResourceGroupAndR * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -784,52 +629,38 @@ private Mono> listByResourceGroupAndR final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroupAndRegion( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByResourceGroupAndRegion(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + ascLocation, apiVersion, 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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), + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -837,8 +668,8 @@ private PagedFlux listByResourceGroupAndRegionAsync * @return the paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAndRegionAsync( - String resourceGroupName, String ascLocation, Context context) { + private PagedFlux listByResourceGroupAndRegionAsync(String resourceGroupName, + String ascLocation, Context context) { return new PagedFlux<>( () -> listByResourceGroupAndRegionSinglePageAsync(resourceGroupName, ascLocation, context), nextLink -> listByResourceGroupAndRegionNextSinglePageAsync(nextLink, context)); @@ -846,29 +677,29 @@ private PagedFlux listByResourceGroupAndRegionAsync /** * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -876,18 +707,18 @@ public PagedIterable listByResourceGroupAndRegion( * @return the paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroupAndRegion( - String resourceGroupName, String ascLocation, Context context) { + 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 resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -895,19 +726,15 @@ public PagedIterable listByResourceGroupAndRegion( * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -917,36 +744,24 @@ private Mono> getWithResponseAsync( 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.")); + 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(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - jitNetworkAccessPolicyName, - apiVersion, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, ascLocation, jitNetworkAccessPolicyName, apiVersion, 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -955,19 +770,15 @@ private Mono> getWithResponseAsync( * @return the response body 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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -977,33 +788,23 @@ private Mono> getWithResponseAsync( 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.")); + 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(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - jitNetworkAccessPolicyName, - apiVersion, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, ascLocation, + jitNetworkAccessPolicyName, apiVersion, accept, context); } /** * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1011,19 +812,19 @@ private Mono> getWithResponseAsync( * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1032,18 +833,18 @@ private Mono getAsync( * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName, Context context) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1051,18 +852,18 @@ public Response getWithResponse( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public JitNetworkAccessPolicyInner get( - String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1071,22 +872,15 @@ public JitNetworkAccessPolicyInner get( * @return the response body 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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1096,10 +890,8 @@ private Mono> createOrUpdateWithResponseAs 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.")); + 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.")); @@ -1109,29 +901,18 @@ private Mono> createOrUpdateWithResponseAs final String apiVersion = "2020-01-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - jitNetworkAccessPolicyName, - apiVersion, - body, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, ascLocation, jitNetworkAccessPolicyName, apiVersion, body, accept, 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1141,23 +922,15 @@ private Mono> createOrUpdateWithResponseAs * @return the response body 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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1167,10 +940,8 @@ private Mono> createOrUpdateWithResponseAs 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.")); + 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.")); @@ -1180,26 +951,17 @@ private Mono> createOrUpdateWithResponseAs final String apiVersion = "2020-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - jitNetworkAccessPolicyName, - apiVersion, - body, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + ascLocation, jitNetworkAccessPolicyName, apiVersion, body, accept, context); } /** * Create a policy for protecting resources using Just-in-Time access control. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1208,22 +970,19 @@ private Mono> createOrUpdateWithResponseAs * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String ascLocation, - String jitNetworkAccessPolicyName, - JitNetworkAccessPolicyInner body) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1233,24 +992,19 @@ private Mono createOrUpdateAsync( * @return the response body 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(); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1259,23 +1013,19 @@ public Response createOrUpdateWithResponse( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public JitNetworkAccessPolicyInner createOrUpdate( - String resourceGroupName, - String ascLocation, - String jitNetworkAccessPolicyName, - JitNetworkAccessPolicyInner body) { - return createOrUpdateWithResponse( - resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body, Context.NONE) - .getValue(); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1283,19 +1033,15 @@ public JitNetworkAccessPolicyInner createOrUpdate( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1305,36 +1051,24 @@ private Mono> deleteWithResponseAsync( 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.")); + 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 - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - jitNetworkAccessPolicyName, - apiVersion, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, ascLocation, jitNetworkAccessPolicyName, apiVersion, accept, 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1343,19 +1077,15 @@ private Mono> deleteWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1365,33 +1095,23 @@ private Mono> deleteWithResponseAsync( 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.")); + 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 - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - jitNetworkAccessPolicyName, - apiVersion, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + ascLocation, jitNetworkAccessPolicyName, apiVersion, accept, context); } /** * Delete a Just-in-Time access control policy. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1406,11 +1126,11 @@ private Mono deleteAsync(String resourceGroupName, String ascLocation, Str /** * Delete a Just-in-Time access control policy. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1419,18 +1139,18 @@ private Mono deleteAsync(String resourceGroupName, String ascLocation, Str * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName, Context context) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1443,11 +1163,11 @@ public void delete(String resourceGroupName, String ascLocation, String jitNetwo /** * Initiate a JIT access from a specific Just-in-Time policy configuration. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1456,22 +1176,15 @@ public void delete(String resourceGroupName, String ascLocation, String jitNetwo * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1481,10 +1194,8 @@ private Mono> initiateWithResponseAsync( 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.")); + 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.")); @@ -1495,30 +1206,19 @@ private Mono> initiateWithResponseAsync( final String apiVersion = "2020-01-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .initiate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - jitNetworkAccessPolicyName, - jitNetworkAccessPolicyInitiateType, - apiVersion, - body, - accept, - context)) + .withContext(context -> service.initiate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, ascLocation, jitNetworkAccessPolicyName, jitNetworkAccessPolicyInitiateType, + apiVersion, body, accept, 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1528,23 +1228,16 @@ private Mono> initiateWithResponseAsync( * @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, + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1554,10 +1247,8 @@ private Mono> initiateWithResponseAsync( 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.")); + 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.")); @@ -1568,27 +1259,18 @@ private Mono> initiateWithResponseAsync( final String apiVersion = "2020-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .initiate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - jitNetworkAccessPolicyName, - jitNetworkAccessPolicyInitiateType, - apiVersion, - body, - accept, - context); + return service.initiate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + ascLocation, jitNetworkAccessPolicyName, jitNetworkAccessPolicyInitiateType, apiVersion, body, accept, + context); } /** * Initiate a JIT access from a specific Just-in-Time policy configuration. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1597,22 +1279,19 @@ private Mono> initiateWithResponseAsync( * @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) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1622,23 +1301,19 @@ private Mono initiateAsync( * @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) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1647,20 +1322,18 @@ public Response initiateWithResponse( * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public JitNetworkAccessRequestInner initiate( - String resourceGroupName, - String ascLocation, - String jitNetworkAccessPolicyName, - JitNetworkAccessPolicyInitiateRequest body) { + public JitNetworkAccessRequestInner initiate(String resourceGroupName, String ascLocation, + String jitNetworkAccessPolicyName, JitNetworkAccessPolicyInitiateRequest body) { return initiateWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body, Context.NONE) .getValue(); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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. @@ -1672,31 +1345,22 @@ private Mono> listNextSinglePageAsync 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -1709,31 +1373,22 @@ private Mono> listNextSinglePageAsync 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.")); + 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)); + 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -1745,31 +1400,23 @@ private Mono> listByRegionNextSingleP 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.")); + 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)) + .>map(res -> new 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -1777,37 +1424,28 @@ private Mono> listByRegionNextSingleP * @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) { + 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.")); + 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)); + 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -1819,32 +1457,24 @@ private Mono> listByResourceGroupNext 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.")); + 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)) + .>map(res -> new 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -1852,76 +1482,57 @@ private Mono> listByResourceGroupNext * @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) { + 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.")); + 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)); + 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 - *

The nextLink parameter. + * + * The nextLink 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 PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupAndRegionNextSinglePageAsync( - String nextLink) { + 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -1929,29 +1540,19 @@ private Mono> listByResourceGroupAndR * @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) { + 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.")); + 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)); + 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)); } } 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 index b9d9dcc313b61..b240153a75b77 100644 --- 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 @@ -24,66 +24,63 @@ public final class JitNetworkAccessPoliciesImpl implements JitNetworkAccessPolic private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public JitNetworkAccessPoliciesImpl( - JitNetworkAccessPoliciesClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + public JitNetworkAccessPoliciesImpl(JitNetworkAccessPoliciesClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new JitNetworkAccessPolicyImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new JitNetworkAccessPolicyImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new JitNetworkAccessPolicyImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new JitNetworkAccessPolicyImpl(inner1, this.manager())); } public PagedIterable listByRegion(String ascLocation) { PagedIterable inner = this.serviceClient().listByRegion(ascLocation); - return Utils.mapPage(inner, inner1 -> new JitNetworkAccessPolicyImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new JitNetworkAccessPolicyImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new JitNetworkAccessPolicyImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new JitNetworkAccessPolicyImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new JitNetworkAccessPolicyImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new JitNetworkAccessPolicyImpl(inner1, this.manager())); } - public PagedIterable listByResourceGroupAndRegion( - String resourceGroupName, String ascLocation) { - PagedIterable inner = - this.serviceClient().listByResourceGroupAndRegion(resourceGroupName, ascLocation); - return Utils.mapPage(inner, inner1 -> new JitNetworkAccessPolicyImpl(inner1, this.manager())); + 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 Utils.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 Response getWithResponse( - String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, context); + public Response getWithResponse(String resourceGroupName, String ascLocation, + String jitNetworkAccessPolicyName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new JitNetworkAccessPolicyImpl(inner.getValue(), this.manager())); } else { return null; @@ -91,8 +88,8 @@ public Response getWithResponse( } public JitNetworkAccessPolicy get(String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName) { - JitNetworkAccessPolicyInner inner = - this.serviceClient().get(resourceGroupName, ascLocation, jitNetworkAccessPolicyName); + JitNetworkAccessPolicyInner inner + = this.serviceClient().get(resourceGroupName, ascLocation, jitNetworkAccessPolicyName); if (inner != null) { return new JitNetworkAccessPolicyImpl(inner, this.manager()); } else { @@ -100,45 +97,32 @@ public JitNetworkAccessPolicy get(String resourceGroupName, String ascLocation, } } - public Response deleteWithResponse( - String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName, Context context) { - return this - .serviceClient() - .deleteWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, context); + 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 Response initiateWithResponse( - String resourceGroupName, - String ascLocation, - String jitNetworkAccessPolicyName, - JitNetworkAccessPolicyInitiateRequest body, - Context context) { - Response inner = - this - .serviceClient() - .initiateWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body, context); + public Response initiateWithResponse(String resourceGroupName, String ascLocation, + String jitNetworkAccessPolicyName, JitNetworkAccessPolicyInitiateRequest body, Context context) { + Response inner = this.serviceClient().initiateWithResponse(resourceGroupName, + ascLocation, jitNetworkAccessPolicyName, body, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new JitNetworkAccessRequestImpl(inner.getValue(), this.manager())); } else { return null; } } - public JitNetworkAccessRequest initiate( - String resourceGroupName, - String ascLocation, - String jitNetworkAccessPolicyName, - JitNetworkAccessPolicyInitiateRequest body) { - JitNetworkAccessRequestInner inner = - this.serviceClient().initiate(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body); + 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 { @@ -147,119 +131,78 @@ public JitNetworkAccessRequest initiate( } public JitNetworkAccessPolicy getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String ascLocation = Utils.getValueFromIdByName(id, "locations"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); } - String jitNetworkAccessPolicyName = Utils.getValueFromIdByName(id, "jitNetworkAccessPolicies"); + 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))); + 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) + return this.getWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, Context.NONE) .getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String ascLocation = Utils.getValueFromIdByName(id, "locations"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); } - String jitNetworkAccessPolicyName = Utils.getValueFromIdByName(id, "jitNetworkAccessPolicies"); + 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))); + 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 = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String ascLocation = Utils.getValueFromIdByName(id, "locations"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); } - String jitNetworkAccessPolicyName = Utils.getValueFromIdByName(id, "jitNetworkAccessPolicies"); + 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))); + 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 = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String ascLocation = Utils.getValueFromIdByName(id, "locations"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); } - String jitNetworkAccessPolicyName = Utils.getValueFromIdByName(id, "jitNetworkAccessPolicies"); + 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))); + 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); } 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 index 570ed838040bf..58955cb395329 100644 --- 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 @@ -53,12 +53,8 @@ public List virtualMachines() { 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())); + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new JitNetworkAccessRequestImpl(inner1, this.manager())).collect(Collectors.toList())); } else { return Collections.emptyList(); } @@ -101,24 +97,16 @@ public JitNetworkAccessPolicyImpl withExistingLocation(String resourceGroupName, } public JitNetworkAccessPolicy create() { - this.innerObject = - serviceManager - .serviceClient() - .getJitNetworkAccessPolicies() - .createOrUpdateWithResponse( - resourceGroupName, ascLocation, jitNetworkAccessPolicyName, this.innerModel(), Context.NONE) - .getValue(); + 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(); + this.innerObject + = serviceManager.serviceClient().getJitNetworkAccessPolicies().createOrUpdateWithResponse(resourceGroupName, + ascLocation, jitNetworkAccessPolicyName, this.innerModel(), context).getValue(); return this; } @@ -133,53 +121,38 @@ public JitNetworkAccessPolicyImpl update() { } public JitNetworkAccessPolicy apply() { - this.innerObject = - serviceManager - .serviceClient() - .getJitNetworkAccessPolicies() - .createOrUpdateWithResponse( - resourceGroupName, ascLocation, jitNetworkAccessPolicyName, this.innerModel(), Context.NONE) - .getValue(); + 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(); + this.innerObject + = serviceManager.serviceClient().getJitNetworkAccessPolicies().createOrUpdateWithResponse(resourceGroupName, + ascLocation, jitNetworkAccessPolicyName, this.innerModel(), context).getValue(); return this; } - JitNetworkAccessPolicyImpl( - JitNetworkAccessPolicyInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + JitNetworkAccessPolicyImpl(JitNetworkAccessPolicyInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.ascLocation = Utils.getValueFromIdByName(innerObject.id(), "locations"); - this.jitNetworkAccessPolicyName = Utils.getValueFromIdByName(innerObject.id(), "jitNetworkAccessPolicies"); + 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(); + 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(); + this.innerObject = serviceManager.serviceClient().getJitNetworkAccessPolicies() + .getWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, context).getValue(); 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 index 0cf244c2e8b95..be0e133fab445 100644 --- 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 @@ -16,8 +16,8 @@ public final class JitNetworkAccessRequestImpl implements JitNetworkAccessReques private final com.azure.resourcemanager.security.SecurityManager serviceManager; - JitNetworkAccessRequestImpl( - JitNetworkAccessRequestInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + JitNetworkAccessRequestImpl(JitNetworkAccessRequestInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 index 7cb672fbf87c5..c342d7b9fcf58 100644 --- 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 @@ -30,22 +30,28 @@ import com.azure.resourcemanager.security.models.AscLocationList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in LocationsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final LocationsService service; - /** The service client containing this operation class. */ + /** + * 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.service + = RestProxy.create(LocationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -56,80 +62,57 @@ public final class LocationsClientImpl implements LocationsClient { @Host("{$host}") @ServiceInterface(name = "SecurityCenterLocati") public interface LocationsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @HeaderParam("Accept") String accept, - Context context); + Mono> get(@HostParam("$host") 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"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context 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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)) + .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())); } @@ -137,49 +120,37 @@ private Mono> listSinglePageAsync() { * 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}. + * {@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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)); + 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}. @@ -193,7 +164,7 @@ private PagedFlux 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. @@ -202,15 +173,15 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, 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}. @@ -224,7 +195,7 @@ public 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 ManagementException thrown if the request is rejected by server. @@ -238,28 +209,24 @@ public PagedIterable list(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. + * 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}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -267,44 +234,32 @@ private Mono> getWithResponseAsync(String ascLocation 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)) + .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. + * 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}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -312,15 +267,15 @@ private Mono> getWithResponseAsync(String ascLocation 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); + 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. + * 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. @@ -333,9 +288,9 @@ private Mono getAsync(String ascLocation) { /** * Details of a specific location. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -349,9 +304,9 @@ public Response getWithResponse(String ascLocation, Context co /** * Details of a specific location. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -364,14 +319,15 @@ public AscLocationInner get(String ascLocation) { /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 locations where ASC saves your data along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -379,37 +335,28 @@ private Mono> listNextSinglePageAsync(String nex 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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 locations where ASC saves your data along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -417,23 +364,13 @@ private Mono> listNextSinglePageAsync(String nex 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.")); + 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)); + 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 index d946db5d2e1ae..cc476cfd3e1fe 100644 --- 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 @@ -21,29 +21,26 @@ public final class LocationsImpl implements Locations { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public LocationsImpl( - LocationsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + public LocationsImpl(LocationsClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new AscLocationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AscLocationImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new AscLocationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AscLocationImpl(inner1, this.manager())); } public Response getWithResponse(String ascLocation, Context context) { Response inner = this.serviceClient().getWithResponse(ascLocation, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new AscLocationImpl(inner.getValue(), this.manager())); } else { return null; 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 index fdf2e0b92f461..bc505796e77cb 100644 --- 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 @@ -12,8 +12,8 @@ public final class MdeOnboardingDataImpl implements MdeOnboardingData { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - MdeOnboardingDataImpl( - MdeOnboardingDataInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + MdeOnboardingDataImpl(MdeOnboardingDataInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 index a6a826ba37146..10b6744e2215a 100644 --- 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 @@ -17,8 +17,8 @@ public final class MdeOnboardingDataListImpl implements MdeOnboardingDataList { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - MdeOnboardingDataListImpl( - MdeOnboardingDataListInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + MdeOnboardingDataListImpl(MdeOnboardingDataListInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -26,12 +26,8 @@ public final class MdeOnboardingDataListImpl implements MdeOnboardingDataList { 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())); + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new MdeOnboardingDataImpl(inner1, this.manager())).collect(Collectors.toList())); } else { return Collections.emptyList(); } 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 index 1425b43ebbf47..d0367a847d38e 100644 --- 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 @@ -26,22 +26,28 @@ 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. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final MdeOnboardingsService service; - /** The service client containing this operation class. */ + /** + * 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.service + = RestProxy.create(MdeOnboardingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -52,84 +58,68 @@ public final class MdeOnboardingsClientImpl implements MdeOnboardingsClient { @Host("{$host}") @ServiceInterface(name = "SecurityCenterMdeOnb") public interface MdeOnboardingsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings/default") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context 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 along with {@link Response} on successful completion of {@link - * Mono}. + * @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)) + .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}. + * @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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"; @@ -139,7 +129,7 @@ private Mono> listWithResponseAsync(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}. @@ -151,7 +141,7 @@ private Mono listAsync() { /** * 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. @@ -165,7 +155,7 @@ public Response listWithResponse(Context 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. @@ -177,59 +167,49 @@ public MdeOnboardingDataListInner list() { /** * 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}. + * @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)) + .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}. + * @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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"; @@ -239,11 +219,11 @@ private Mono> getWithResponseAsync(Context cont /** * 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}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync() { @@ -252,13 +232,13 @@ private Mono getAsync() { /** * 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}. + * @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) { @@ -267,7 +247,7 @@ public Response getWithResponse(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. 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 index 4a594ef5dc787..ad745ba5a6f9e 100644 --- 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 @@ -22,8 +22,8 @@ public final class MdeOnboardingsImpl implements MdeOnboardings { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public MdeOnboardingsImpl( - MdeOnboardingsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + public MdeOnboardingsImpl(MdeOnboardingsClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -31,10 +31,7 @@ public MdeOnboardingsImpl( public Response listWithResponse(Context context) { Response inner = this.serviceClient().listWithResponse(context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new MdeOnboardingDataListImpl(inner.getValue(), this.manager())); } else { return null; @@ -53,10 +50,7 @@ public MdeOnboardingDataList list() { public Response getWithResponse(Context context) { Response inner = this.serviceClient().getWithResponse(context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new MdeOnboardingDataImpl(inner.getValue(), this.manager())); } else { return null; diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationResultAutoGeneratedImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationResultAutoGeneratedImpl.java index dc4835d2f4bc1..bbeb3b70d2c4f 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationResultAutoGeneratedImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationResultAutoGeneratedImpl.java @@ -13,8 +13,7 @@ public final class OperationResultAutoGeneratedImpl implements OperationResultAu private final com.azure.resourcemanager.security.SecurityManager serviceManager; - OperationResultAutoGeneratedImpl( - OperationResultAutoGeneratedInner innerObject, + OperationResultAutoGeneratedImpl(OperationResultAutoGeneratedInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 new file mode 100644 index 0000000000000..b16f6acad6f2d --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationStatusResultImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 Float 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 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/OperationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationsClientImpl.java index df2c60d733e3c..ce9ead3feba03 100644 --- 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 @@ -30,22 +30,28 @@ import com.azure.resourcemanager.security.models.OperationList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final OperationsService service; - /** The service client containing this operation class. */ + /** + * 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.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -56,100 +62,74 @@ public final class OperationsClientImpl implements OperationsClient { @Host("{$host}") @ServiceInterface(name = "SecurityCenterOperat") public interface OperationsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Security/operations") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") 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 list of possible operations for Microsoft.Security resource provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() 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, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + 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 list of possible operations for Microsoft.Security resource provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() 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, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + 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 list of possible operations for Microsoft.Security resource provider as paginated response with {@link - * PagedFlux}. + * @return list of possible operations for Microsoft.Security resource provider as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -158,27 +138,27 @@ private PagedFlux 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 list of possible operations for Microsoft.Security resource provider as paginated response with {@link - * PagedFlux}. + * @return list of possible operations for Microsoft.Security 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)); + 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 list of possible operations for Microsoft.Security resource provider as paginated response with {@link - * PagedIterable}. + * @return list of possible operations for Microsoft.Security resource provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -187,13 +167,13 @@ public 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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of possible operations for Microsoft.Security resource provider as paginated response with {@link - * PagedIterable}. + * @return list of possible operations for Microsoft.Security resource provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -202,14 +182,15 @@ public PagedIterable list(Context context) { /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 possible operations for Microsoft.Security resource provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -217,37 +198,28 @@ private Mono> listNextSinglePageAsync(String nextL 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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 possible operations for Microsoft.Security resource provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -255,23 +227,13 @@ private Mono> listNextSinglePageAsync(String nextL 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.")); + 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)); + 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 index 4d0d7488ce5f4..b40714e8b3e83 100644 --- 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 @@ -19,20 +19,20 @@ public final class OperationsImpl implements Operations { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public OperationsImpl( - OperationsClient innerClient, 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 Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } private OperationsClient serviceClient() { 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 index 46e348a6d463e..ab7e27cea4858 100644 --- 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 @@ -5,9 +5,12 @@ package com.azure.resourcemanager.security.implementation; 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; @@ -51,12 +54,24 @@ public OffsetDateTime enablementTime() { return this.innerModel().enablementTime(); } - public Boolean deprecated() { - return this.innerModel().deprecated(); + public Enforce enforce() { + return this.innerModel().enforce(); } - public List replacedBy() { - List inner = this.innerModel().replacedBy(); + 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 { @@ -64,8 +79,12 @@ public List replacedBy() { } } - public List extensions() { - List inner = this.innerModel().extensions(); + public Boolean deprecated() { + return this.innerModel().deprecated(); + } + + public List replacedBy() { + List inner = this.innerModel().replacedBy(); if (inner != null) { return Collections.unmodifiableList(inner); } else { 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 index fce69ede7db36..17437a75891a0 100644 --- 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 @@ -25,9 +25,8 @@ public final class PricingListImpl implements PricingList { 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())); + return Collections.unmodifiableList( + inner.stream().map(inner1 -> new PricingImpl(inner1, this.manager())).collect(Collectors.toList())); } else { return Collections.emptyList(); } 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 index d1e7fb2693c0c..bc2876b3ba79b 100644 --- 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 @@ -5,6 +5,7 @@ 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; @@ -28,17 +29,23 @@ 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. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final PricingsService service; - /** The service client containing this operation class. */ + /** + * 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) { @@ -53,410 +60,569 @@ public final class PricingsClientImpl implements PricingsClient { @Host("{$host}") @ServiceInterface(name = "SecurityCenterPricin") public interface PricingsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/{scopeId}/providers/Microsoft.Security/pricings/{pricingName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scopeId", encoded = true) String scopeId, + @PathParam("pricingName") String pricingName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Put("/{scopeId}/providers/Microsoft.Security/pricings/{pricingName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("pricingName") String pricingName, - @HeaderParam("Accept") String accept, - Context context); + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scopeId", encoded = true) String scopeId, + @PathParam("pricingName") String pricingName, @BodyParam("application/json") PricingInner pricing, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Delete("/{scopeId}/providers/Microsoft.Security/pricings/{pricingName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("pricingName") String pricingName, - @BodyParam("application/json") PricingInner pricing, - @HeaderParam("Accept") String accept, - Context context); + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam(value = "scopeId", encoded = true) String scopeId, @PathParam("pricingName") String pricingName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/{scopeId}/providers/Microsoft.Security/pricings") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scopeId", encoded = true) String scopeId, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); } /** - * Lists Microsoft Defender for Cloud pricing configurations in the subscription. - * + * 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 scope id of the pricing. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or a specific resource (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}) + * - Supported resources are (VirtualMachines). + * @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 pricing configurations response along with {@link Response} on successful completion of {@link - * Mono}. + * @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> listWithResponseAsync() { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() 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 = "2023-01-01"; + 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 - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + context -> service.get(this.client.getEndpoint(), apiVersion, scopeId, pricingName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists Microsoft Defender for Cloud pricing configurations in the subscription. - * + * 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 scope id of the pricing. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or a specific resource (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}) + * - Supported resources are (VirtualMachines). + * @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 pricing configurations response along with {@link Response} on successful completion of {@link - * Mono}. + * @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> listWithResponseAsync(Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() 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 = "2023-01-01"; + final String apiVersion = "2024-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); + return service.get(this.client.getEndpoint(), apiVersion, scopeId, pricingName, accept, context); } /** - * Lists Microsoft Defender for Cloud pricing configurations in the subscription. - * + * 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 scope id of the pricing. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or a specific resource (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}) + * - Supported resources are (VirtualMachines). + * @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 pricing configurations response on successful completion of {@link Mono}. + * @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 listAsync() { - return listWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono getAsync(String scopeId, String pricingName) { + return getWithResponseAsync(scopeId, pricingName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Lists Microsoft Defender for Cloud pricing configurations in the subscription. - * + * 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 scope id of the pricing. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or a specific resource (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}) + * - Supported resources are (VirtualMachines). + * @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 pricing configurations response along with {@link Response}. + * @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 listWithResponse(Context context) { - return listWithResponseAsync(context).block(); + public Response getWithResponse(String scopeId, String pricingName, Context context) { + return getWithResponseAsync(scopeId, pricingName, context).block(); } /** - * Lists Microsoft Defender for Cloud pricing configurations in the subscription. - * + * 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 scope id of the pricing. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or a specific resource (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}) + * - Supported resources are (VirtualMachines). + * @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 pricing configurations response. + * @return the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a + * subscription id). */ @ServiceMethod(returns = ReturnType.SINGLE) - public PricingListInner list() { - return listWithResponse(Context.NONE).getValue(); + public PricingInner get(String scopeId, String pricingName) { + return getWithResponse(scopeId, pricingName, Context.NONE).getValue(); } /** - * Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * + * 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 scope id of the pricing. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or a specific resource (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}) + * - Supported resources are (VirtualMachines). * @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 a provided Microsoft Defender for Cloud pricing configuration in the subscription along with {@link - * Response} on successful completion of {@link Mono}. + * @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> getWithResponseAsync(String pricingName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() 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 = "2023-01-01"; + 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 accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - pricingName, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), apiVersion, scopeId, pricingName, pricing, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * + * 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 scope id of the pricing. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or a specific resource (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}) + * - Supported resources are (VirtualMachines). * @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 a provided Microsoft Defender for Cloud pricing configuration in the subscription along with {@link - * Response} on successful completion of {@link Mono}. + * @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> getWithResponseAsync(String pricingName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() 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 = "2023-01-01"; + 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 accept = "application/json"; context = this.client.mergeContext(context); - return service - .get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), pricingName, accept, context); + return service.update(this.client.getEndpoint(), apiVersion, scopeId, pricingName, pricing, accept, context); } /** - * Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * + * 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 scope id of the pricing. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or a specific resource (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}) + * - Supported resources are (VirtualMachines). * @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 a provided Microsoft Defender for Cloud pricing configuration in the subscription on successful - * completion of {@link Mono}. + * @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 getAsync(String pricingName) { - return getWithResponseAsync(pricingName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono updateAsync(String scopeId, String pricingName, PricingInner pricing) { + return updateWithResponseAsync(scopeId, pricingName, pricing).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * + * 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 scope id of the pricing. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or a specific resource (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}) + * - Supported resources are (VirtualMachines). * @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 a provided Microsoft Defender for Cloud pricing configuration in the subscription along with {@link - * Response}. + * @return microsoft Defender for Cloud is provided in two pricing tiers: free and standard along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String pricingName, Context context) { - return getWithResponseAsync(pricingName, context).block(); + public Response updateWithResponse(String scopeId, String pricingName, PricingInner pricing, + Context context) { + return updateWithResponseAsync(scopeId, pricingName, pricing, context).block(); } /** - * Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * + * 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 scope id of the pricing. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or a specific resource (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}) + * - Supported resources are (VirtualMachines). * @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 a provided Microsoft Defender for Cloud pricing configuration in the subscription. + * @return microsoft Defender for Cloud is provided in two pricing tiers: free and standard. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PricingInner get(String pricingName) { - return getWithResponse(pricingName, Context.NONE).getValue(); + public PricingInner update(String scopeId, String pricingName, PricingInner pricing) { + return updateWithResponse(scopeId, pricingName, pricing, Context.NONE).getValue(); } /** - * Updates a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * + * Deletes a provided Microsoft Defender for Cloud pricing configuration in a specific resource. Valid only for + * resource scope (Supported resources are: 'VirtualMachines, VMSS and ARC MachinesS'). + * + * @param scopeId The identifier of the resource, (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}). * @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}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String pricingName, PricingInner pricing) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() 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 = "2023-01-01"; + final String apiVersion = "2024-01-01"; final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - pricingName, - pricing, - accept, - context)) + context -> service.delete(this.client.getEndpoint(), apiVersion, scopeId, pricingName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Updates a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * + * Deletes a provided Microsoft Defender for Cloud pricing configuration in a specific resource. Valid only for + * resource scope (Supported resources are: 'VirtualMachines, VMSS and ARC MachinesS'). + * + * @param scopeId The identifier of the resource, (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}). * @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}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String pricingName, PricingInner pricing, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() 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 = "2023-01-01"; + final String apiVersion = "2024-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - pricingName, - pricing, - accept, - context); + return service.delete(this.client.getEndpoint(), apiVersion, scopeId, pricingName, accept, context); } /** - * Updates a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * + * Deletes a provided Microsoft Defender for Cloud pricing configuration in a specific resource. Valid only for + * resource scope (Supported resources are: 'VirtualMachines, VMSS and ARC MachinesS'). + * + * @param scopeId The identifier of the resource, (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}). * @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}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String pricingName, PricingInner pricing) { - return updateWithResponseAsync(pricingName, pricing).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono deleteAsync(String scopeId, String pricingName) { + return deleteWithResponseAsync(scopeId, pricingName).flatMap(ignored -> Mono.empty()); } /** - * Updates a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * + * Deletes a provided Microsoft Defender for Cloud pricing configuration in a specific resource. Valid only for + * resource scope (Supported resources are: 'VirtualMachines, VMSS and ARC MachinesS'). + * + * @param scopeId The identifier of the resource, (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}). * @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}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String pricingName, PricingInner pricing, Context context) { - return updateWithResponseAsync(pricingName, pricing, context).block(); + public Response deleteWithResponse(String scopeId, String pricingName, Context context) { + return deleteWithResponseAsync(scopeId, pricingName, context).block(); } /** - * Updates a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * + * Deletes a provided Microsoft Defender for Cloud pricing configuration in a specific resource. Valid only for + * resource scope (Supported resources are: 'VirtualMachines, VMSS and ARC MachinesS'). + * + * @param scopeId The identifier of the resource, (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}). * @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 pricingName, PricingInner pricing) { - return updateWithResponse(pricingName, pricing, Context.NONE).getValue(); + 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 scope id of the pricing. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or a specific resource (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}) + * - Supported resources are (VirtualMachines). + * @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 scope id of the pricing. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or a specific resource (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}) + * - Supported resources are (VirtualMachines). + * @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 scope id of the pricing. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or a specific resource (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}) + * - Supported resources are (VirtualMachines). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 scope id of the pricing. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or a specific resource (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}) + * - Supported resources are (VirtualMachines). + * @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 scope id of the pricing. Valid scopes are: subscription (format: + * 'subscriptions/{subscriptionId}'), or a specific resource (format: + * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}) + * - Supported resources are (VirtualMachines). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 index 99ea26d487348..d74c9313bcc98 100644 --- 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 @@ -27,43 +27,38 @@ public PricingsImpl(PricingsClient innerClient, com.azure.resourcemanager.securi this.serviceManager = serviceManager; } - public Response listWithResponse(Context context) { - Response inner = this.serviceClient().listWithResponse(context); + public Response getWithResponse(String scopeId, String pricingName, Context context) { + Response inner = this.serviceClient().getWithResponse(scopeId, pricingName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new PricingListImpl(inner.getValue(), this.manager())); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PricingImpl(inner.getValue(), this.manager())); } else { return null; } } - public PricingList list() { - PricingListInner inner = this.serviceClient().list(); + public Pricing get(String scopeId, String pricingName) { + PricingInner inner = this.serviceClient().get(scopeId, pricingName); if (inner != null) { - return new PricingListImpl(inner, this.manager()); + return new PricingImpl(inner, this.manager()); } else { return null; } } - public Response getWithResponse(String pricingName, Context context) { - Response inner = this.serviceClient().getWithResponse(pricingName, context); + public Response updateWithResponse(String scopeId, String pricingName, PricingInner pricing, + Context context) { + Response inner = this.serviceClient().updateWithResponse(scopeId, pricingName, pricing, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new PricingImpl(inner.getValue(), this.manager())); } else { return null; } } - public Pricing get(String pricingName) { - PricingInner inner = this.serviceClient().get(pricingName); + 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 { @@ -71,23 +66,28 @@ public Pricing get(String pricingName) { } } - public Response updateWithResponse(String pricingName, PricingInner pricing, Context context) { - Response inner = this.serviceClient().updateWithResponse(pricingName, pricing, context); + 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); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new PricingImpl(inner.getValue(), this.manager())); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PricingListImpl(inner.getValue(), this.manager())); } else { return null; } } - public Pricing update(String pricingName, PricingInner pricing) { - PricingInner inner = this.serviceClient().update(pricingName, pricing); + public PricingList list(String scopeId) { + PricingListInner inner = this.serviceClient().list(scopeId); if (inner != null) { - return new PricingImpl(inner, this.manager()); + return new PricingListImpl(inner, this.manager()); } else { return null; } 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 index d83de36d26c93..8345f2183601e 100644 --- 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 @@ -13,8 +13,7 @@ public final class RegulatoryComplianceAssessmentImpl implements RegulatoryCompl private final com.azure.resourcemanager.security.SecurityManager serviceManager; - RegulatoryComplianceAssessmentImpl( - RegulatoryComplianceAssessmentInner innerObject, + RegulatoryComplianceAssessmentImpl(RegulatoryComplianceAssessmentInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 index 90b9f8738eda7..5da14f069015f 100644 --- 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 @@ -30,80 +30,71 @@ import com.azure.resourcemanager.security.models.RegulatoryComplianceAssessmentList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in RegulatoryComplianceAssessmentsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final RegulatoryComplianceAssessmentsService service; - /** The service client containing this operation class. */ + /** + * 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.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. + * The interface defining all the services for SecurityCenterRegulatoryComplianceAssessments to be used by the + * proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "SecurityCenterRegula") public interface RegulatoryComplianceAssessmentsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("$host") 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); + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments/{regulatoryComplianceAssessmentName}") - @ExpectedResponses({200}) + @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("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("$host") 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); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context 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. * @param filter OData filter. Optional. @@ -111,65 +102,40 @@ Mono> listNext( * @throws ManagementException thrown 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}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); + 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.")); + 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)) + .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. @@ -178,65 +144,41 @@ private Mono> listSinglePageA * @throws ManagementException thrown 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}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, - String filter, + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); + 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.")); + 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)); + .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. @@ -246,8 +188,8 @@ private Mono> listSinglePageA * @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) { + private PagedFlux listAsync(String regulatoryComplianceStandardName, + String regulatoryComplianceControlName, String filter) { return new PagedFlux<>( () -> listSinglePageAsync(regulatoryComplianceStandardName, regulatoryComplianceControlName, filter), nextLink -> listNextSinglePageAsync(nextLink)); @@ -255,7 +197,7 @@ private PagedFlux listAsync( /** * 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. @@ -264,8 +206,8 @@ private PagedFlux listAsync( * @return list of regulatory compliance assessment response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName) { + private PagedFlux listAsync(String regulatoryComplianceStandardName, + String regulatoryComplianceControlName) { final String filter = null; return new PagedFlux<>( () -> listSinglePageAsync(regulatoryComplianceStandardName, regulatoryComplianceControlName, filter), @@ -274,7 +216,7 @@ private PagedFlux listAsync( /** * 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. @@ -285,20 +227,15 @@ private PagedFlux listAsync( * @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)); + 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. @@ -307,8 +244,8 @@ private PagedFlux listAsync( * @return list of regulatory compliance assessment response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName) { + public PagedIterable list(String regulatoryComplianceStandardName, + String regulatoryComplianceControlName) { final String filter = null; return new PagedIterable<>( listAsync(regulatoryComplianceStandardName, regulatoryComplianceControlName, filter)); @@ -316,7 +253,7 @@ public PagedIterable list( /** * 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. @@ -327,18 +264,15 @@ public PagedIterable list( * @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) { + public PagedIterable list(String regulatoryComplianceStandardName, + String regulatoryComplianceControlName, String filter, Context context) { return new PagedIterable<>( listAsync(regulatoryComplianceStandardName, regulatoryComplianceControlName, filter, 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. @@ -346,64 +280,44 @@ public PagedIterable list( * @throws 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}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); + 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.")); + 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.")); + 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)) + .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. @@ -412,62 +326,43 @@ private Mono> getWithResponseAsync * @throws 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}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, - String regulatoryComplianceAssessmentName, - Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); + 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.")); + 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.")); + 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); + 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. @@ -477,18 +372,15 @@ private Mono> getWithResponseAsync * @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())); + 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. @@ -499,22 +391,15 @@ private Mono getAsync( * @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(); + 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. @@ -524,28 +409,23 @@ public Response getWithResponse( * @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(); + public RegulatoryComplianceAssessmentInner get(String regulatoryComplianceStandardName, + String regulatoryComplianceControlName, String regulatoryComplianceAssessmentName) { + return getWithResponse(regulatoryComplianceStandardName, regulatoryComplianceControlName, + regulatoryComplianceAssessmentName, Context.NONE).getValue(); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 regulatory compliance assessment response along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -553,62 +433,43 @@ private Mono> listNextSingleP 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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 regulatory compliance assessment response along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { + 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.")); + 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)); + 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 index 222a4ee49b8b9..93ca5a7b9bd51 100644 --- 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 @@ -21,67 +21,45 @@ public final class RegulatoryComplianceAssessmentsImpl implements RegulatoryComp private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public RegulatoryComplianceAssessmentsImpl( - RegulatoryComplianceAssessmentsClient innerClient, + public RegulatoryComplianceAssessmentsImpl(RegulatoryComplianceAssessmentsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public PagedIterable list( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName) { - PagedIterable inner = - this.serviceClient().list(regulatoryComplianceStandardName, regulatoryComplianceControlName); - return Utils.mapPage(inner, inner1 -> new RegulatoryComplianceAssessmentImpl(inner1, this.manager())); + 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 Utils.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())); } - public Response getWithResponse( - String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, - String regulatoryComplianceAssessmentName, - Context context) { - Response inner = - this - .serviceClient() - .getWithResponse( - regulatoryComplianceStandardName, - regulatoryComplianceControlName, - regulatoryComplianceAssessmentName, - context); + public Response getWithResponse(String regulatoryComplianceStandardName, + String regulatoryComplianceControlName, String regulatoryComplianceAssessmentName, Context context) { + Response inner + = this.serviceClient().getWithResponse(regulatoryComplianceStandardName, regulatoryComplianceControlName, + regulatoryComplianceAssessmentName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new RegulatoryComplianceAssessmentImpl(inner.getValue(), this.manager())); } else { return null; } } - public RegulatoryComplianceAssessment get( - String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, - String regulatoryComplianceAssessmentName) { - RegulatoryComplianceAssessmentInner inner = - this - .serviceClient() - .get( - regulatoryComplianceStandardName, - regulatoryComplianceControlName, - regulatoryComplianceAssessmentName); + 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 { 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 index b51b1ed37d113..9c60baec0bd40 100644 --- 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 @@ -13,8 +13,7 @@ public final class RegulatoryComplianceControlImpl implements RegulatoryComplian private final com.azure.resourcemanager.security.SecurityManager serviceManager; - RegulatoryComplianceControlImpl( - RegulatoryComplianceControlInner innerObject, + RegulatoryComplianceControlImpl(RegulatoryComplianceControlInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 index a1bf42ba21daf..96e7ae2abab03 100644 --- 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 @@ -30,24 +30,28 @@ import com.azure.resourcemanager.security.models.RegulatoryComplianceControlList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in RegulatoryComplianceControlsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final RegulatoryComplianceControlsService service; - /** The service client containing this operation class. */ + /** + * 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.service = RestProxy.create(RegulatoryComplianceControlsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -58,106 +62,73 @@ public final class RegulatoryComplianceControlsClientImpl implements RegulatoryC @Host("{$host}") @ServiceInterface(name = "SecurityCenterRegula") public interface RegulatoryComplianceControlsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("$host") 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); + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("$host") 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); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * 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}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String regulatoryComplianceStandardName, String filter) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); + 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)) + .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. @@ -165,55 +136,36 @@ private Mono> listSinglePageAsyn * @throws ManagementException thrown 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}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String regulatoryComplianceStandardName, String filter, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); + 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)); + .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. @@ -222,16 +174,15 @@ private Mono> listSinglePageAsyn * @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), + 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. @@ -241,14 +192,13 @@ private PagedFlux listAsync( @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String regulatoryComplianceStandardName) { final String filter = null; - return new PagedFlux<>( - () -> listSinglePageAsync(regulatoryComplianceStandardName, 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. * @param filter OData filter. Optional. * @param context The context to associate with this operation. @@ -258,16 +208,15 @@ private PagedFlux listAsync(String regulatoryC * @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), + 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. @@ -282,7 +231,7 @@ public PagedIterable list(String regulatoryCom /** * 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. @@ -292,69 +241,52 @@ public PagedIterable list(String regulatoryCom * @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) { + public PagedIterable list(String regulatoryComplianceStandardName, String filter, + Context context) { return new PagedIterable<>(listAsync(regulatoryComplianceStandardName, filter, 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); + 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.")); + 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)) + .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. @@ -362,52 +294,37 @@ private Mono> getWithResponseAsync( * @throws 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}. + * {@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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); + 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.")); + 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); + 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. @@ -416,15 +333,15 @@ private Mono> getWithResponseAsync( * @return regulatory compliance control details and state on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName) { + 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. @@ -434,14 +351,14 @@ private Mono getAsync( * @return regulatory compliance control details and state along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName, Context context) { + 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. @@ -450,22 +367,23 @@ public Response getWithResponse( * @return regulatory compliance control details and state. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RegulatoryComplianceControlInner get( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName) { + public RegulatoryComplianceControlInner get(String regulatoryComplianceStandardName, + String regulatoryComplianceControlName) { return getWithResponse(regulatoryComplianceStandardName, regulatoryComplianceControlName, Context.NONE) .getValue(); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 regulatory compliance controls response along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -473,62 +391,43 @@ private Mono> listNextSinglePage 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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 regulatory compliance controls response along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { + 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.")); + 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)); + 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 index 31f2bb5591397..253dcaf1bbf58 100644 --- 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 @@ -21,47 +21,43 @@ public final class RegulatoryComplianceControlsImpl implements RegulatoryComplia private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public RegulatoryComplianceControlsImpl( - RegulatoryComplianceControlsClient innerClient, + public RegulatoryComplianceControlsImpl(RegulatoryComplianceControlsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list(String regulatoryComplianceStandardName) { - PagedIterable inner = - this.serviceClient().list(regulatoryComplianceStandardName); - return Utils.mapPage(inner, inner1 -> new RegulatoryComplianceControlImpl(inner1, this.manager())); + 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 Utils.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())); } - public Response getWithResponse( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName, Context context) { - Response inner = - this - .serviceClient() - .getWithResponse(regulatoryComplianceStandardName, regulatoryComplianceControlName, context); + public Response getWithResponse(String regulatoryComplianceStandardName, + String regulatoryComplianceControlName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(regulatoryComplianceStandardName, regulatoryComplianceControlName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new RegulatoryComplianceControlImpl(inner.getValue(), this.manager())); } else { return null; } } - public RegulatoryComplianceControl get( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName) { - RegulatoryComplianceControlInner inner = - this.serviceClient().get(regulatoryComplianceStandardName, regulatoryComplianceControlName); + public RegulatoryComplianceControl get(String regulatoryComplianceStandardName, + String regulatoryComplianceControlName) { + RegulatoryComplianceControlInner inner + = this.serviceClient().get(regulatoryComplianceStandardName, regulatoryComplianceControlName); if (inner != null) { return new RegulatoryComplianceControlImpl(inner, this.manager()); } else { 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 index 19762eafd2517..ac80baff85296 100644 --- 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 @@ -13,8 +13,7 @@ public final class RegulatoryComplianceStandardImpl implements RegulatoryComplia private final com.azure.resourcemanager.security.SecurityManager serviceManager; - RegulatoryComplianceStandardImpl( - RegulatoryComplianceStandardInner innerObject, + RegulatoryComplianceStandardImpl(RegulatoryComplianceStandardInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 index 9c58140377cb1..5682fe203485d 100644 --- 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 @@ -30,26 +30,28 @@ import com.azure.resourcemanager.security.models.RegulatoryComplianceStandardList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in RegulatoryComplianceStandardsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final RegulatoryComplianceStandardsService service; - /** The service client containing this operation class. */ + /** + * 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.service = RestProxy.create(RegulatoryComplianceStandardsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -60,135 +62,95 @@ public final class RegulatoryComplianceStandardsClientImpl implements Regulatory @Host("{$host}") @ServiceInterface(name = "SecurityCenterRegula") public interface RegulatoryComplianceStandardsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") 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( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("regulatoryComplianceStandardName") String regulatoryComplianceStandardName, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * 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}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)) + .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}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)); + .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. @@ -202,7 +164,7 @@ private PagedFlux listAsync(String filter) { /** * 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}. @@ -215,7 +177,7 @@ private PagedFlux listAsync() { /** * 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. @@ -225,13 +187,13 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, context), nextLink -> listNextSinglePageAsync(nextLink, 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}. @@ -244,7 +206,7 @@ public 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. @@ -259,99 +221,73 @@ public PagedIterable list(String filter, Cont /** * 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String regulatoryComplianceStandardName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); + 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)) + .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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String regulatoryComplianceStandardName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); + 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); + 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. @@ -365,7 +301,7 @@ private Mono getAsync(String regulatoryCompli /** * 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. @@ -374,14 +310,14 @@ private Mono getAsync(String regulatoryCompli * @return regulatory compliance standard details and state along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String regulatoryComplianceStandardName, Context context) { + 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. @@ -395,14 +331,15 @@ public RegulatoryComplianceStandardInner get(String regulatoryComplianceStandard /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 regulatory compliance standards response along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -410,62 +347,43 @@ private Mono> listNextSinglePag 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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 regulatory compliance standards response along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { + 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.")); + 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)); + 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 index 8f57bbcd3d41d..b6a36939c29e0 100644 --- 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 @@ -21,8 +21,7 @@ public final class RegulatoryComplianceStandardsImpl implements RegulatoryCompli private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public RegulatoryComplianceStandardsImpl( - RegulatoryComplianceStandardsClient innerClient, + public RegulatoryComplianceStandardsImpl(RegulatoryComplianceStandardsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -30,23 +29,22 @@ public RegulatoryComplianceStandardsImpl( public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new RegulatoryComplianceStandardImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new RegulatoryComplianceStandardImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new RegulatoryComplianceStandardImpl(inner1, this.manager())); } - public Response getWithResponse( - String regulatoryComplianceStandardName, Context context) { - Response inner = - this.serviceClient().getWithResponse(regulatoryComplianceStandardName, context); + public Response getWithResponse(String regulatoryComplianceStandardName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(regulatoryComplianceStandardName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new RegulatoryComplianceStandardImpl(inner.getValue(), this.manager())); } else { return null; diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/Utils.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ResourceManagerUtils.java similarity index 79% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/Utils.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ResourceManagerUtils.java index 210bf291fe60f..9f956c1dc42e1 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/Utils.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ResourceManagerUtils.java @@ -19,7 +19,10 @@ import java.util.stream.Stream; import reactor.core.publisher.Flux; -final class Utils { +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + static String getValueFromIdByName(String id, String name) { if (id == null) { return null; @@ -38,6 +41,7 @@ static String getValueFromIdByName(String id, String name) { } } return null; + } static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { @@ -60,7 +64,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri segments.add(idSegment); idItrReverted.forEachRemaining(segments::add); Collections.reverse(segments); - if (segments.size() > 0 && segments.get(0).isEmpty()) { + if (!segments.isEmpty() && segments.get(0).isEmpty()) { segments.remove(0); } return String.join("/", segments); @@ -71,10 +75,11 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } } return null; + } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl(pageIterable, mapper); + return new PagedIterableImpl<>(pageIterable, mapper); } private static final class PagedIterableImpl extends PagedIterable { @@ -84,26 +89,17 @@ private static final class PagedIterableImpl extends PagedIterable { private final Function, PagedResponse> pageMapper; private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super( - PagedFlux - .create( - () -> - (continuationToken, pageSize) -> - Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(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); + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); } @Override @@ -133,30 +129,27 @@ public Stream> streamByPage(String continuationToken, int prefe @Override public Iterator iterator() { - return new IteratorImpl(pagedIterable.iterator(), mapper); + return new IteratorImpl<>(pagedIterable.iterator(), mapper); } @Override public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); } @Override public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); } } @@ -198,7 +191,7 @@ private IterableImpl(Iterable iterable, Function mapper) { @Override public Iterator iterator() { - return new IteratorImpl(iterable.iterator(), mapper); + return new IteratorImpl<>(iterable.iterator(), mapper); } } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ResourceProvidersClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ResourceProvidersClientImpl.java new file mode 100644 index 0000000000000..cf7bc0ec09e20 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ResourceProvidersClientImpl.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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.ResourceProvidersClient; +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 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 SecurityCenterImpl client; + + /** + * Initializes an instance of ResourceProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceProvidersClientImpl(SecurityCenterImpl client) { + this.service + = RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityCenterResourceProviders to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityCenterResour") + public interface ResourceProvidersService { + @Headers({ "Content-Type: application/json" }) + @Put("/providers/Microsoft.Security/sensitivitySettings/current") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateSensitivitySettings( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UpdateSensitivitySettingsRequest sensitivitySettings, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Security/sensitivitySettings/current") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getSensitivitySettings(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Updates 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> + updateSensitivitySettingsWithResponseAsync(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 accept = "application/json"; + return FluxUtil + .withContext(context -> service.updateSensitivitySettings(this.client.getEndpoint(), apiVersion, + sensitivitySettings, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates 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> updateSensitivitySettingsWithResponseAsync( + 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service.updateSensitivitySettings(this.client.getEndpoint(), apiVersion, sensitivitySettings, accept, + context); + } + + /** + * Updates 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 + updateSensitivitySettingsAsync(UpdateSensitivitySettingsRequest sensitivitySettings) { + return updateSensitivitySettingsWithResponseAsync(sensitivitySettings) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates 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 + updateSensitivitySettingsWithResponse(UpdateSensitivitySettingsRequest sensitivitySettings, Context context) { + return updateSensitivitySettingsWithResponseAsync(sensitivitySettings, context).block(); + } + + /** + * Updates 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 + updateSensitivitySettings(UpdateSensitivitySettingsRequest sensitivitySettings) { + return updateSensitivitySettingsWithResponse(sensitivitySettings, Context.NONE).getValue(); + } + + /** + * 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> getSensitivitySettingsWithResponseAsync() { + 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.getSensitivitySettings(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> + getSensitivitySettingsWithResponseAsync(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.getSensitivitySettings(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 getSensitivitySettingsAsync() { + return getSensitivitySettingsWithResponseAsync().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 getSensitivitySettingsWithResponse(Context context) { + return getSensitivitySettingsWithResponseAsync(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 getSensitivitySettings() { + return getSensitivitySettingsWithResponse(Context.NONE).getValue(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ResourceProvidersImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ResourceProvidersImpl.java new file mode 100644 index 0000000000000..ed462c3f41d35 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ResourceProvidersImpl.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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.ResourceProvidersClient; +import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsResponseInner; +import com.azure.resourcemanager.security.models.GetSensitivitySettingsResponse; +import com.azure.resourcemanager.security.models.ResourceProviders; +import com.azure.resourcemanager.security.models.UpdateSensitivitySettingsRequest; + +public final class ResourceProvidersImpl implements ResourceProviders { + private static final ClientLogger LOGGER = new ClientLogger(ResourceProvidersImpl.class); + + private final ResourceProvidersClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public ResourceProvidersImpl(ResourceProvidersClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response + updateSensitivitySettingsWithResponse(UpdateSensitivitySettingsRequest sensitivitySettings, Context context) { + Response inner + = this.serviceClient().updateSensitivitySettingsWithResponse(sensitivitySettings, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new GetSensitivitySettingsResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GetSensitivitySettingsResponse + updateSensitivitySettings(UpdateSensitivitySettingsRequest sensitivitySettings) { + GetSensitivitySettingsResponseInner inner = this.serviceClient().updateSensitivitySettings(sensitivitySettings); + if (inner != null) { + return new GetSensitivitySettingsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getSensitivitySettingsWithResponse(Context context) { + Response inner + = this.serviceClient().getSensitivitySettingsWithResponse(context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new GetSensitivitySettingsResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GetSensitivitySettingsResponse getSensitivitySettings() { + GetSensitivitySettingsResponseInner inner = this.serviceClient().getSensitivitySettings(); + if (inner != null) { + return new GetSensitivitySettingsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private ResourceProvidersClient 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/RuleResultsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RuleResultsImpl.java index 82aeae996a3c3..efb8a0eab819f 100644 --- 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 @@ -58,22 +58,14 @@ public RuleResultsImpl withExistingResourceId(String resourceId) { } public RuleResults create() { - this.innerObject = - serviceManager - .serviceClient() - .getSqlVulnerabilityAssessmentBaselineRules() - .createOrUpdateWithResponse(ruleId, createWorkspaceId, resourceId, createBody, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getSqlVulnerabilityAssessmentBaselineRules() + .createOrUpdateWithResponse(ruleId, createWorkspaceId, resourceId, createBody, Context.NONE).getValue(); return this; } public RuleResults create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSqlVulnerabilityAssessmentBaselineRules() - .createOrUpdateWithResponse(ruleId, createWorkspaceId, resourceId, createBody, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getSqlVulnerabilityAssessmentBaselineRules() + .createOrUpdateWithResponse(ruleId, createWorkspaceId, resourceId, createBody, context).getValue(); return this; } @@ -92,40 +84,26 @@ public RuleResultsImpl update() { } public RuleResults apply() { - this.innerObject = - serviceManager - .serviceClient() - .getSqlVulnerabilityAssessmentBaselineRules() - .createOrUpdateWithResponse(ruleId, updateWorkspaceId, resourceId, updateBody, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getSqlVulnerabilityAssessmentBaselineRules() + .createOrUpdateWithResponse(ruleId, updateWorkspaceId, resourceId, updateBody, Context.NONE).getValue(); return this; } public RuleResults apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSqlVulnerabilityAssessmentBaselineRules() - .createOrUpdateWithResponse(ruleId, updateWorkspaceId, resourceId, updateBody, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getSqlVulnerabilityAssessmentBaselineRules() + .createOrUpdateWithResponse(ruleId, updateWorkspaceId, resourceId, updateBody, context).getValue(); return this; } RuleResultsImpl(RuleResultsInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.ruleId = - Utils - .getValueFromIdByParameterName( - innerObject.id(), - "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}", - "ruleId"); - this.resourceId = - Utils - .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"); + this.resourceId = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}", + "resourceId"); } public RuleResultsImpl withLatestScan(Boolean latestScan) { 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 index d048424ac5cb6..6daf8a684865d 100644 --- 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 @@ -25,12 +25,8 @@ public final class RulesResultsImpl implements RulesResults { 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())); + return Collections.unmodifiableList( + inner.stream().map(inner1 -> new RuleResultsImpl(inner1, this.manager())).collect(Collectors.toList())); } else { return Collections.emptyList(); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScanResultsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScanResultsImpl.java index 0380f7db5b053..b6497100bdfd0 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScanResultsImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScanResultsImpl.java @@ -25,12 +25,8 @@ public final class ScanResultsImpl implements ScanResults { public List value() { List inner = this.innerModel().value(); if (inner != null) { - return Collections - .unmodifiableList( - inner - .stream() - .map(inner1 -> new ScanResultImpl(inner1, this.manager())) - .collect(Collectors.toList())); + return Collections.unmodifiableList( + inner.stream().map(inner1 -> new ScanResultImpl(inner1, this.manager())).collect(Collectors.toList())); } else { return Collections.emptyList(); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScansImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScansImpl.java index 0b79bb6484c41..8c61fe7739eac 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScansImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScansImpl.java @@ -25,9 +25,8 @@ public final class ScansImpl implements Scans { public List value() { List inner = this.innerModel().value(); if (inner != null) { - return Collections - .unmodifiableList( - inner.stream().map(inner1 -> new ScanImpl(inner1, this.manager())).collect(Collectors.toList())); + return Collections.unmodifiableList( + inner.stream().map(inner1 -> new ScanImpl(inner1, this.manager())).collect(Collectors.toList())); } else { return Collections.emptyList(); } 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 index 0e04649334453..95cbe7eda8480 100644 --- 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 @@ -16,8 +16,7 @@ public final class SecureScoreControlDefinitionItemImpl implements SecureScoreCo private final com.azure.resourcemanager.security.SecurityManager serviceManager; - SecureScoreControlDefinitionItemImpl( - SecureScoreControlDefinitionItemInner innerObject, + SecureScoreControlDefinitionItemImpl(SecureScoreControlDefinitionItemInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 index 8ed2fc1ff10ff..162e49e2dd069 100644 --- 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 @@ -30,26 +30,28 @@ import com.azure.resourcemanager.security.models.SecureScoreControlDefinitionList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in SecureScoreControlDefinitionsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final SecureScoreControlDefinitionsService service; - /** The service client containing this operation class. */ + /** + * 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.service = RestProxy.create(SecureScoreControlDefinitionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -60,117 +62,87 @@ public final class SecureScoreControlDefinitionsClientImpl implements SecureScor @Host("{$host}") @ServiceInterface(name = "SecurityCenterSecure") public interface SecureScoreControlDefinitionsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Security/secureScoreControlDefinitions") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControlDefinitions") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscription( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> listBySubscription(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") 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}. + * @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.")); + 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)) + 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}. + * @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.")); + 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)); + 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}. @@ -182,7 +154,7 @@ private PagedFlux 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. @@ -191,13 +163,13 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, 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}. @@ -209,7 +181,7 @@ public 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 ManagementException thrown if the request is rejected by server. @@ -223,103 +195,78 @@ public PagedIterable list(Context 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}. + * @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)) + .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}. + * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)); + .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)); + 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. @@ -328,14 +275,13 @@ private PagedFlux listBySubscriptionAsync */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listBySubscriptionAsync(Context context) { - return new PagedFlux<>( - () -> listBySubscriptionSinglePageAsync(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}. @@ -347,7 +293,7 @@ public 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 ManagementException thrown if the request is rejected by server. @@ -361,14 +307,15 @@ public PagedIterable listBySubscription(C /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 security controls definition along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @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) { @@ -376,140 +323,104 @@ private Mono> listNextSingl 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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 security controls definition along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @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) { + 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.")); + 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)); + 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 - *

The nextLink parameter. + * + * The nextLink 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 security controls definition along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @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) { + 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.")); + 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)) + .>map(res -> new 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 - *

The nextLink parameter. + * + * The nextLink 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 security controls definition along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @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) { + 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.")); + 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)); + 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 index 6e0346a7e5366..5423f04374f9d 100644 --- 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 @@ -19,8 +19,7 @@ public final class SecureScoreControlDefinitionsImpl implements SecureScoreContr private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public SecureScoreControlDefinitionsImpl( - SecureScoreControlDefinitionsClient innerClient, + public SecureScoreControlDefinitionsImpl(SecureScoreControlDefinitionsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -28,22 +27,26 @@ public SecureScoreControlDefinitionsImpl( public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new SecureScoreControlDefinitionItemImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SecureScoreControlDefinitionItemImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new SecureScoreControlDefinitionItemImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SecureScoreControlDefinitionItemImpl(inner1, this.manager())); } public PagedIterable listBySubscription() { PagedIterable inner = this.serviceClient().listBySubscription(); - return Utils.mapPage(inner, inner1 -> new SecureScoreControlDefinitionItemImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SecureScoreControlDefinitionItemImpl(inner1, this.manager())); } public PagedIterable listBySubscription(Context context) { PagedIterable inner = this.serviceClient().listBySubscription(context); - return Utils.mapPage(inner, inner1 -> new SecureScoreControlDefinitionItemImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SecureScoreControlDefinitionItemImpl(inner1, this.manager())); } private SecureScoreControlDefinitionsClient serviceClient() { 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 index 98ebfdf2afbaa..c9717c67992a8 100644 --- 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 @@ -14,8 +14,8 @@ public final class SecureScoreControlDetailsImpl implements SecureScoreControlDe private final com.azure.resourcemanager.security.SecurityManager serviceManager; - SecureScoreControlDetailsImpl( - SecureScoreControlDetailsInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + SecureScoreControlDetailsImpl(SecureScoreControlDetailsInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 index d3a1b368b1f60..5c32b8c688903 100644 --- 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 @@ -14,8 +14,7 @@ public final class SecureScoreControlScoreDetailsImpl implements SecureScoreCont private final com.azure.resourcemanager.security.SecurityManager serviceManager; - SecureScoreControlScoreDetailsImpl( - SecureScoreControlScoreDetailsInner innerObject, + SecureScoreControlScoreDetailsImpl(SecureScoreControlScoreDetailsInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 index 198a22b386af5..d9047aab86251 100644 --- 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 @@ -31,22 +31,28 @@ import com.azure.resourcemanager.security.models.SecureScoreControlList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in SecureScoreControlsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final SecureScoreControlsService service; - /** The service client containing this operation class. */ + /** + * 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.service = RestProxy.create(SecureScoreControlsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -57,79 +63,61 @@ public final class SecureScoreControlsClientImpl implements SecureScoreControlsC @Host("{$host}") @ServiceInterface(name = "SecurityCenterSecure") public interface SecureScoreControlsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName}/secureScoreControls") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName}/secureScoreControls") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySecureScore( - @HostParam("$host") 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); + Mono> listBySecureScore(@HostParam("$host") 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"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControls") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$expand") ExpandControlsEnum expand, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") 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"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySecureScoreNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") 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. + * 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}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySecureScoreSinglePageAsync( - String secureScoreName, ExpandControlsEnum expand) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (secureScoreName == null) { return Mono @@ -138,56 +126,36 @@ private Mono> listBySecureScoreSin 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)) + .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. + * 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}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySecureScoreSinglePageAsync( - String secureScoreName, ExpandControlsEnum expand, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (secureScoreName == null) { return Mono @@ -197,95 +165,79 @@ private Mono> listBySecureScoreSin 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)); + .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. + * 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}. + * @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), + 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. + * 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}. + * @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), + 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. + * 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}. + * @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), + 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. + * 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}. + * @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) { @@ -295,117 +247,87 @@ public PagedIterable listBySecureScore(String se /** * 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. + * 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}. + * @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) { + 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}. + * @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)) + .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}. + * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)); + .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. @@ -419,7 +341,7 @@ private PagedFlux listAsync(ExpandControlsEnum e /** * 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}. @@ -432,7 +354,7 @@ private PagedFlux listAsync() { /** * 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. @@ -442,13 +364,13 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(ExpandControlsEnum expand, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(expand, context), nextLink -> listNextSinglePageAsync(nextLink, 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}. @@ -461,7 +383,7 @@ public 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. @@ -476,9 +398,10 @@ public PagedIterable list(ExpandControlsEnum exp /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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. @@ -490,31 +413,23 @@ private Mono> listBySecureScoreNex 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.")); + 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)) + .>map(res -> new 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -522,37 +437,28 @@ private Mono> listBySecureScoreNex * @return list of security controls along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySecureScoreNextSinglePageAsync( - String nextLink, Context context) { + 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.")); + 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)); + 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -564,31 +470,22 @@ private Mono> listNextSinglePageAs 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -596,29 +493,19 @@ private Mono> listNextSinglePageAs * @return list of security controls along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { + 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.")); + 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)); + 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 index ddce15948c300..8c10b8f58ec89 100644 --- 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 @@ -20,32 +20,32 @@ public final class SecureScoreControlsImpl implements SecureScoreControls { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public SecureScoreControlsImpl( - SecureScoreControlsClient innerClient, 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 Utils.mapPage(inner, inner1 -> new SecureScoreControlDetailsImpl(inner1, this.manager())); + 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 Utils.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 Utils.mapPage(inner, inner1 -> new SecureScoreControlDetailsImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new SecureScoreControlDetailsImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecureScoreControlDetailsImpl(inner1, this.manager())); } private SecureScoreControlsClient serviceClient() { 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 index b7b5a90f0ae93..fc83a1473b342 100644 --- 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 @@ -12,8 +12,8 @@ public final class SecureScoreItemImpl implements SecureScoreItem { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - SecureScoreItemImpl( - SecureScoreItemInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + SecureScoreItemImpl(SecureScoreItemInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 index 91d2496b7feb0..668ebc1899f5a 100644 --- 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 @@ -30,69 +30,66 @@ import com.azure.resourcemanager.security.models.SecureScoresList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in SecureScoresClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final SecureScoresService service; - /** The service client containing this operation class. */ + /** + * 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.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. + * The interface defining all the services for SecurityCenterSecureScores to be used by the proxy service to + * perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "SecurityCenterSecure") public interface SecureScoresService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("secureScoreName") String secureScoreName, - @HeaderParam("Accept") String accept, + Mono> get(@HostParam("$host") 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"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context 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 along with {@link PagedResponse} on successful completion of {@link Mono}. @@ -100,39 +97,26 @@ Mono> listNext( @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)) + .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. @@ -142,36 +126,24 @@ private Mono> listSinglePageAsync() { @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)); + 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}. @@ -183,7 +155,7 @@ private PagedFlux 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. @@ -192,13 +164,13 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, 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}. @@ -210,7 +182,7 @@ public 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 ManagementException thrown if the request is rejected by server. @@ -225,28 +197,24 @@ public PagedIterable list(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. + * 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}. + * {@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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (secureScoreName == null) { return Mono @@ -255,45 +223,33 @@ private Mono> getWithResponseAsync(String secureS 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)) + .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. + * 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}. + * {@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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (secureScoreName == null) { return Mono @@ -302,27 +258,21 @@ private Mono> getWithResponseAsync(String secureS 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); + 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. + * 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}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String secureScoreName) { @@ -332,15 +282,15 @@ private Mono getAsync(String secureScoreName) { /** * 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. + * 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}. + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String secureScoreName, Context context) { @@ -350,9 +300,9 @@ public Response getWithResponse(String secureScoreName, Co /** * 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. + * 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. @@ -365,9 +315,10 @@ public SecureScoreItemInner get(String secureScoreName) { /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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. @@ -379,31 +330,22 @@ private Mono> listNextSinglePageAsync(String 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -416,23 +358,13 @@ private Mono> listNextSinglePageAsync(String 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.")); + 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)); + 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 index 2f6dbe759c03c..4f0ab3083a89d 100644 --- 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 @@ -21,29 +21,26 @@ public final class SecureScoresImpl implements SecureScores { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public SecureScoresImpl( - SecureScoresClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + public SecureScoresImpl(SecureScoresClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new SecureScoreItemImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecureScoreItemImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new SecureScoreItemImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecureScoreItemImpl(inner1, this.manager())); } public Response getWithResponse(String secureScoreName, Context context) { Response inner = this.serviceClient().getWithResponse(secureScoreName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SecureScoreItemImpl(inner.getValue(), this.manager())); } else { return null; 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 index 7455b39d5a297..7dfffc78186b5 100644 --- 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 @@ -26,8 +26,7 @@ public final class SecurityAssessmentMetadataResponseImpl private final com.azure.resourcemanager.security.SecurityManager serviceManager; - SecurityAssessmentMetadataResponseImpl( - SecurityAssessmentMetadataResponseInner innerObject, + SecurityAssessmentMetadataResponseImpl(SecurityAssessmentMetadataResponseInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -140,54 +139,38 @@ private com.azure.resourcemanager.security.SecurityManager manager() { private String assessmentMetadataName; public SecurityAssessmentMetadataResponse create() { - this.innerObject = - serviceManager - .serviceClient() - .getAssessmentsMetadatas() - .createInSubscriptionWithResponse(assessmentMetadataName, this.innerModel(), Context.NONE) - .getValue(); + 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(); + this.innerObject = serviceManager.serviceClient().getAssessmentsMetadatas() + .createInSubscriptionWithResponse(assessmentMetadataName, this.innerModel(), context).getValue(); return this; } - SecurityAssessmentMetadataResponseImpl( - String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { + 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(); + 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(); + this.innerObject = serviceManager.serviceClient().getAssessmentsMetadatas() + .getInSubscriptionWithResponse(assessmentMetadataName, context).getValue(); return this; } - public SecurityAssessmentMetadataResponseImpl withPublishDates( - SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates) { + public SecurityAssessmentMetadataResponseImpl + withPublishDates(SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates) { this.innerModel().withPublishDates(publishDates); 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 index b589cb09daae9..4be437fd92c37 100644 --- 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 @@ -91,22 +91,14 @@ public SecurityAssessmentResponseImpl withExistingResourceId(String resourceId) } public SecurityAssessmentResponse create() { - this.innerObject = - serviceManager - .serviceClient() - .getAssessments() - .createOrUpdateWithResponse(resourceId, assessmentName, createAssessment, Context.NONE) - .getValue(); + 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(); + this.innerObject = serviceManager.serviceClient().getAssessments() + .createOrUpdateWithResponse(resourceId, assessmentName, createAssessment, context).getValue(); return this; } @@ -123,63 +115,38 @@ public SecurityAssessmentResponseImpl update() { } public SecurityAssessmentResponse apply() { - this.innerObject = - serviceManager - .serviceClient() - .getAssessments() - .createOrUpdateWithResponse(resourceId, assessmentName, updateAssessment, Context.NONE) - .getValue(); + 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(); + this.innerObject = serviceManager.serviceClient().getAssessments() + .createOrUpdateWithResponse(resourceId, assessmentName, updateAssessment, context).getValue(); return this; } - SecurityAssessmentResponseImpl( - SecurityAssessmentResponseInner innerObject, + SecurityAssessmentResponseImpl(SecurityAssessmentResponseInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceId = - Utils - .getValueFromIdByParameterName( - innerObject.id(), - "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", - "resourceId"); - this.assessmentName = - Utils - .getValueFromIdByParameterName( - innerObject.id(), - "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", - "assessmentName"); + 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(); + 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(); + this.innerObject = serviceManager.serviceClient().getAssessments() + .getWithResponse(resourceId, assessmentName, localExpand, context).getValue(); return this; } 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 index ff42af6d88d65..ab8c0a8b8fde8 100644 --- 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 @@ -14,8 +14,10 @@ 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}) +/** + * A builder for creating a new instance of the SecurityCenterImpl type. + */ +@ServiceClientBuilder(serviceClients = { SecurityCenterImpl.class }) public final class SecurityCenterBuilder { /* * Azure subscription ID @@ -24,7 +26,7 @@ public final class SecurityCenterBuilder { /** * Sets Azure subscription ID. - * + * * @param subscriptionId the subscriptionId value. * @return the SecurityCenterBuilder. */ @@ -40,7 +42,7 @@ public SecurityCenterBuilder subscriptionId(String subscriptionId) { /** * Sets server parameter. - * + * * @param endpoint the endpoint value. * @return the SecurityCenterBuilder. */ @@ -56,7 +58,7 @@ public SecurityCenterBuilder endpoint(String endpoint) { /** * Sets The environment to connect to. - * + * * @param environment the environment value. * @return the SecurityCenterBuilder. */ @@ -72,7 +74,7 @@ public SecurityCenterBuilder environment(AzureEnvironment environment) { /** * Sets The HTTP pipeline to send requests through. - * + * * @param pipeline the pipeline value. * @return the SecurityCenterBuilder. */ @@ -88,7 +90,7 @@ public SecurityCenterBuilder pipeline(HttpPipeline pipeline) { /** * Sets The default poll interval for long-running operation. - * + * * @param defaultPollInterval the defaultPollInterval value. * @return the SecurityCenterBuilder. */ @@ -104,7 +106,7 @@ public SecurityCenterBuilder defaultPollInterval(Duration defaultPollInterval) { /** * Sets The serializer to serialize an object into a string. - * + * * @param serializerAdapter the serializerAdapter value. * @return the SecurityCenterBuilder. */ @@ -115,30 +117,20 @@ public SecurityCenterBuilder serializerAdapter(SerializerAdapter serializerAdapt /** * 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, - subscriptionId, - localEndpoint); + 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, this.subscriptionId, localEndpoint); 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 index 2f43f2f9a5532..a8fd13d165657 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java @@ -28,8 +28,6 @@ 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.ApiCollectionOffboardingsClient; -import com.azure.resourcemanager.security.fluent.ApiCollectionOnboardingsClient; import com.azure.resourcemanager.security.fluent.ApiCollectionsClient; import com.azure.resourcemanager.security.fluent.ApplicationOperationsClient; import com.azure.resourcemanager.security.fluent.ApplicationsClient; @@ -37,20 +35,29 @@ import com.azure.resourcemanager.security.fluent.AssessmentsMetadatasClient; 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.ConnectorsClient; import com.azure.resourcemanager.security.fluent.CustomAssessmentAutomationsClient; import com.azure.resourcemanager.security.fluent.CustomEntityStoreAssignmentsClient; +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.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.HealthReportOperationsClient; import com.azure.resourcemanager.security.fluent.HealthReportsClient; import com.azure.resourcemanager.security.fluent.InformationProtectionPoliciesClient; -import com.azure.resourcemanager.security.fluent.IngestionSettingsClient; import com.azure.resourcemanager.security.fluent.IotSecuritySolutionAnalyticsClient; import com.azure.resourcemanager.security.fluent.IotSecuritySolutionsAnalyticsAggregatedAlertsClient; import com.azure.resourcemanager.security.fluent.IotSecuritySolutionsAnalyticsRecommendationsClient; @@ -63,6 +70,7 @@ 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.ResourceProvidersClient; import com.azure.resourcemanager.security.fluent.SecureScoreControlDefinitionsClient; import com.azure.resourcemanager.security.fluent.SecureScoreControlsClient; import com.azure.resourcemanager.security.fluent.SecureScoresClient; @@ -74,7 +82,9 @@ 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.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.SoftwareInventoriesClient; import com.azure.resourcemanager.security.fluent.SqlVulnerabilityAssessmentBaselineRulesClient; @@ -93,804 +103,1078 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** Initializes a new instance of the SecurityCenterImpl type. */ +/** + * Initializes a new instance of the SecurityCenterImpl type. + */ @ServiceClient(builder = SecurityCenterBuilder.class) public final class SecurityCenterImpl implements SecurityCenter { - /** Azure subscription ID. */ + /** + * Azure subscription ID. + */ private final String subscriptionId; /** * Gets Azure subscription ID. - * + * * @return the subscriptionId value. */ public String getSubscriptionId() { return this.subscriptionId; } - /** server parameter. */ + /** + * server parameter. + */ private final String endpoint; /** * Gets server parameter. - * + * * @return the endpoint value. */ public String getEndpoint() { return this.endpoint; } - /** The HTTP pipeline to send requests through. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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 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 CustomAssessmentAutomationsClient object to access its operations. */ - private final CustomAssessmentAutomationsClient customAssessmentAutomations; - - /** - * Gets the CustomAssessmentAutomationsClient object to access its operations. - * - * @return the CustomAssessmentAutomationsClient object. - */ - public CustomAssessmentAutomationsClient getCustomAssessmentAutomations() { - return this.customAssessmentAutomations; - } - - /** The CustomEntityStoreAssignmentsClient object to access its operations. */ - private final CustomEntityStoreAssignmentsClient customEntityStoreAssignments; - - /** - * Gets the CustomEntityStoreAssignmentsClient object to access its operations. - * - * @return the CustomEntityStoreAssignmentsClient object. - */ - public CustomEntityStoreAssignmentsClient getCustomEntityStoreAssignments() { - return this.customEntityStoreAssignments; - } - - /** 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 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 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 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 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 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 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. + * The LocationsClient object to access its operations. */ - 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 OperationsClient object to access its operations. */ + /** + * 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 TasksClient object to access its operations. */ + /** + * 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 AutoProvisioningSettingsClient object to access its operations. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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 SecurityContactsClient object to access its operations. */ - private final SecurityContactsClient securityContacts; - /** - * Gets the SecurityContactsClient object to access its operations. - * - * @return the SecurityContactsClient object. + * The WorkspaceSettingsClient object to access its operations. */ - public SecurityContactsClient getSecurityContacts() { - return this.securityContacts; - } - - /** 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 RegulatoryComplianceStandardsClient object to access its operations. */ + /** + * 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 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 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. */ + /** + * 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. */ + /** + * 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 SubAssessmentsClient object to access its operations. */ + /** + * 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; } - /** The AutomationsClient object to access its operations. */ - private final AutomationsClient automations; + /** + * The ConnectorsClient object to access its operations. + */ + private final ConnectorsClient connectors; /** - * Gets the AutomationsClient object to access its operations. - * - * @return the AutomationsClient object. + * Gets the ConnectorsClient object to access its operations. + * + * @return the ConnectorsClient object. */ - public AutomationsClient getAutomations() { - return this.automations; + public ConnectorsClient getConnectors() { + return this.connectors; } - /** The AlertsSuppressionRulesClient object to access its operations. */ - private final AlertsSuppressionRulesClient alertsSuppressionRules; + /** + * The SecurityContactsClient object to access its operations. + */ + private final SecurityContactsClient securityContacts; /** - * Gets the AlertsSuppressionRulesClient object to access its operations. - * - * @return the AlertsSuppressionRulesClient object. + * Gets the SecurityContactsClient object to access its operations. + * + * @return the SecurityContactsClient object. */ - public AlertsSuppressionRulesClient getAlertsSuppressionRules() { - return this.alertsSuppressionRules; + public SecurityContactsClient getSecurityContacts() { + return this.securityContacts; } - /** The ServerVulnerabilityAssessmentsClient object to access its operations. */ - private final ServerVulnerabilityAssessmentsClient serverVulnerabilityAssessments; + /** + * The SoftwareInventoriesClient object to access its operations. + */ + private final SoftwareInventoriesClient softwareInventories; /** - * Gets the ServerVulnerabilityAssessmentsClient object to access its operations. - * - * @return the ServerVulnerabilityAssessmentsClient object. + * Gets the SoftwareInventoriesClient object to access its operations. + * + * @return the SoftwareInventoriesClient object. */ - public ServerVulnerabilityAssessmentsClient getServerVulnerabilityAssessments() { - return this.serverVulnerabilityAssessments; + public SoftwareInventoriesClient getSoftwareInventories() { + return this.softwareInventories; } - /** The AssessmentsMetadatasClient object to access its operations. */ - private final AssessmentsMetadatasClient assessmentsMetadatas; + /** + * The CustomAssessmentAutomationsClient object to access its operations. + */ + private final CustomAssessmentAutomationsClient customAssessmentAutomations; /** - * Gets the AssessmentsMetadatasClient object to access its operations. - * - * @return the AssessmentsMetadatasClient object. + * Gets the CustomAssessmentAutomationsClient object to access its operations. + * + * @return the CustomAssessmentAutomationsClient object. */ - public AssessmentsMetadatasClient getAssessmentsMetadatas() { - return this.assessmentsMetadatas; + public CustomAssessmentAutomationsClient getCustomAssessmentAutomations() { + return this.customAssessmentAutomations; } - /** The AssessmentsClient object to access its operations. */ - private final AssessmentsClient assessments; + /** + * The CustomEntityStoreAssignmentsClient object to access its operations. + */ + private final CustomEntityStoreAssignmentsClient customEntityStoreAssignments; /** - * Gets the AssessmentsClient object to access its operations. - * - * @return the AssessmentsClient object. + * Gets the CustomEntityStoreAssignmentsClient object to access its operations. + * + * @return the CustomEntityStoreAssignmentsClient object. */ - public AssessmentsClient getAssessments() { - return this.assessments; + public CustomEntityStoreAssignmentsClient getCustomEntityStoreAssignments() { + return this.customEntityStoreAssignments; } - /** The AdaptiveApplicationControlsClient object to access its operations. */ - private final AdaptiveApplicationControlsClient adaptiveApplicationControls; + /** + * The MdeOnboardingsClient object to access its operations. + */ + private final MdeOnboardingsClient mdeOnboardings; /** - * Gets the AdaptiveApplicationControlsClient object to access its operations. - * - * @return the AdaptiveApplicationControlsClient object. + * Gets the MdeOnboardingsClient object to access its operations. + * + * @return the MdeOnboardingsClient object. */ - public AdaptiveApplicationControlsClient getAdaptiveApplicationControls() { - return this.adaptiveApplicationControls; + public MdeOnboardingsClient getMdeOnboardings() { + return this.mdeOnboardings; } - /** The AdaptiveNetworkHardeningsClient object to access its operations. */ - private final AdaptiveNetworkHardeningsClient adaptiveNetworkHardenings; + /** + * The GovernanceAssignmentsClient object to access its operations. + */ + private final GovernanceAssignmentsClient governanceAssignments; /** - * Gets the AdaptiveNetworkHardeningsClient object to access its operations. - * - * @return the AdaptiveNetworkHardeningsClient object. + * Gets the GovernanceAssignmentsClient object to access its operations. + * + * @return the GovernanceAssignmentsClient object. */ - public AdaptiveNetworkHardeningsClient getAdaptiveNetworkHardenings() { - return this.adaptiveNetworkHardenings; + public GovernanceAssignmentsClient getGovernanceAssignments() { + return this.governanceAssignments; } - /** The AllowedConnectionsClient object to access its operations. */ - private final AllowedConnectionsClient allowedConnections; - /** - * Gets the AllowedConnectionsClient object to access its operations. - * - * @return the AllowedConnectionsClient object. + * The GovernanceRulesClient object to access its operations. */ - public AllowedConnectionsClient getAllowedConnections() { - return this.allowedConnections; + private final GovernanceRulesClient governanceRules; + + /** + * Gets the GovernanceRulesClient object to access its operations. + * + * @return the GovernanceRulesClient object. + */ + public GovernanceRulesClient getGovernanceRules() { + return this.governanceRules; } - /** The TopologiesClient object to access its operations. */ - private final TopologiesClient topologies; + /** + * The ApplicationsClient object to access its operations. + */ + private final ApplicationsClient applications; /** - * Gets the TopologiesClient object to access its operations. - * - * @return the TopologiesClient object. + * Gets the ApplicationsClient object to access its operations. + * + * @return the ApplicationsClient object. */ - public TopologiesClient getTopologies() { - return this.topologies; + public ApplicationsClient getApplications() { + return this.applications; } - /** The JitNetworkAccessPoliciesClient object to access its operations. */ - private final JitNetworkAccessPoliciesClient jitNetworkAccessPolicies; + /** + * The ApplicationOperationsClient object to access its operations. + */ + private final ApplicationOperationsClient applicationOperations; /** - * Gets the JitNetworkAccessPoliciesClient object to access its operations. - * - * @return the JitNetworkAccessPoliciesClient object. + * Gets the ApplicationOperationsClient object to access its operations. + * + * @return the ApplicationOperationsClient object. */ - public JitNetworkAccessPoliciesClient getJitNetworkAccessPolicies() { - return this.jitNetworkAccessPolicies; + public ApplicationOperationsClient getApplicationOperations() { + return this.applicationOperations; } - /** The DiscoveredSecuritySolutionsClient object to access its operations. */ - private final DiscoveredSecuritySolutionsClient discoveredSecuritySolutions; + /** + * The SecurityConnectorApplicationsClient object to access its operations. + */ + private final SecurityConnectorApplicationsClient securityConnectorApplications; /** - * Gets the DiscoveredSecuritySolutionsClient object to access its operations. - * - * @return the DiscoveredSecuritySolutionsClient object. + * Gets the SecurityConnectorApplicationsClient object to access its operations. + * + * @return the SecurityConnectorApplicationsClient object. */ - public DiscoveredSecuritySolutionsClient getDiscoveredSecuritySolutions() { - return this.discoveredSecuritySolutions; + public SecurityConnectorApplicationsClient getSecurityConnectorApplications() { + return this.securityConnectorApplications; } - /** The SecuritySolutionsReferenceDatasClient object to access its operations. */ - private final SecuritySolutionsReferenceDatasClient securitySolutionsReferenceDatas; + /** + * The SecurityConnectorApplicationOperationsClient object to access its operations. + */ + private final SecurityConnectorApplicationOperationsClient securityConnectorApplicationOperations; /** - * Gets the SecuritySolutionsReferenceDatasClient object to access its operations. - * - * @return the SecuritySolutionsReferenceDatasClient object. + * Gets the SecurityConnectorApplicationOperationsClient object to access its operations. + * + * @return the SecurityConnectorApplicationOperationsClient object. */ - public SecuritySolutionsReferenceDatasClient getSecuritySolutionsReferenceDatas() { - return this.securitySolutionsReferenceDatas; + public SecurityConnectorApplicationOperationsClient getSecurityConnectorApplicationOperations() { + return this.securityConnectorApplicationOperations; + } + + /** + * 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 AdaptiveNetworkHardeningsClient object to access its operations. + */ + private final AdaptiveNetworkHardeningsClient adaptiveNetworkHardenings; + + /** + * Gets the AdaptiveNetworkHardeningsClient object to access its operations. + * + * @return the AdaptiveNetworkHardeningsClient object. + */ + public AdaptiveNetworkHardeningsClient getAdaptiveNetworkHardenings() { + return this.adaptiveNetworkHardenings; + } + + /** + * 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 AdaptiveApplicationControlsClient object to access its operations. + */ + private final AdaptiveApplicationControlsClient adaptiveApplicationControls; + + /** + * Gets the AdaptiveApplicationControlsClient object to access its operations. + * + * @return the AdaptiveApplicationControlsClient object. + */ + public AdaptiveApplicationControlsClient getAdaptiveApplicationControls() { + return this.adaptiveApplicationControls; + } + + /** + * 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. */ + /** + * 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 SecureScoresClient object to access its operations. */ + /** + * 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 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. */ + /** + * 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. */ + /** + * 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 SecuritySolutionsClient object to access its operations. */ + /** + * 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 ConnectorsClient object to access its operations. */ - private final ConnectorsClient connectors; - - /** - * Gets the ConnectorsClient object to access its operations. - * - * @return the ConnectorsClient object. - */ - public ConnectorsClient getConnectors() { - return this.connectors; - } - - /** The AlertsClient object to access its operations. */ - private final AlertsClient alerts; - /** - * Gets the AlertsClient object to access its operations. - * - * @return the AlertsClient object. + * The SecuritySolutionsReferenceDatasClient object to access its operations. */ - public AlertsClient getAlerts() { - return this.alerts; - } - - /** The SettingsClient object to access its operations. */ - private final SettingsClient settings; + private final SecuritySolutionsReferenceDatasClient securitySolutionsReferenceDatas; /** - * Gets the SettingsClient object to access its operations. - * - * @return the SettingsClient object. + * Gets the SecuritySolutionsReferenceDatasClient object to access its operations. + * + * @return the SecuritySolutionsReferenceDatasClient object. */ - public SettingsClient getSettings() { - return this.settings; + public SecuritySolutionsReferenceDatasClient getSecuritySolutionsReferenceDatas() { + return this.securitySolutionsReferenceDatas; } - /** The IngestionSettingsClient object to access its operations. */ - private final IngestionSettingsClient ingestionSettings; - /** - * Gets the IngestionSettingsClient object to access its operations. - * - * @return the IngestionSettingsClient object. + * The ServerVulnerabilityAssessmentsClient object to access its operations. */ - public IngestionSettingsClient getIngestionSettings() { - return this.ingestionSettings; - } - - /** The SoftwareInventoriesClient object to access its operations. */ - private final SoftwareInventoriesClient softwareInventories; + private final ServerVulnerabilityAssessmentsClient serverVulnerabilityAssessments; /** - * Gets the SoftwareInventoriesClient object to access its operations. - * - * @return the SoftwareInventoriesClient object. + * Gets the ServerVulnerabilityAssessmentsClient object to access its operations. + * + * @return the ServerVulnerabilityAssessmentsClient object. */ - public SoftwareInventoriesClient getSoftwareInventories() { - return this.softwareInventories; + public ServerVulnerabilityAssessmentsClient getServerVulnerabilityAssessments() { + return this.serverVulnerabilityAssessments; } - /** The GovernanceRulesClient object to access its operations. */ - private final GovernanceRulesClient governanceRules; - /** - * Gets the GovernanceRulesClient object to access its operations. - * - * @return the GovernanceRulesClient object. + * The TopologiesClient object to access its operations. */ - public GovernanceRulesClient getGovernanceRules() { - return this.governanceRules; - } - - /** The GovernanceAssignmentsClient object to access its operations. */ - private final GovernanceAssignmentsClient governanceAssignments; + private final TopologiesClient topologies; /** - * Gets the GovernanceAssignmentsClient object to access its operations. - * - * @return the GovernanceAssignmentsClient object. + * Gets the TopologiesClient object to access its operations. + * + * @return the TopologiesClient object. */ - public GovernanceAssignmentsClient getGovernanceAssignments() { - return this.governanceAssignments; + public TopologiesClient getTopologies() { + return this.topologies; } - /** The ApplicationsClient object to access its operations. */ - private final ApplicationsClient applications; - /** - * Gets the ApplicationsClient object to access its operations. - * - * @return the ApplicationsClient object. + * The AssessmentsMetadatasClient object to access its operations. */ - public ApplicationsClient getApplications() { - return this.applications; - } - - /** The ApplicationOperationsClient object to access its operations. */ - private final ApplicationOperationsClient applicationOperations; + private final AssessmentsMetadatasClient assessmentsMetadatas; /** - * Gets the ApplicationOperationsClient object to access its operations. - * - * @return the ApplicationOperationsClient object. + * Gets the AssessmentsMetadatasClient object to access its operations. + * + * @return the AssessmentsMetadatasClient object. */ - public ApplicationOperationsClient getApplicationOperations() { - return this.applicationOperations; + public AssessmentsMetadatasClient getAssessmentsMetadatas() { + return this.assessmentsMetadatas; } - /** The SecurityConnectorApplicationsClient object to access its operations. */ - private final SecurityConnectorApplicationsClient securityConnectorApplications; - /** - * Gets the SecurityConnectorApplicationsClient object to access its operations. - * - * @return the SecurityConnectorApplicationsClient object. + * The AssessmentsClient object to access its operations. */ - public SecurityConnectorApplicationsClient getSecurityConnectorApplications() { - return this.securityConnectorApplications; - } - - /** The SecurityConnectorApplicationOperationsClient object to access its operations. */ - private final SecurityConnectorApplicationOperationsClient securityConnectorApplicationOperations; + private final AssessmentsClient assessments; /** - * Gets the SecurityConnectorApplicationOperationsClient object to access its operations. - * - * @return the SecurityConnectorApplicationOperationsClient object. + * Gets the AssessmentsClient object to access its operations. + * + * @return the AssessmentsClient object. */ - public SecurityConnectorApplicationOperationsClient getSecurityConnectorApplicationOperations() { - return this.securityConnectorApplicationOperations; + public AssessmentsClient getAssessments() { + return this.assessments; } - /** The ApiCollectionsClient object to access its operations. */ - private final ApiCollectionsClient apiCollections; - /** - * Gets the ApiCollectionsClient object to access its operations. - * - * @return the ApiCollectionsClient object. + * The AlertsClient object to access its operations. */ - public ApiCollectionsClient getApiCollections() { - return this.apiCollections; - } - - /** The ApiCollectionOnboardingsClient object to access its operations. */ - private final ApiCollectionOnboardingsClient apiCollectionOnboardings; + private final AlertsClient alerts; /** - * Gets the ApiCollectionOnboardingsClient object to access its operations. - * - * @return the ApiCollectionOnboardingsClient object. + * Gets the AlertsClient object to access its operations. + * + * @return the AlertsClient object. */ - public ApiCollectionOnboardingsClient getApiCollectionOnboardings() { - return this.apiCollectionOnboardings; + public AlertsClient getAlerts() { + return this.alerts; } - /** The ApiCollectionOffboardingsClient object to access its operations. */ - private final ApiCollectionOffboardingsClient apiCollectionOffboardings; - /** - * Gets the ApiCollectionOffboardingsClient object to access its operations. - * - * @return the ApiCollectionOffboardingsClient object. + * The SettingsClient object to access its operations. */ - public ApiCollectionOffboardingsClient getApiCollectionOffboardings() { - return this.apiCollectionOffboardings; - } - - /** The HealthReportsClient object to access its operations. */ - private final HealthReportsClient healthReports; + private final SettingsClient settings; /** - * Gets the HealthReportsClient object to access its operations. - * - * @return the HealthReportsClient object. + * Gets the SettingsClient object to access its operations. + * + * @return the SettingsClient object. */ - public HealthReportsClient getHealthReports() { - return this.healthReports; + public SettingsClient getSettings() { + return this.settings; } - /** The HealthReportOperationsClient object to access its operations. */ - private final HealthReportOperationsClient healthReportOperations; - /** - * Gets the HealthReportOperationsClient object to access its operations. - * - * @return the HealthReportOperationsClient object. + * The ServerVulnerabilityAssessmentsSettingsClient object to access its operations. */ - public HealthReportOperationsClient getHealthReportOperations() { - return this.healthReportOperations; - } - - /** The SqlVulnerabilityAssessmentScansClient object to access its operations. */ - private final SqlVulnerabilityAssessmentScansClient sqlVulnerabilityAssessmentScans; + private final ServerVulnerabilityAssessmentsSettingsClient serverVulnerabilityAssessmentsSettings; /** - * Gets the SqlVulnerabilityAssessmentScansClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentScansClient object. + * Gets the ServerVulnerabilityAssessmentsSettingsClient object to access its operations. + * + * @return the ServerVulnerabilityAssessmentsSettingsClient object. */ - public SqlVulnerabilityAssessmentScansClient getSqlVulnerabilityAssessmentScans() { - return this.sqlVulnerabilityAssessmentScans; + public ServerVulnerabilityAssessmentsSettingsClient getServerVulnerabilityAssessmentsSettings() { + return this.serverVulnerabilityAssessmentsSettings; } - /** The SqlVulnerabilityAssessmentScanResultsClient object to access its operations. */ - private final SqlVulnerabilityAssessmentScanResultsClient sqlVulnerabilityAssessmentScanResults; - /** - * Gets the SqlVulnerabilityAssessmentScanResultsClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentScanResultsClient object. + * The ApiCollectionsClient object to access its operations. */ - public SqlVulnerabilityAssessmentScanResultsClient getSqlVulnerabilityAssessmentScanResults() { - return this.sqlVulnerabilityAssessmentScanResults; - } - - /** The SqlVulnerabilityAssessmentBaselineRulesClient object to access its operations. */ - private final SqlVulnerabilityAssessmentBaselineRulesClient sqlVulnerabilityAssessmentBaselineRules; + private final ApiCollectionsClient apiCollections; /** - * Gets the SqlVulnerabilityAssessmentBaselineRulesClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentBaselineRulesClient object. + * Gets the ApiCollectionsClient object to access its operations. + * + * @return the ApiCollectionsClient object. */ - public SqlVulnerabilityAssessmentBaselineRulesClient getSqlVulnerabilityAssessmentBaselineRules() { - return this.sqlVulnerabilityAssessmentBaselineRules; + public ApiCollectionsClient getApiCollections() { + return this.apiCollections; } - /** The SecurityConnectorsClient object to access its operations. */ - private final SecurityConnectorsClient securityConnectors; - /** - * Gets the SecurityConnectorsClient object to access its operations. - * - * @return the SecurityConnectorsClient object. + * The PricingsClient object to access its operations. */ - public SecurityConnectorsClient getSecurityConnectors() { - return this.securityConnectors; - } - - /** The SecurityOperatorsClient object to access its operations. */ - private final SecurityOperatorsClient securityOperators; + private final PricingsClient pricings; /** - * Gets the SecurityOperatorsClient object to access its operations. - * - * @return the SecurityOperatorsClient object. + * Gets the PricingsClient object to access its operations. + * + * @return the PricingsClient object. */ - public SecurityOperatorsClient getSecurityOperators() { - return this.securityOperators; + public PricingsClient getPricings() { + return this.pricings; } /** * 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. @@ -898,86 +1182,91 @@ public SecurityOperatorsClient getSecurityOperators() { * @param subscriptionId Azure subscription ID. * @param endpoint server parameter. */ - SecurityCenterImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { + SecurityCenterImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, + AzureEnvironment environment, String subscriptionId, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.mdeOnboardings = new MdeOnboardingsClientImpl(this); - this.customAssessmentAutomations = new CustomAssessmentAutomationsClientImpl(this); - this.customEntityStoreAssignments = new CustomEntityStoreAssignmentsClientImpl(this); - this.complianceResults = new ComplianceResultsClientImpl(this); - this.pricings = new PricingsClientImpl(this); - this.advancedThreatProtections = new AdvancedThreatProtectionsClientImpl(this); - this.deviceSecurityGroups = new DeviceSecurityGroupsClientImpl(this); - this.iotSecuritySolutions = new IotSecuritySolutionsClientImpl(this); - this.iotSecuritySolutionAnalytics = new IotSecuritySolutionAnalyticsClientImpl(this); - this.iotSecuritySolutionsAnalyticsAggregatedAlerts = - new IotSecuritySolutionsAnalyticsAggregatedAlertsClientImpl(this); - this.iotSecuritySolutionsAnalyticsRecommendations = - new IotSecuritySolutionsAnalyticsRecommendationsClientImpl(this); this.locations = new LocationsClientImpl(this); this.operations = new OperationsClientImpl(this); this.tasks = new TasksClientImpl(this); this.autoProvisioningSettings = new AutoProvisioningSettingsClientImpl(this); this.compliances = new CompliancesClientImpl(this); this.informationProtectionPolicies = new InformationProtectionPoliciesClientImpl(this); - this.securityContacts = new SecurityContactsClientImpl(this); this.workspaceSettings = new WorkspaceSettingsClientImpl(this); + this.alertsSuppressionRules = new AlertsSuppressionRulesClientImpl(this); + this.automations = new AutomationsClientImpl(this); this.regulatoryComplianceStandards = new RegulatoryComplianceStandardsClientImpl(this); this.regulatoryComplianceControls = new RegulatoryComplianceControlsClientImpl(this); this.regulatoryComplianceAssessments = new RegulatoryComplianceAssessmentsClientImpl(this); this.subAssessments = new SubAssessmentsClientImpl(this); - this.automations = new AutomationsClientImpl(this); - this.alertsSuppressionRules = new AlertsSuppressionRulesClientImpl(this); - this.serverVulnerabilityAssessments = new ServerVulnerabilityAssessmentsClientImpl(this); - this.assessmentsMetadatas = new AssessmentsMetadatasClientImpl(this); - this.assessments = new AssessmentsClientImpl(this); - this.adaptiveApplicationControls = new AdaptiveApplicationControlsClientImpl(this); + this.connectors = new ConnectorsClientImpl(this); + this.securityContacts = new SecurityContactsClientImpl(this); + this.softwareInventories = new SoftwareInventoriesClientImpl(this); + this.customAssessmentAutomations = new CustomAssessmentAutomationsClientImpl(this); + this.customEntityStoreAssignments = new CustomEntityStoreAssignmentsClientImpl(this); + this.mdeOnboardings = new MdeOnboardingsClientImpl(this); + this.governanceAssignments = new GovernanceAssignmentsClientImpl(this); + this.governanceRules = new GovernanceRulesClientImpl(this); + this.applications = new ApplicationsClientImpl(this); + this.applicationOperations = new ApplicationOperationsClientImpl(this); + this.securityConnectorApplications = new SecurityConnectorApplicationsClientImpl(this); + this.securityConnectorApplicationOperations = new SecurityConnectorApplicationOperationsClientImpl(this); + this.defenderForStorages = new DefenderForStoragesClientImpl(this); + this.securityOperators = new SecurityOperatorsClientImpl(this); + this.sqlVulnerabilityAssessmentBaselineRules = new SqlVulnerabilityAssessmentBaselineRulesClientImpl(this); + this.sqlVulnerabilityAssessmentScans = new SqlVulnerabilityAssessmentScansClientImpl(this); + this.sqlVulnerabilityAssessmentScanResults = new SqlVulnerabilityAssessmentScanResultsClientImpl(this); + this.resourceProviders = new ResourceProvidersClientImpl(this); + this.sensitivitySettings = new SensitivitySettingsClientImpl(this); + this.healthReports = new HealthReportsClientImpl(this); + this.azureDevOpsOrgs = new AzureDevOpsOrgsClientImpl(this); + this.azureDevOpsProjects = new AzureDevOpsProjectsClientImpl(this); + this.azureDevOpsRepos = new AzureDevOpsReposClientImpl(this); + this.devOpsConfigurations = new DevOpsConfigurationsClientImpl(this); + this.gitHubOwners = new GitHubOwnersClientImpl(this); + this.gitHubRepos = new GitHubReposClientImpl(this); + this.gitLabGroups = new GitLabGroupsClientImpl(this); + this.gitLabSubgroups = new GitLabSubgroupsClientImpl(this); + this.gitLabProjects = new GitLabProjectsClientImpl(this); + this.devOpsOperationResults = new DevOpsOperationResultsClientImpl(this); + this.securityConnectors = new SecurityConnectorsClientImpl(this); + this.complianceResults = new ComplianceResultsClientImpl(this); + this.advancedThreatProtections = new AdvancedThreatProtectionsClientImpl(this); + this.deviceSecurityGroups = new DeviceSecurityGroupsClientImpl(this); + this.iotSecuritySolutionAnalytics = new IotSecuritySolutionAnalyticsClientImpl(this); + this.iotSecuritySolutionsAnalyticsAggregatedAlerts + = new IotSecuritySolutionsAnalyticsAggregatedAlertsClientImpl(this); + this.iotSecuritySolutionsAnalyticsRecommendations + = new IotSecuritySolutionsAnalyticsRecommendationsClientImpl(this); + this.iotSecuritySolutions = new IotSecuritySolutionsClientImpl(this); this.adaptiveNetworkHardenings = new AdaptiveNetworkHardeningsClientImpl(this); this.allowedConnections = new AllowedConnectionsClientImpl(this); - this.topologies = new TopologiesClientImpl(this); - this.jitNetworkAccessPolicies = new JitNetworkAccessPoliciesClientImpl(this); + this.adaptiveApplicationControls = new AdaptiveApplicationControlsClientImpl(this); this.discoveredSecuritySolutions = new DiscoveredSecuritySolutionsClientImpl(this); - this.securitySolutionsReferenceDatas = new SecuritySolutionsReferenceDatasClientImpl(this); this.externalSecuritySolutions = new ExternalSecuritySolutionsClientImpl(this); + this.jitNetworkAccessPolicies = new JitNetworkAccessPoliciesClientImpl(this); this.secureScores = new SecureScoresClientImpl(this); this.secureScoreControls = new SecureScoreControlsClientImpl(this); this.secureScoreControlDefinitions = new SecureScoreControlDefinitionsClientImpl(this); this.securitySolutions = new SecuritySolutionsClientImpl(this); - this.connectors = new ConnectorsClientImpl(this); + this.securitySolutionsReferenceDatas = new SecuritySolutionsReferenceDatasClientImpl(this); + this.serverVulnerabilityAssessments = new ServerVulnerabilityAssessmentsClientImpl(this); + this.topologies = new TopologiesClientImpl(this); + this.assessmentsMetadatas = new AssessmentsMetadatasClientImpl(this); + this.assessments = new AssessmentsClientImpl(this); this.alerts = new AlertsClientImpl(this); this.settings = new SettingsClientImpl(this); - this.ingestionSettings = new IngestionSettingsClientImpl(this); - this.softwareInventories = new SoftwareInventoriesClientImpl(this); - this.governanceRules = new GovernanceRulesClientImpl(this); - this.governanceAssignments = new GovernanceAssignmentsClientImpl(this); - this.applications = new ApplicationsClientImpl(this); - this.applicationOperations = new ApplicationOperationsClientImpl(this); - this.securityConnectorApplications = new SecurityConnectorApplicationsClientImpl(this); - this.securityConnectorApplicationOperations = new SecurityConnectorApplicationOperationsClientImpl(this); + this.serverVulnerabilityAssessmentsSettings = new ServerVulnerabilityAssessmentsSettingsClientImpl(this); this.apiCollections = new ApiCollectionsClientImpl(this); - this.apiCollectionOnboardings = new ApiCollectionOnboardingsClientImpl(this); - this.apiCollectionOffboardings = new ApiCollectionOffboardingsClientImpl(this); - this.healthReports = new HealthReportsClientImpl(this); - this.healthReportOperations = new HealthReportOperationsClientImpl(this); - this.sqlVulnerabilityAssessmentScans = new SqlVulnerabilityAssessmentScansClientImpl(this); - this.sqlVulnerabilityAssessmentScanResults = new SqlVulnerabilityAssessmentScanResultsClientImpl(this); - this.sqlVulnerabilityAssessmentBaselineRules = new SqlVulnerabilityAssessmentBaselineRulesClientImpl(this); - this.securityConnectors = new SecurityConnectorsClientImpl(this); - this.securityOperators = new SecurityOperatorsClientImpl(this); + this.pricings = new PricingsClientImpl(this); } /** * Gets default client context. - * + * * @return the default client context. */ public Context getContext() { @@ -986,7 +1275,7 @@ public Context getContext() { /** * Merges default client context with provided context. - * + * * @param context the context to be merged with default client context. * @return the merged context. */ @@ -996,7 +1285,7 @@ public Context mergeContext(Context context) { /** * Gets long running operation result. - * + * * @param activationResponse the response of activation operation. * @param httpPipeline the http pipeline. * @param pollResultType type of poll result. @@ -1006,26 +1295,15 @@ public Context mergeContext(Context context) { * @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); + 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. @@ -1038,19 +1316,16 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, HttpResponse errorResponse = null; PollResult.Error lroError = response.getValue().getError(); if (lroError != null) { - errorResponse = - new HttpResponseImpl( - lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + 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); + managementError = this.getSerializerAdapter().deserialize(errorBody, ManagementError.class, + SerializerEncoding.JSON); if (managementError.getCode() == null || managementError.getMessage() == null) { managementError = null; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationOperationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationOperationsClientImpl.java index 8cf5297de0747..1cb19d0395135 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationOperationsClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationOperationsClientImpl.java @@ -34,24 +34,24 @@ */ public final class SecurityConnectorApplicationOperationsClientImpl implements SecurityConnectorApplicationOperationsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final SecurityConnectorApplicationOperationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityCenterImpl client; /** * Initializes an instance of SecurityConnectorApplicationOperationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ SecurityConnectorApplicationOperationsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - SecurityConnectorApplicationOperationsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); + this.service = RestProxy.create(SecurityConnectorApplicationOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -62,79 +62,62 @@ public final class SecurityConnectorApplicationOperationsClientImpl @Host("{$host}") @ServiceInterface(name = "SecurityCenterSecuri") public interface SecurityConnectorApplicationOperationsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId}") - @ExpectedResponses({200}) + @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("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("$host") 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); + @PathParam("applicationId") String applicationId, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("securityConnectorName") String securityConnectorName, @PathParam("applicationId") String applicationId, - @BodyParam("application/json") ApplicationInner application, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") ApplicationInner application, @HeaderParam("Accept") String accept, 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}) + @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("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") 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); + @PathParam("applicationId") String applicationId, Context context); } /** * Get a specific application for the requested scope by applicationId. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String securityConnectorName, String applicationId) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -150,26 +133,16 @@ private Mono> getWithResponseAsync( 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)) + .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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -177,22 +150,18 @@ private Mono> getWithResponseAsync( * @throws ManagementException 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}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String securityConnectorName, String applicationId, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -208,23 +177,15 @@ private Mono> getWithResponseAsync( 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); + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -233,17 +194,17 @@ private Mono> getWithResponseAsync( * @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) { + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -253,16 +214,16 @@ private Mono getAsync( * @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) { + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -277,32 +238,28 @@ public ApplicationInner get(String resourceGroupName, String securityConnectorNa /** * Creates or update a security Application on the given security connector. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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}. + * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -323,27 +280,17 @@ private Mono> createOrUpdateWithResponseAsync( final String apiVersion = "2022-07-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - applicationId, - application, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, applicationId, application, + accept, 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -351,27 +298,19 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -392,24 +331,15 @@ private Mono> createOrUpdateWithResponseAsync( final String apiVersion = "2022-07-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - applicationId, - application, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, applicationId, application, accept, context); } /** * Creates or update a security Application on the given security connector. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -419,17 +349,17 @@ private Mono> createOrUpdateWithResponseAsync( * @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) { + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -440,22 +370,17 @@ private Mono createOrUpdateAsync( * @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(); + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -465,18 +390,17 @@ public Response createOrUpdateWithResponse( * @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(); + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -485,19 +409,15 @@ public ApplicationInner createOrUpdate( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String securityConnectorName, String applicationId) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -512,25 +432,16 @@ private Mono> deleteWithResponseAsync( } final String apiVersion = "2022-07-01-preview"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - applicationId, - context)) + .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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -540,19 +451,15 @@ private Mono> deleteWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -567,22 +474,15 @@ private Mono> deleteWithResponseAsync( } 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); + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -598,9 +498,9 @@ private Mono deleteAsync(String resourceGroupName, String securityConnecto /** * Delete an Application over a given scope. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -610,16 +510,16 @@ private Mono deleteAsync(String resourceGroupName, String securityConnecto * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String securityConnectorName, String applicationId, Context context) { + 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 within the user's subscription. The name is case - * insensitive. + * 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. diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationOperationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationOperationsImpl.java index 006bf422b7c22..b5d8a48cbf414 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationOperationsImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationOperationsImpl.java @@ -20,22 +20,18 @@ public final class SecurityConnectorApplicationOperationsImpl implements Securit private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public SecurityConnectorApplicationOperationsImpl( - SecurityConnectorApplicationOperationsClient innerClient, + public SecurityConnectorApplicationOperationsImpl(SecurityConnectorApplicationOperationsClient 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); + public Response getWithResponse(String resourceGroupName, String securityConnectorName, + String applicationId, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, securityConnectorName, applicationId, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ApplicationImpl(inner.getValue(), this.manager())); } else { return null; @@ -51,32 +47,22 @@ public Application get(String resourceGroupName, String securityConnectorName, S } } - public Response createOrUpdateWithResponse( - String resourceGroupName, - String securityConnectorName, - String applicationId, - ApplicationInner application, - Context context) { - Response inner = - this - .serviceClient() - .createOrUpdateWithResponse( - resourceGroupName, securityConnectorName, applicationId, application, context); + public Response createOrUpdateWithResponse(String resourceGroupName, String securityConnectorName, + String applicationId, ApplicationInner application, Context context) { + Response inner = this.serviceClient().createOrUpdateWithResponse(resourceGroupName, + securityConnectorName, applicationId, application, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ApplicationImpl(inner.getValue(), this.manager())); } else { return null; } } - public Application createOrUpdate( - String resourceGroupName, String securityConnectorName, String applicationId, ApplicationInner application) { - ApplicationInner inner = - this.serviceClient().createOrUpdate(resourceGroupName, securityConnectorName, applicationId, application); + 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 { @@ -84,11 +70,10 @@ public Application createOrUpdate( } } - public Response deleteWithResponse( - String resourceGroupName, String securityConnectorName, String applicationId, Context context) { - return this - .serviceClient() - .deleteWithResponse(resourceGroupName, securityConnectorName, applicationId, context); + 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) { 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 index 40cd382330cd0..80b9367cdcecb 100644 --- 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 @@ -30,26 +30,28 @@ import com.azure.resourcemanager.security.models.ApplicationsList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in SecurityConnectorApplicationsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final SecurityConnectorApplicationsService service; - /** The service client containing this operation class. */ + /** + * 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.service = RestProxy.create(SecurityConnectorApplicationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -60,57 +62,46 @@ public final class SecurityConnectorApplicationsClientImpl implements SecurityCo @Host("{$host}") @ServiceInterface(name = "SecurityCenterSecuri") public interface SecurityConnectorApplicationsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications") - @ExpectedResponses({200}) + @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("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @HeaderParam("Accept") String accept, + @PathParam("securityConnectorName") String securityConnectorName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Get a list of all relevant applications over a security connector level scope. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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}. + * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -123,56 +114,36 @@ private Mono> listSinglePageAsync( 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)) + .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 within the user's subscription. The name is case - * insensitive. + * 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}. + * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -186,76 +157,61 @@ private Mono> listSinglePageAsync( 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(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 within the user's subscription. The name is case - * insensitive. + * 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}. + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String securityConnectorName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, 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 within the user's subscription. The name is case - * insensitive. + * 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}. + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String securityConnectorName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, securityConnectorName, context), + 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 within the user's subscription. The name is case - * insensitive. + * 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}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String securityConnectorName) { @@ -264,33 +220,34 @@ public PagedIterable list(String resourceGroupName, String sec /** * Get a list of all relevant applications over a security connector level scope. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String securityConnectorName, Context context) { + 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 - *

The nextLink parameter. + * + * The nextLink 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 page of a security applications list along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return page of a security applications list along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -298,37 +255,28 @@ private Mono> listNextSinglePageAsync(String nex 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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 page of a security applications list along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return page of a security applications list along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -336,23 +284,13 @@ private Mono> listNextSinglePageAsync(String nex 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.")); + 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)); + 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 index d8ac67980999a..655888a76d63d 100644 --- 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 @@ -19,8 +19,7 @@ public final class SecurityConnectorApplicationsImpl implements SecurityConnecto private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public SecurityConnectorApplicationsImpl( - SecurityConnectorApplicationsClient innerClient, + public SecurityConnectorApplicationsImpl(SecurityConnectorApplicationsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -28,13 +27,13 @@ public SecurityConnectorApplicationsImpl( public PagedIterable list(String resourceGroupName, String securityConnectorName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, securityConnectorName); - return Utils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().list(resourceGroupName, securityConnectorName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); } private SecurityConnectorApplicationsClient serviceClient() { 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 index 6eaee85d9cac8..78c6586d2743d 100644 --- 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 @@ -107,22 +107,16 @@ public SecurityConnectorImpl withExistingResourceGroup(String resourceGroupName) } public SecurityConnector create() { - this.innerObject = - serviceManager - .serviceClient() - .getSecurityConnectors() - .createOrUpdateWithResponse(resourceGroupName, securityConnectorName, this.innerModel(), Context.NONE) - .getValue(); + 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(); + this.innerObject = serviceManager.serviceClient().getSecurityConnectors() + .createOrUpdateWithResponse(resourceGroupName, securityConnectorName, this.innerModel(), context) + .getValue(); return this; } @@ -137,50 +131,34 @@ public SecurityConnectorImpl update() { } public SecurityConnector apply() { - this.innerObject = - serviceManager - .serviceClient() - .getSecurityConnectors() - .updateWithResponse(resourceGroupName, securityConnectorName, this.innerModel(), Context.NONE) - .getValue(); + 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(); + this.innerObject = serviceManager.serviceClient().getSecurityConnectors() + .updateWithResponse(resourceGroupName, securityConnectorName, this.innerModel(), context).getValue(); return this; } - SecurityConnectorImpl( - SecurityConnectorInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + SecurityConnectorImpl(SecurityConnectorInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.securityConnectorName = Utils.getValueFromIdByName(innerObject.id(), "securityConnectors"); + 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(); + 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(); + this.innerObject = serviceManager.serviceClient().getSecurityConnectors() + .getByResourceGroupWithResponse(resourceGroupName, securityConnectorName, context).getValue(); 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 index 2092e42d6eb4f..14e5f5477b9b8 100644 --- 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 @@ -34,22 +34,28 @@ import com.azure.resourcemanager.security.models.SecurityConnectorsList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in SecurityConnectorsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final SecurityConnectorsService service; - /** The service client containing this operation class. */ + /** + * 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.service = RestProxy.create(SecurityConnectorsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -60,196 +66,143 @@ public final class SecurityConnectorsClientImpl implements SecurityConnectorsCli @Host("{$host}") @ServiceInterface(name = "SecurityCenterSecuri") public interface SecurityConnectorsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityConnectors") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @HeaderParam("Accept") String accept, + Mono> listByResourceGroup(@HostParam("$host") 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.Security/securityConnectors/{securityConnectorName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @HeaderParam("Accept") String accept, + @PathParam("securityConnectorName") String securityConnectorName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("securityConnectorName") String securityConnectorName, @BodyParam("application/json") SecurityConnectorInner securityConnector, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("securityConnectorName") String securityConnectorName, @BodyParam("application/json") SecurityConnectorInner securityConnector, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @HeaderParam("Accept") String accept, + @PathParam("securityConnectorName") String securityConnectorName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, 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 ManagementException thrown 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}. + * @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2023-03-01-preview"; + final String apiVersion = "2023-10-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)) + .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}. + * @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2023-03-01-preview"; + final String apiVersion = "2023-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) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + 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}. @@ -262,7 +215,7 @@ private PagedFlux 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. @@ -271,14 +224,14 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, 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}. @@ -291,7 +244,7 @@ public 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 ManagementException thrown if the request is rejected by server. @@ -306,118 +259,83 @@ public PagedIterable list(Context 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 within the user's subscription. The name is case - * insensitive. + * 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}. + * @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.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-03-01-preview"; + final String apiVersion = "2023-10-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)) + .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 within the user's subscription. The name is case - * insensitive. + * 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}. + * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.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-03-01-preview"; + final String apiVersion = "2023-10-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)); + .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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -425,17 +343,16 @@ private Mono> listByResourceGroupSinglePag */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -444,17 +361,16 @@ private PagedFlux listByResourceGroupAsync(String resour */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -468,9 +384,9 @@ public PagedIterable listByResourceGroup(String resource /** * 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -484,9 +400,9 @@ public PagedIterable listByResourceGroup(String resource /** * Retrieves details of a specific security connector. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -494,19 +410,15 @@ public PagedIterable listByResourceGroup(String resource * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -516,28 +428,19 @@ private Mono> getByResourceGroupWithResponseAsy return Mono .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); } - final String apiVersion = "2023-03-01-preview"; + final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - accept, - context)) + .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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param securityConnectorName The security connector name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -546,19 +449,15 @@ private Mono> getByResourceGroupWithResponseAsy * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -568,25 +467,18 @@ private Mono> getByResourceGroupWithResponseAsy return Mono .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); } - final String apiVersion = "2023-03-01-preview"; + final String apiVersion = "2023-10-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); + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -594,17 +486,17 @@ private Mono> getByResourceGroupWithResponseAsy * @return the security connector resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync( - String resourceGroupName, String securityConnectorName) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param securityConnectorName The security connector name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -613,16 +505,16 @@ private Mono getByResourceGroupAsync( * @return the security connector resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String securityConnectorName, Context context) { + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -637,9 +529,9 @@ public SecurityConnectorInner getByResourceGroup(String resourceGroupName, Strin /** * 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param securityConnectorName The security connector name. * @param securityConnector The security connector resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -648,19 +540,15 @@ public SecurityConnectorInner getByResourceGroup(String resourceGroupName, Strin * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -676,30 +564,21 @@ private Mono> createOrUpdateWithResponseAsync( } else { securityConnector.validate(); } - final String apiVersion = "2023-03-01-preview"; + final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - securityConnector, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, securityConnector, accept, + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param securityConnectorName The security connector name. * @param securityConnector The security connector resource. * @param context The context to associate with this operation. @@ -709,22 +588,15 @@ private Mono> createOrUpdateWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -740,27 +612,19 @@ private Mono> createOrUpdateWithResponseAsync( } else { securityConnector.validate(); } - final String apiVersion = "2023-03-01-preview"; + final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - securityConnector, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, securityConnector, accept, 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param securityConnectorName The security connector name. * @param securityConnector The security connector resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -769,8 +633,8 @@ private Mono> createOrUpdateWithResponseAsync( * @return the security connector resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String securityConnectorName, SecurityConnectorInner securityConnector) { + private Mono createOrUpdateAsync(String resourceGroupName, String securityConnectorName, + SecurityConnectorInner securityConnector) { return createOrUpdateWithResponseAsync(resourceGroupName, securityConnectorName, securityConnector) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -778,9 +642,9 @@ private Mono createOrUpdateAsync( /** * 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param securityConnectorName The security connector name. * @param securityConnector The security connector resource. * @param context The context to associate with this operation. @@ -790,11 +654,8 @@ private Mono createOrUpdateAsync( * @return the security connector resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String securityConnectorName, - SecurityConnectorInner securityConnector, - Context context) { + public Response createOrUpdateWithResponse(String resourceGroupName, + String securityConnectorName, SecurityConnectorInner securityConnector, Context context) { return createOrUpdateWithResponseAsync(resourceGroupName, securityConnectorName, securityConnector, context) .block(); } @@ -802,9 +663,9 @@ public Response createOrUpdateWithResponse( /** * 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param securityConnectorName The security connector name. * @param securityConnector The security connector resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -813,17 +674,17 @@ public Response createOrUpdateWithResponse( * @return the security connector resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityConnectorInner createOrUpdate( - String resourceGroupName, String securityConnectorName, SecurityConnectorInner securityConnector) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param securityConnectorName The security connector name. * @param securityConnector The security connector resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -832,19 +693,15 @@ public SecurityConnectorInner createOrUpdate( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -860,29 +717,20 @@ private Mono> updateWithResponseAsync( } else { securityConnector.validate(); } - final String apiVersion = "2023-03-01-preview"; + final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - securityConnector, - accept, - context)) + context -> service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, securityConnectorName, securityConnector, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Updates a security connector. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param securityConnectorName The security connector name. * @param securityConnector The security connector resource. * @param context The context to associate with this operation. @@ -892,22 +740,15 @@ private Mono> updateWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -923,26 +764,18 @@ private Mono> updateWithResponseAsync( } else { securityConnector.validate(); } - final String apiVersion = "2023-03-01-preview"; + final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - securityConnector, - accept, - context); + return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + securityConnectorName, securityConnector, accept, context); } /** * Updates a security connector. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param securityConnectorName The security connector name. * @param securityConnector The security connector resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -951,17 +784,17 @@ private Mono> updateWithResponseAsync( * @return the security connector resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String securityConnectorName, SecurityConnectorInner securityConnector) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param securityConnectorName The security connector name. * @param securityConnector The security connector resource. * @param context The context to associate with this operation. @@ -971,19 +804,16 @@ private Mono updateAsync( * @return the security connector resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String securityConnectorName, - SecurityConnectorInner securityConnector, - Context context) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param securityConnectorName The security connector name. * @param securityConnector The security connector resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -992,16 +822,16 @@ public Response updateWithResponse( * @return the security connector resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityConnectorInner update( - String resourceGroupName, String securityConnectorName, SecurityConnectorInner securityConnector) { + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -1011,16 +841,12 @@ public SecurityConnectorInner update( @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1030,28 +856,19 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); } - final String apiVersion = "2023-03-01-preview"; + final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes a security connector. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param securityConnectorName The security connector name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1060,19 +877,15 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String securityConnectorName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1082,25 +895,18 @@ private Mono> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); } - final String apiVersion = "2023-03-01-preview"; + final String apiVersion = "2023-10-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - accept, - context); + return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + securityConnectorName, accept, context); } /** * Deletes a security connector. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -1114,9 +920,9 @@ private Mono deleteAsync(String resourceGroupName, String securityConnecto /** * Deletes a security connector. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param securityConnectorName The security connector name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1131,9 +937,9 @@ public Response deleteWithResponse(String resourceGroupName, String securi /** * Deletes a security connector. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -1146,14 +952,15 @@ public void delete(String resourceGroupName, String securityConnectorName) { /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 security connectors response along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @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) { @@ -1161,37 +968,28 @@ private Mono> listNextSinglePageAsync(Stri 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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 security connectors response along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @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) { @@ -1199,36 +997,27 @@ private Mono> listNextSinglePageAsync(Stri 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.")); + 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)); + 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 - *

The nextLink parameter. + * + * The nextLink 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 security connectors response along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @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) { @@ -1236,63 +1025,45 @@ private Mono> listByResourceGroupNextSingl 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.")); + 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)) + .>map(res -> new 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 - *

The nextLink parameter. + * + * The nextLink 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 security connectors response along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @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) { + 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.")); + 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)); + 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/SecurityConnectorsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorsImpl.java index 7ca42cfa356d3..f2939bcf75f26 100644 --- 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 @@ -21,42 +21,39 @@ public final class SecurityConnectorsImpl implements SecurityConnectors { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public SecurityConnectorsImpl( - SecurityConnectorsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + public SecurityConnectorsImpl(SecurityConnectorsClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new SecurityConnectorImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityConnectorImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new SecurityConnectorImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityConnectorImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new SecurityConnectorImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new SecurityConnectorImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityConnectorImpl(inner1, this.manager())); } - public Response getByResourceGroupWithResponse( - String resourceGroupName, String securityConnectorName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, securityConnectorName, context); + public Response getByResourceGroupWithResponse(String resourceGroupName, + String securityConnectorName, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, securityConnectorName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SecurityConnectorImpl(inner.getValue(), this.manager())); } else { return null; @@ -64,8 +61,8 @@ public Response getByResourceGroupWithResponse( } public SecurityConnector getByResourceGroup(String resourceGroupName, String securityConnectorName) { - SecurityConnectorInner inner = - this.serviceClient().getByResourceGroup(resourceGroupName, securityConnectorName); + SecurityConnectorInner inner + = this.serviceClient().getByResourceGroup(resourceGroupName, securityConnectorName); if (inner != null) { return new SecurityConnectorImpl(inner, this.manager()); } else { @@ -73,8 +70,8 @@ public SecurityConnector getByResourceGroup(String resourceGroupName, String sec } } - public Response deleteByResourceGroupWithResponse( - String resourceGroupName, String securityConnectorName, Context context) { + public Response deleteByResourceGroupWithResponse(String resourceGroupName, String securityConnectorName, + Context context) { return this.serviceClient().deleteWithResponse(resourceGroupName, securityConnectorName, context); } @@ -83,85 +80,57 @@ public void deleteByResourceGroup(String resourceGroupName, String securityConne } public SecurityConnector getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String securityConnectorName = Utils.getValueFromIdByName(id, "securityConnectors"); + 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))); + 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 = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String securityConnectorName = Utils.getValueFromIdByName(id, "securityConnectors"); + 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))); + 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 = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String securityConnectorName = Utils.getValueFromIdByName(id, "securityConnectors"); + 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))); + 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 = Utils.getValueFromIdByName(id, "resourceGroups"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String securityConnectorName = Utils.getValueFromIdByName(id, "securityConnectors"); + 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))); + 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); } 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 index b2543af8c36e6..2e389dbfbe73e 100644 --- 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 @@ -6,17 +6,20 @@ 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.SecurityContactPropertiesAlertNotifications; +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) { + SecurityContactImpl(SecurityContactInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -41,8 +44,17 @@ public String phone() { return this.innerModel().phone(); } - public SecurityContactPropertiesAlertNotifications alertNotifications() { - return this.innerModel().alertNotifications(); + 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() { @@ -57,51 +69,35 @@ private com.azure.resourcemanager.security.SecurityManager manager() { return this.serviceManager; } - private String securityContactName; + private SecurityContactName securityContactName; public SecurityContact create() { - this.innerObject = - serviceManager - .serviceClient() - .getSecurityContacts() - .createWithResponse(securityContactName, this.innerModel(), Context.NONE) - .getValue(); + 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(); + this.innerObject = serviceManager.serviceClient().getSecurityContacts() + .createWithResponse(securityContactName, this.innerModel(), context).getValue(); return this; } - SecurityContactImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { + 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(); + 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(); + this.innerObject = serviceManager.serviceClient().getSecurityContacts() + .getWithResponse(securityContactName, context).getValue(); return this; } @@ -115,13 +111,18 @@ public SecurityContactImpl withPhone(String phone) { return this; } - public SecurityContactImpl withAlertNotifications(SecurityContactPropertiesAlertNotifications alertNotifications) { - this.innerModel().withAlertNotifications(alertNotifications); + 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) { + 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 index 0e358f62e47a0..ac7a1e1c0e3de 100644 --- 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 @@ -31,24 +31,31 @@ import com.azure.resourcemanager.security.fluent.SecurityContactsClient; import com.azure.resourcemanager.security.fluent.models.SecurityContactInner; import com.azure.resourcemanager.security.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. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final SecurityContactsService service; - /** The service client containing this operation class. */ + /** + * 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.service + = RestProxy.create(SecurityContactsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -59,149 +66,109 @@ public final class SecurityContactsClientImpl implements SecurityContactsClient @Host("{$host}") @ServiceInterface(name = "SecurityCenterSecuri") public interface SecurityContactsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("securityContactName") String securityContactName, - @HeaderParam("Accept") String accept, - Context context); + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("securityContactName") SecurityContactName securityContactName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}") - @ExpectedResponses({200, 201}) + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("securityContactName") String securityContactName, - @BodyParam("application/json") SecurityContactInner securityContact, - @HeaderParam("Accept") String accept, + Mono> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("securityContactName") SecurityContactName securityContactName, + @BodyParam("application/json") SecurityContactInner securityContact, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}") - @ExpectedResponses({200, 204}) + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("securityContactName") String securityContactName, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("securityContactName") SecurityContactName securityContactName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context 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 along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-01-01-preview"; + 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)) + .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}. + * @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-01-01-preview"; + 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)); + 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}. @@ -213,7 +180,7 @@ private PagedFlux 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. @@ -222,13 +189,13 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, 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}. @@ -240,7 +207,7 @@ public 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 ManagementException thrown if the request is rejected by server. @@ -254,93 +221,72 @@ public PagedIterable list(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}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String securityContactName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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 = "2020-01-01-preview"; + 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)) + .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}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String securityContactName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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 = "2020-01-01-preview"; + 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); + 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. @@ -348,13 +294,13 @@ private Mono> getWithResponseAsync(String securit * @return default Security contact configurations for the subscription on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String securityContactName) { + 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. @@ -363,13 +309,13 @@ private Mono getAsync(String securityContactName) { * @return default Security contact configurations for the subscription along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String securityContactName, Context context) { + 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. @@ -377,35 +323,31 @@ public Response getWithResponse(String securityContactName * @return default Security contact configurations for the subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityContactInner get(String securityContactName) { + 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}. + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String securityContactName, SecurityContactInner securityContact) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (securityContactName == null) { return Mono @@ -417,26 +359,17 @@ private Mono> createWithResponseAsync( } else { securityContact.validate(); } - final String apiVersion = "2020-01-01-preview"; + final String apiVersion = "2023-12-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - securityContactName, - securityContact, - accept, - context)) + .withContext(context -> service.create(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), securityContactName, securityContact, accept, 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. @@ -444,22 +377,18 @@ private Mono> createWithResponseAsync( * @throws 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}. + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String securityContactName, SecurityContactInner securityContact, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (securityContactName == null) { return Mono @@ -471,40 +400,34 @@ private Mono> createWithResponseAsync( } else { securityContact.validate(); } - final String apiVersion = "2020-01-01-preview"; + final String apiVersion = "2023-12-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - securityContactName, - securityContact, - accept, - context); + return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + securityContactName, securityContact, accept, 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}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String securityContactName, SecurityContactInner securityContact) { + 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. @@ -512,17 +435,17 @@ private Mono createAsync(String securityContactName, Secur * @throws 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}. + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String securityContactName, SecurityContactInner securityContact, Context context) { + 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. @@ -531,13 +454,13 @@ public Response createWithResponse( * @return contact details and configurations for notifications coming from Microsoft Defender for Cloud. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityContactInner create(String securityContactName, SecurityContactInner securityContact) { + 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. @@ -545,42 +468,30 @@ public SecurityContactInner create(String securityContactName, SecurityContactIn * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String securityContactName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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 = "2020-01-01-preview"; + final String apiVersion = "2023-12-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - securityContactName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), securityContactName, accept, 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. @@ -589,39 +500,29 @@ private Mono> deleteWithResponseAsync(String securityContactName) * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String securityContactName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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 = "2020-01-01-preview"; + final String apiVersion = "2023-12-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - securityContactName, - accept, - context); + return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + securityContactName, accept, 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. @@ -629,13 +530,13 @@ private Mono> deleteWithResponseAsync(String securityContactName, * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String securityContactName) { + 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. @@ -644,33 +545,34 @@ private Mono deleteAsync(String securityContactName) { * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String securityContactName, Context context) { + 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(String securityContactName) { + public void delete(SecurityContactName securityContactName) { deleteWithResponse(securityContactName, Context.NONE); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 security contacts response along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @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) { @@ -678,37 +580,28 @@ private Mono> listNextSinglePageAsync(String 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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 security contacts response along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @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) { @@ -716,23 +609,13 @@ private Mono> listNextSinglePageAsync(String 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.")); + 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)); + 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 index 913f99337779a..c0f936d77aada 100644 --- 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 @@ -12,6 +12,7 @@ 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 { @@ -21,36 +22,33 @@ public final class SecurityContactsImpl implements SecurityContacts { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public SecurityContactsImpl( - SecurityContactsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + public SecurityContactsImpl(SecurityContactsClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new SecurityContactImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityContactImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new SecurityContactImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityContactImpl(inner1, this.manager())); } - public Response getWithResponse(String securityContactName, Context context) { + public Response getWithResponse(SecurityContactName securityContactName, Context context) { Response inner = this.serviceClient().getWithResponse(securityContactName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SecurityContactImpl(inner.getValue(), this.manager())); } else { return null; } } - public SecurityContact get(String securityContactName) { + public SecurityContact get(SecurityContactName securityContactName) { SecurityContactInner inner = this.serviceClient().get(securityContactName); if (inner != null) { return new SecurityContactImpl(inner, this.manager()); @@ -59,63 +57,51 @@ public SecurityContact get(String securityContactName) { } } - public Response deleteWithResponse(String securityContactName, Context context) { + public Response deleteWithResponse(SecurityContactName securityContactName, Context context) { return this.serviceClient().deleteWithResponse(securityContactName, context); } - public void delete(String securityContactName) { + public void delete(SecurityContactName securityContactName) { this.serviceClient().delete(securityContactName); } public SecurityContact getById(String id) { - String securityContactName = Utils.getValueFromIdByName(id, "securityContacts"); - if (securityContactName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'securityContacts'.", 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 securityContactName = Utils.getValueFromIdByName(id, "securityContacts"); - if (securityContactName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'securityContacts'.", 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); } public void deleteById(String id) { - String securityContactName = Utils.getValueFromIdByName(id, "securityContacts"); - if (securityContactName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'securityContacts'.", 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 securityContactName = Utils.getValueFromIdByName(id, "securityContacts"); - if (securityContactName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'securityContacts'.", 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.deleteWithResponse(securityContactName, context); } @@ -127,7 +113,7 @@ private com.azure.resourcemanager.security.SecurityManager manager() { return this.serviceManager; } - public SecurityContactImpl define(String name) { + 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 index 3564896ce8d37..8b47bb0038230 100644 --- 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 @@ -13,8 +13,8 @@ public final class SecurityOperatorImpl implements SecurityOperator { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - SecurityOperatorImpl( - SecurityOperatorInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + SecurityOperatorImpl(SecurityOperatorInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorListImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorListImpl.java index 7298243843b0b..9d6080621094e 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorListImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorListImpl.java @@ -17,8 +17,8 @@ public final class SecurityOperatorListImpl implements SecurityOperatorList { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - SecurityOperatorListImpl( - SecurityOperatorListInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + SecurityOperatorListImpl(SecurityOperatorListInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -26,12 +26,8 @@ public final class SecurityOperatorListImpl implements SecurityOperatorList { public List value() { List inner = this.innerModel().value(); if (inner != null) { - return Collections - .unmodifiableList( - inner - .stream() - .map(inner1 -> new SecurityOperatorImpl(inner1, this.manager())) - .collect(Collectors.toList())); + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new SecurityOperatorImpl(inner1, this.manager())).collect(Collectors.toList())); } else { return Collections.emptyList(); } 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 index cf7c403898ff0..a21e42d065723 100644 --- 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 @@ -28,22 +28,28 @@ import com.azure.resourcemanager.security.fluent.models.SecurityOperatorListInner; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in SecurityOperatorsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final SecurityOperatorsService service; - /** The service client containing this operation class. */ + /** + * 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.service + = RestProxy.create(SecurityOperatorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -54,64 +60,47 @@ public final class SecurityOperatorsClientImpl implements SecurityOperatorsClien @Host("{$host}") @ServiceInterface(name = "SecurityCenterSecuri") public interface SecurityOperatorsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}/securityOperators") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("pricingName") String pricingName, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("pricingName") String pricingName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}/securityOperators/{securityOperatorName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}/securityOperators/{securityOperatorName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("pricingName") String pricingName, - @PathParam("securityOperatorName") String securityOperatorName, - @HeaderParam("Accept") String accept, + @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}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}/securityOperators/{securityOperatorName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("pricingName") String pricingName, - @PathParam("securityOperatorName") String securityOperatorName, - @HeaderParam("Accept") String accept, + @PathParam("securityOperatorName") String securityOperatorName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}/securityOperators/{securityOperatorName}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}/securityOperators/{securityOperatorName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("pricingName") String pricingName, - @PathParam("securityOperatorName") String securityOperatorName, - @HeaderParam("Accept") String accept, + Mono> delete(@HostParam("$host") 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); } /** * 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. @@ -121,16 +110,12 @@ Mono> delete( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync(String pricingName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -138,22 +123,14 @@ private Mono> listWithResponseAsync(String p 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)) + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + pricingName, accept, context)) .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. @@ -164,16 +141,12 @@ private Mono> listWithResponseAsync(String p @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync(String pricingName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -181,13 +154,13 @@ private Mono> listWithResponseAsync(String p 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); + return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), pricingName, accept, + 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. @@ -201,7 +174,7 @@ private Mono listAsync(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. @@ -216,7 +189,7 @@ public Response listWithResponse(String pricingName, /** * 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. @@ -230,29 +203,25 @@ public SecurityOperatorListInner list(String pricingName) { /** * Get a specific security operator for the requested scope. - * + * * @param pricingName name of the pricing configuration. * @param securityOperatorName name of the securityOperator. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String pricingName, String securityOperatorName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -264,23 +233,14 @@ private Mono> getWithResponseAsync( 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)) + .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 securityOperator. * @param context The context to associate with this operation. @@ -288,22 +248,18 @@ private Mono> getWithResponseAsync( * @throws ManagementException 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}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String pricingName, String securityOperatorName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -315,20 +271,13 @@ private Mono> getWithResponseAsync( 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); + 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 securityOperator. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -343,7 +292,7 @@ private Mono getAsync(String pricingName, String security /** * Get a specific security operator for the requested scope. - * + * * @param pricingName name of the pricing configuration. * @param securityOperatorName name of the securityOperator. * @param context The context to associate with this operation. @@ -353,14 +302,14 @@ private Mono getAsync(String pricingName, String security * @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) { + 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 securityOperator. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -375,29 +324,25 @@ public 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 securityOperator. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String pricingName, String securityOperatorName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -409,23 +354,14 @@ private Mono> createOrUpdateWithResponseAsync( 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)) + .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 securityOperator. * @param context The context to associate with this operation. @@ -433,22 +369,18 @@ private Mono> createOrUpdateWithResponseAsync( * @throws 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}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String pricingName, String securityOperatorName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -460,20 +392,13 @@ private Mono> createOrUpdateWithResponseAsync( 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); + 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 securityOperator. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -489,7 +414,7 @@ private Mono createOrUpdateAsync(String pricingName, Stri /** * Creates Microsoft Defender for Cloud security operator on the given scope. - * + * * @param pricingName name of the pricing configuration. * @param securityOperatorName name of the securityOperator. * @param context The context to associate with this operation. @@ -499,14 +424,14 @@ private Mono createOrUpdateAsync(String pricingName, Stri * @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) { + 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 securityOperator. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -521,7 +446,7 @@ public SecurityOperatorInner createOrUpdate(String pricingName, String securityO /** * Delete Microsoft Defender for Cloud securityOperator in the subscription. - * + * * @param pricingName name of the pricing configuration. * @param securityOperatorName name of the securityOperator. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -532,16 +457,12 @@ public SecurityOperatorInner createOrUpdate(String pricingName, String securityO @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -553,23 +474,14 @@ private Mono> deleteWithResponseAsync(String pricingName, String final String apiVersion = "2023-01-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - pricingName, - securityOperatorName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), pricingName, securityOperatorName, accept, 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 securityOperator. * @param context The context to associate with this operation. @@ -579,19 +491,15 @@ private Mono> deleteWithResponseAsync(String pricingName, String * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String pricingName, String securityOperatorName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -603,20 +511,13 @@ private Mono> deleteWithResponseAsync( final String apiVersion = "2023-01-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - pricingName, - securityOperatorName, - accept, - context); + return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), pricingName, + securityOperatorName, accept, context); } /** * Delete Microsoft Defender for Cloud securityOperator in the subscription. - * + * * @param pricingName name of the pricing configuration. * @param securityOperatorName name of the securityOperator. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -631,7 +532,7 @@ private Mono deleteAsync(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 securityOperator. * @param context The context to associate with this operation. @@ -647,7 +548,7 @@ public Response deleteWithResponse(String pricingName, String securityOper /** * Delete Microsoft Defender for Cloud securityOperator in the subscription. - * + * * @param pricingName name of the pricing configuration. * @param securityOperatorName name of the securityOperator. * @throws IllegalArgumentException thrown if parameters fail the validation. 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 index 57bc55c282114..e5d70025bc582 100644 --- 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 @@ -22,8 +22,8 @@ public final class SecurityOperatorsImpl implements SecurityOperators { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public SecurityOperatorsImpl( - SecurityOperatorsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + public SecurityOperatorsImpl(SecurityOperatorsClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -31,10 +31,7 @@ public SecurityOperatorsImpl( public Response listWithResponse(String pricingName, Context context) { Response inner = this.serviceClient().listWithResponse(pricingName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SecurityOperatorListImpl(inner.getValue(), this.manager())); } else { return null; @@ -50,15 +47,12 @@ public SecurityOperatorList list(String pricingName) { } } - public Response getWithResponse( - String pricingName, String securityOperatorName, Context context) { - Response inner = - this.serviceClient().getWithResponse(pricingName, securityOperatorName, context); + public Response getWithResponse(String pricingName, String securityOperatorName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(pricingName, securityOperatorName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SecurityOperatorImpl(inner.getValue(), this.manager())); } else { return null; @@ -74,15 +68,12 @@ public SecurityOperator get(String pricingName, String securityOperatorName) { } } - public Response createOrUpdateWithResponse( - String pricingName, String securityOperatorName, Context context) { - Response inner = - this.serviceClient().createOrUpdateWithResponse(pricingName, securityOperatorName, context); + public Response createOrUpdateWithResponse(String pricingName, String securityOperatorName, + Context context) { + Response inner + = this.serviceClient().createOrUpdateWithResponse(pricingName, securityOperatorName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SecurityOperatorImpl(inner.getValue(), this.manager())); } else { return null; @@ -98,8 +89,8 @@ public SecurityOperator createOrUpdate(String pricingName, String securityOperat } } - public Response deleteByResourceGroupWithResponse( - String pricingName, String securityOperatorName, Context context) { + public Response deleteByResourceGroupWithResponse(String pricingName, String securityOperatorName, + Context context) { return this.serviceClient().deleteWithResponse(pricingName, securityOperatorName, context); } 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 index daa171b42ba68..a62297af1298c 100644 --- 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 @@ -14,8 +14,8 @@ public final class SecuritySolutionImpl implements SecuritySolution { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - SecuritySolutionImpl( - SecuritySolutionInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + SecuritySolutionImpl(SecuritySolutionInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 index 844b5caf9c4c0..5f6beef104c4c 100644 --- 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 @@ -30,22 +30,28 @@ import com.azure.resourcemanager.security.models.SecuritySolutionList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in SecuritySolutionsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final SecuritySolutionsService service; - /** The service client containing this operation class. */ + /** + * 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.service + = RestProxy.create(SecuritySolutionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -56,127 +62,91 @@ public final class SecuritySolutionsClientImpl implements SecuritySolutionsClien @Host("{$host}") @ServiceInterface(name = "SecurityCenterSecuri") public interface SecuritySolutionsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/securitySolutions") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/securitySolutions/{securitySolutionName}") - @ExpectedResponses({200}) + @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("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ascLocation") String ascLocation, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, @PathParam("securitySolutionName") String securitySolutionName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context 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 along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, + accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets 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}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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(), this.client.getSubscriptionId(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, 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}. @@ -188,7 +158,7 @@ private PagedFlux 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. @@ -197,13 +167,13 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, 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}. @@ -215,7 +185,7 @@ public 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 ManagementException thrown if the request is rejected by server. @@ -229,11 +199,11 @@ public PagedIterable list(Context context) { /** * Gets a specific Security Solution. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -241,19 +211,15 @@ public PagedIterable list(Context context) { * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -269,28 +235,18 @@ private Mono> getWithResponseAsync( final String apiVersion = "2020-01-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - securitySolutionName, - apiVersion, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, ascLocation, securitySolutionName, apiVersion, 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param securitySolutionName Name of security solution. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -299,19 +255,15 @@ private Mono> getWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -327,25 +279,17 @@ private Mono> getWithResponseAsync( final String apiVersion = "2020-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - securitySolutionName, - apiVersion, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, ascLocation, + securitySolutionName, apiVersion, accept, context); } /** * Gets a specific Security Solution. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -353,19 +297,19 @@ private Mono> getWithResponseAsync( * @return a specific Security Solution on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String ascLocation, String securitySolutionName) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param securitySolutionName Name of security solution. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -374,18 +318,18 @@ private Mono getAsync( * @return a specific Security Solution along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String ascLocation, String securitySolutionName, Context context) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -399,9 +343,10 @@ public SecuritySolutionInner get(String resourceGroupName, String ascLocation, S /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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. @@ -413,31 +358,22 @@ private Mono> listNextSinglePageAsync(Strin 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -450,23 +386,13 @@ private Mono> listNextSinglePageAsync(Strin 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.")); + 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)); + 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 index de0c90a619d34..d62f6a016422c 100644 --- 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 @@ -21,31 +21,28 @@ public final class SecuritySolutionsImpl implements SecuritySolutions { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public SecuritySolutionsImpl( - SecuritySolutionsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + public SecuritySolutionsImpl(SecuritySolutionsClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new SecuritySolutionImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecuritySolutionImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new SecuritySolutionImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecuritySolutionImpl(inner1, this.manager())); } - public Response getWithResponse( - String resourceGroupName, String ascLocation, String securitySolutionName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, ascLocation, securitySolutionName, context); + public Response getWithResponse(String resourceGroupName, String ascLocation, + String securitySolutionName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, ascLocation, securitySolutionName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SecuritySolutionImpl(inner.getValue(), this.manager())); } else { return null; 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 index 0e961ffe1342e..ba50dde128ad9 100644 --- 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 @@ -15,8 +15,7 @@ public final class SecuritySolutionsReferenceDataListImpl implements SecuritySol private final com.azure.resourcemanager.security.SecurityManager serviceManager; - SecuritySolutionsReferenceDataListImpl( - SecuritySolutionsReferenceDataListInner innerObject, + SecuritySolutionsReferenceDataListImpl(SecuritySolutionsReferenceDataListInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 index 55a07eae1bacf..ac2034e999fa9 100644 --- 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 @@ -25,116 +25,100 @@ 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. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final SecuritySolutionsReferenceDatasService service; - /** The service client containing this operation class. */ + /** + * 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.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. + * The interface defining all the services for SecurityCenterSecuritySolutionsReferenceDatas to be used by the + * proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "SecurityCenterSecuri") public interface SecuritySolutionsReferenceDatasService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/securitySolutionsReferenceData") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/securitySolutionsReferenceData") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/securitySolutionsReferenceData") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegion( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByHomeRegion(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("ascLocation") String ascLocation, + @QueryParam("api-version") String apiVersion, @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}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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(), this.client.getSubscriptionId(), apiVersion, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, + 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}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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"; @@ -144,7 +128,7 @@ private Mono> listWithResponse /** * 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}. @@ -156,7 +140,7 @@ private Mono listAsync() { /** * 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. @@ -170,7 +154,7 @@ public Response listWithResponse(Contex /** * 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. @@ -182,29 +166,25 @@ public 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. + * 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}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionWithResponseAsync( - String ascLocation) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -212,45 +192,33 @@ private Mono> listByHomeRegion final String apiVersion = "2020-01-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByHomeRegion( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - ascLocation, - apiVersion, - accept, - context)) + .withContext(context -> service.listByHomeRegion(this.client.getEndpoint(), this.client.getSubscriptionId(), + ascLocation, apiVersion, 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. + * 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}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionWithResponseAsync( - String ascLocation, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -258,21 +226,20 @@ private Mono> listByHomeRegion final String apiVersion = "2020-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByHomeRegion( - this.client.getEndpoint(), this.client.getSubscriptionId(), ascLocation, apiVersion, accept, context); + return service.listByHomeRegion(this.client.getEndpoint(), this.client.getSubscriptionId(), ascLocation, + apiVersion, 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. + * 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}. + * @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) { @@ -281,9 +248,9 @@ private Mono listByHomeRegionAsync(Stri /** * 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. + * 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. @@ -291,16 +258,16 @@ private Mono listByHomeRegionAsync(Stri * @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) { + 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. + * 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. 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 index f3c696de64ae2..34d947eb2a2dd 100644 --- 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 @@ -20,8 +20,7 @@ public final class SecuritySolutionsReferenceDatasImpl implements SecuritySoluti private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public SecuritySolutionsReferenceDatasImpl( - SecuritySolutionsReferenceDatasClient innerClient, + public SecuritySolutionsReferenceDatasImpl(SecuritySolutionsReferenceDatasClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -30,10 +29,7 @@ public SecuritySolutionsReferenceDatasImpl( public Response listWithResponse(Context context) { Response inner = this.serviceClient().listWithResponse(context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SecuritySolutionsReferenceDataListImpl(inner.getValue(), this.manager())); } else { return null; @@ -49,15 +45,12 @@ public SecuritySolutionsReferenceDataList list() { } } - public Response listByHomeRegionWithResponse( - String ascLocation, Context context) { - Response inner = - this.serviceClient().listByHomeRegionWithResponse(ascLocation, context); + public Response listByHomeRegionWithResponse(String ascLocation, + Context context) { + Response inner + = this.serviceClient().listByHomeRegionWithResponse(ascLocation, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SecuritySolutionsReferenceDataListImpl(inner.getValue(), this.manager())); } else { return null; 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 index 3fb497b072b76..b3497d8c02b1c 100644 --- 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 @@ -16,8 +16,8 @@ public final class SecuritySubAssessmentImpl implements SecuritySubAssessment { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - SecuritySubAssessmentImpl( - SecuritySubAssessmentInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + SecuritySubAssessmentImpl(SecuritySubAssessmentInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 new file mode 100644 index 0000000000000..0a8579a566210 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsClientImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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.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 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("{$host}") + @ServiceInterface(name = "SecurityCenterSensit") + public interface SensitivitySettingsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Security/sensitivitySettings") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context 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 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 new file mode 100644 index 0000000000000..385d882247ae9 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsImpl.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.models.GetSensitivitySettingsListResponse; +import com.azure.resourcemanager.security.models.SensitivitySettings; + +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 listWithResponse(Context context) { + Response inner = this.serviceClient().listWithResponse(context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new GetSensitivitySettingsListResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 index f12420391d629..f3a42ff3a40a9 100644 --- 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 @@ -13,8 +13,7 @@ public final class ServerVulnerabilityAssessmentImpl implements ServerVulnerabil private final com.azure.resourcemanager.security.SecurityManager serviceManager; - ServerVulnerabilityAssessmentImpl( - ServerVulnerabilityAssessmentInner innerObject, + ServerVulnerabilityAssessmentImpl(ServerVulnerabilityAssessmentInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 index b84a55fa6e48c..e27cdff5f0ec9 100644 --- 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 @@ -33,26 +33,28 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ServerVulnerabilityAssessmentsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final ServerVulnerabilityAssessmentsService service; - /** The service client containing this operation class. */ + /** + * 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.service = RestProxy.create(ServerVulnerabilityAssessmentsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -63,102 +65,78 @@ public final class ServerVulnerabilityAssessmentsClientImpl implements ServerVul @Host("{$host}") @ServiceInterface(name = "SecurityCenterServer") public interface ServerVulnerabilityAssessmentsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments") - @ExpectedResponses({200}) + @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("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceNamespace") String resourceNamespace, - @PathParam("resourceType") String resourceType, - @PathParam("resourceName") String resourceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}") - @ExpectedResponses({200}) + @PathParam("resourceNamespace") String resourceNamespace, @PathParam("resourceType") String resourceType, + @PathParam("resourceName") String resourceName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @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("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceNamespace") String resourceNamespace, - @PathParam("resourceType") String resourceType, + @PathParam("resourceNamespace") String resourceNamespace, @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, @PathParam("serverVulnerabilityAssessment") String serverVulnerabilityAssessment, - @QueryParam("api-version") String apiVersion, - @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}) + @QueryParam("api-version") String apiVersion, @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("$host") String endpoint, + Mono> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceNamespace") String resourceNamespace, - @PathParam("resourceType") String resourceType, + @PathParam("resourceNamespace") String resourceNamespace, @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, @PathParam("serverVulnerabilityAssessment") String serverVulnerabilityAssessment, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}") - @ExpectedResponses({200, 202, 204}) + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "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("$host") String endpoint, + Mono>> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceNamespace") String resourceNamespace, - @PathParam("resourceType") String resourceType, + @PathParam("resourceNamespace") String resourceNamespace, @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, @PathParam("serverVulnerabilityAssessment") String serverVulnerabilityAssessment, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); } /** * Gets a list of server vulnerability assessment onboarding statuses on a given resource. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName 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}. + * @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -178,26 +156,16 @@ private Mono> listByExtendedRe final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .listByExtendedResource( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - apiVersion, - accept, - context)) + context -> service.listByExtendedResource(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, resourceNamespace, resourceType, resourceName, apiVersion, 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -205,23 +173,19 @@ private Mono> listByExtendedRe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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}. + * @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -240,24 +204,15 @@ private Mono> listByExtendedRe final String apiVersion = "2020-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByExtendedResource( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - apiVersion, - accept, - context); + return service.listByExtendedResource(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, resourceNamespace, resourceType, resourceName, apiVersion, accept, context); } /** * Gets a list of server vulnerability assessment onboarding statuses on a given resource. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -265,20 +220,20 @@ private Mono> listByExtendedRe * @throws ManagementException thrown if 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}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listByExtendedResourceAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -286,22 +241,21 @@ private Mono listByExtendedResourceAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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}. + * @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(); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -311,18 +265,17 @@ public Response listByExtendedResourceW * @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(); + public ServerVulnerabilityAssessmentsListInner listByExtendedResource(String resourceGroupName, + String resourceNamespace, String resourceType, String resourceName) { + return listByExtendedResourceWithResponse(resourceGroupName, resourceNamespace, resourceType, resourceName, + Context.NONE).getValue(); } /** * Gets a server vulnerability assessment onboarding statuses on a given resource. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -330,22 +283,18 @@ public ServerVulnerabilityAssessmentsListInner listByExtendedResource( * @throws ManagementException 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}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -365,28 +314,17 @@ private Mono> getWithResponseAsync( final String apiVersion = "2020-01-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - serverVulnerabilityAssessment, - apiVersion, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, resourceNamespace, resourceType, resourceName, serverVulnerabilityAssessment, + apiVersion, 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -395,22 +333,18 @@ private Mono> getWithResponseAsync( * @throws ManagementException 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}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -430,25 +364,15 @@ private Mono> getWithResponseAsync( final String apiVersion = "2020-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - serverVulnerabilityAssessment, - apiVersion, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + resourceNamespace, resourceType, resourceName, serverVulnerabilityAssessment, apiVersion, accept, context); } /** * Gets a server vulnerability assessment onboarding statuses on a given resource. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -456,20 +380,20 @@ private Mono> getWithResponseAsync( * @throws ManagementException 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -480,16 +404,16 @@ private Mono getAsync( * @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) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -499,8 +423,8 @@ public Response getWithResponse( * @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) { + public ServerVulnerabilityAssessmentInner get(String resourceGroupName, String resourceNamespace, + String resourceType, String resourceName) { return getWithResponse(resourceGroupName, resourceNamespace, resourceType, resourceName, Context.NONE) .getValue(); } @@ -508,9 +432,9 @@ public ServerVulnerabilityAssessmentInner get( /** * 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -518,22 +442,18 @@ public ServerVulnerabilityAssessmentInner get( * @throws 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}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -553,29 +473,18 @@ private Mono> createOrUpdateWithRes final String apiVersion = "2020-01-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - serverVulnerabilityAssessment, - apiVersion, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, resourceNamespace, resourceType, resourceName, serverVulnerabilityAssessment, + apiVersion, 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -584,22 +493,18 @@ private Mono> createOrUpdateWithRes * @throws 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}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -619,38 +524,28 @@ private Mono> createOrUpdateWithRes final String apiVersion = "2020-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - serverVulnerabilityAssessment, - apiVersion, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + resourceNamespace, resourceType, resourceName, serverVulnerabilityAssessment, apiVersion, 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName 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}. + * @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) { + private Mono createOrUpdateAsync(String resourceGroupName, + String resourceNamespace, String resourceType, String resourceName) { return createOrUpdateWithResponseAsync(resourceGroupName, resourceNamespace, resourceType, resourceName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -658,9 +553,9 @@ private Mono createOrUpdateAsync( /** * 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -671,19 +566,18 @@ private Mono createOrUpdateAsync( * @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(); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -693,18 +587,17 @@ public Response createOrUpdateWithResponse( * @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(); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -714,19 +607,15 @@ public ServerVulnerabilityAssessmentInner createOrUpdate( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -746,28 +635,17 @@ private Mono>> deleteWithResponseAsync( final String apiVersion = "2020-01-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - serverVulnerabilityAssessment, - apiVersion, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, resourceNamespace, resourceType, resourceName, serverVulnerabilityAssessment, + apiVersion, accept, 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -778,19 +656,15 @@ private Mono>> deleteWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -810,25 +684,15 @@ private Mono>> deleteWithResponseAsync( final String apiVersion = "2020-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - serverVulnerabilityAssessment, - apiVersion, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + resourceNamespace, resourceType, resourceName, serverVulnerabilityAssessment, apiVersion, accept, context); } /** * Removing server vulnerability assessment from a resource. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -838,21 +702,19 @@ private Mono>> deleteWithResponseAsync( * @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()); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -863,21 +725,20 @@ private PollerFlux, Void> beginDeleteAsync( * @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) { + 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); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -887,16 +748,16 @@ private PollerFlux, Void> beginDeleteAsync( * @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) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -907,18 +768,17 @@ public SyncPoller, Void> beginDelete( * @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) + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -928,18 +788,17 @@ public SyncPoller, Void> beginDelete( * @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() + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -950,18 +809,17 @@ private Mono deleteAsync( * @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() + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -976,9 +834,9 @@ public void delete(String resourceGroupName, String resourceNamespace, String re /** * Removing server vulnerability assessment from a resource. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -988,8 +846,8 @@ public void delete(String resourceGroupName, String resourceNamespace, String re * @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) { + public void delete(String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, + Context context) { deleteAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, context).block(); } } 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 index 2538bf7d5ba37..b2ef7622b94e6 100644 --- 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 @@ -22,37 +22,29 @@ public final class ServerVulnerabilityAssessmentsImpl implements ServerVulnerabi private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public ServerVulnerabilityAssessmentsImpl( - ServerVulnerabilityAssessmentsClient innerClient, + public ServerVulnerabilityAssessmentsImpl(ServerVulnerabilityAssessmentsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response listByExtendedResourceWithResponse( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - Response inner = - this - .serviceClient() - .listByExtendedResourceWithResponse( - 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); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ServerVulnerabilityAssessmentsListImpl(inner.getValue(), this.manager())); } else { return null; } } - public ServerVulnerabilityAssessmentsList listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - ServerVulnerabilityAssessmentsListInner inner = - this - .serviceClient() - .listByExtendedResource(resourceGroupName, resourceNamespace, resourceType, resourceName); + 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 { @@ -60,27 +52,22 @@ public ServerVulnerabilityAssessmentsList listByExtendedResource( } } - public Response getWithResponse( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - Response inner = - this - .serviceClient() - .getWithResponse(resourceGroupName, resourceNamespace, resourceType, resourceName, context); + public Response getWithResponse(String resourceGroupName, String resourceNamespace, + String resourceType, String resourceName, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceGroupName, + resourceNamespace, resourceType, resourceName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ServerVulnerabilityAssessmentImpl(inner.getValue(), this.manager())); } else { return null; } } - public ServerVulnerabilityAssessment get( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - ServerVulnerabilityAssessmentInner inner = - this.serviceClient().get(resourceGroupName, resourceNamespace, resourceType, resourceName); + 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 { @@ -88,27 +75,22 @@ public ServerVulnerabilityAssessment get( } } - public Response createOrUpdateWithResponse( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - Response inner = - this - .serviceClient() - .createOrUpdateWithResponse(resourceGroupName, resourceNamespace, resourceType, resourceName, context); + public Response createOrUpdateWithResponse(String resourceGroupName, + String resourceNamespace, String resourceType, String resourceName, Context context) { + Response inner = this.serviceClient() + .createOrUpdateWithResponse(resourceGroupName, resourceNamespace, resourceType, resourceName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ServerVulnerabilityAssessmentImpl(inner.getValue(), this.manager())); } else { return null; } } - public ServerVulnerabilityAssessment createOrUpdate( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - ServerVulnerabilityAssessmentInner inner = - this.serviceClient().createOrUpdate(resourceGroupName, resourceNamespace, resourceType, resourceName); + 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 { @@ -120,8 +102,8 @@ public void delete(String resourceGroupName, String resourceNamespace, String re this.serviceClient().delete(resourceGroupName, resourceNamespace, resourceType, resourceName); } - public void delete( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { + public void delete(String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, + Context context) { this.serviceClient().delete(resourceGroupName, resourceNamespace, resourceType, resourceName, context); } 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 index cc84ed836c77d..df3243ae40350 100644 --- 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 @@ -17,8 +17,7 @@ public final class ServerVulnerabilityAssessmentsListImpl implements ServerVulne private final com.azure.resourcemanager.security.SecurityManager serviceManager; - ServerVulnerabilityAssessmentsListImpl( - ServerVulnerabilityAssessmentsListInner innerObject, + ServerVulnerabilityAssessmentsListImpl(ServerVulnerabilityAssessmentsListInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -27,12 +26,9 @@ public final class ServerVulnerabilityAssessmentsListImpl implements ServerVulne 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())); + return Collections.unmodifiableList( + inner.stream().map(inner1 -> new ServerVulnerabilityAssessmentImpl(inner1, this.manager())) + .collect(Collectors.toList())); } else { return Collections.emptyList(); } 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 new file mode 100644 index 0000000000000..9d1a9e1f831ef --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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; + +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 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 new file mode 100644 index 0000000000000..d8fa6ee01d088 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingsClientImpl.java @@ -0,0 +1,641 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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.models.ServerVulnerabilityAssessmentsSettingKindName; +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingsList; +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("{$host}") + @ServiceInterface(name = "SecurityCenterServer") + public interface ServerVulnerabilityAssessmentsSettingsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/serverVulnerabilityAssessmentsSettings") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/serverVulnerabilityAssessmentsSettings/{settingKind}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("settingKind") ServerVulnerabilityAssessmentsSettingKindName settingKind, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/serverVulnerabilityAssessmentsSettings/{settingKind}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("settingKind") ServerVulnerabilityAssessmentsSettingKindName settingKind, + @BodyParam("application/json") ServerVulnerabilityAssessmentsSettingInner serverVulnerabilityAssessmentsSetting, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/serverVulnerabilityAssessmentsSettings/{settingKind}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("settingKind") ServerVulnerabilityAssessmentsSettingKindName settingKind, + @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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context 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 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 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 accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), settingKind, serverVulnerabilityAssessmentsSetting, accept, 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + settingKind, serverVulnerabilityAssessmentsSetting, accept, 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"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), settingKind, accept, 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"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), settingKind, + accept, 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 the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink 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 page of a server vulnerability assessments settings list 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 + * + * The nextLink 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 page of a server vulnerability assessments settings list 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 new file mode 100644 index 0000000000000..674bdfe3be355 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingsImpl.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 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())); + } + + public Response + getWithResponse(ServerVulnerabilityAssessmentsSettingKindName settingKind, Context context) { + Response inner + = this.serviceClient().getWithResponse(settingKind, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ServerVulnerabilityAssessmentsSettingImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ServerVulnerabilityAssessmentsSettingImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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); + } + + 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/SettingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingsClientImpl.java index 80ec076b1e331..30ffbfa19d58d 100644 --- 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 @@ -29,21 +29,27 @@ 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.models.SettingName; +import com.azure.resourcemanager.security.models.SettingNameAutoGenerated; import com.azure.resourcemanager.security.models.SettingsList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in SettingsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final SettingsService service; - /** The service client containing this operation class. */ + /** + * 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) { @@ -58,56 +64,43 @@ public final class SettingsClientImpl implements SettingsClient { @Host("{$host}") @ServiceInterface(name = "SecurityCenterSettin") public interface SettingsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("settingName") SettingName settingName, - @HeaderParam("Accept") String accept, + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("settingName") SettingNameAutoGenerated settingName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("settingName") SettingName settingName, - @BodyParam("application/json") SettingInner setting, - @HeaderParam("Accept") String accept, - Context context); + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("settingName") SettingNameAutoGenerated settingName, + @BodyParam("application/json") SettingInner setting, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context 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 along with {@link PagedResponse} on successful completion of {@link Mono}. @@ -115,39 +108,26 @@ Mono> listNext( @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)) + .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. @@ -157,36 +137,24 @@ private Mono> listSinglePageAsync() { @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)); + 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}. @@ -198,7 +166,7 @@ private PagedFlux 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. @@ -207,13 +175,13 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, 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}. @@ -225,7 +193,7 @@ public 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 ManagementException thrown if the request is rejected by server. @@ -239,7 +207,7 @@ public PagedIterable list(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. @@ -247,18 +215,14 @@ public PagedIterable list(Context context) { * @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) { + private Mono> getWithResponseAsync(SettingNameAutoGenerated settingName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -266,22 +230,14 @@ private Mono> getWithResponseAsync(SettingName settingNam 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)) + .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. @@ -290,18 +246,14 @@ private Mono> getWithResponseAsync(SettingName settingNam * @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) { + private Mono> getWithResponseAsync(SettingNameAutoGenerated settingName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -309,13 +261,13 @@ private Mono> getWithResponseAsync(SettingName settingNam 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); + 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. @@ -323,13 +275,13 @@ private Mono> getWithResponseAsync(SettingName settingNam * @return the kind of the security setting on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(SettingName settingName) { + private Mono getAsync(SettingNameAutoGenerated 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. @@ -338,13 +290,13 @@ private Mono getAsync(SettingName settingName) { * @return the kind of the security setting along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(SettingName settingName, Context context) { + public Response getWithResponse(SettingNameAutoGenerated 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. @@ -352,13 +304,13 @@ public Response getWithResponse(SettingName settingName, Context c * @return the kind of the security setting. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SettingInner get(SettingName settingName) { + public SettingInner get(SettingNameAutoGenerated 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. @@ -367,18 +319,15 @@ public SettingInner get(SettingName settingName) { * @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) { + private Mono> updateWithResponseAsync(SettingNameAutoGenerated settingName, + SettingInner setting) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -391,23 +340,14 @@ private Mono> updateWithResponseAsync(SettingName setting final String apiVersion = "2022-05-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - settingName, - setting, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), settingName, setting, accept, 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. @@ -417,19 +357,15 @@ private Mono> updateWithResponseAsync(SettingName setting * @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) { + private Mono> updateWithResponseAsync(SettingNameAutoGenerated 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -442,20 +378,13 @@ private Mono> updateWithResponseAsync( final String apiVersion = "2022-05-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - settingName, - setting, - accept, - context); + return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), settingName, + setting, accept, 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. @@ -464,13 +393,13 @@ private Mono> updateWithResponseAsync( * @return the kind of the security setting on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(SettingName settingName, SettingInner setting) { + private Mono updateAsync(SettingNameAutoGenerated 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. @@ -480,13 +409,14 @@ private Mono updateAsync(SettingName settingName, SettingInner set * @return the kind of the security setting along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(SettingName settingName, SettingInner setting, Context context) { + public Response updateWithResponse(SettingNameAutoGenerated 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. @@ -495,15 +425,16 @@ public Response updateWithResponse(SettingName settingName, Settin * @return the kind of the security setting. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SettingInner update(SettingName settingName, SettingInner setting) { + public SettingInner update(SettingNameAutoGenerated settingName, SettingInner setting) { return updateWithResponse(settingName, setting, Context.NONE).getValue(); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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. @@ -515,31 +446,22 @@ private Mono> listNextSinglePageAsync(String nextLin 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -552,23 +474,13 @@ private Mono> listNextSinglePageAsync(String nextLin 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.")); + 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)); + 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 index 4c370425ade59..41288aa70b220 100644 --- 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 @@ -12,7 +12,7 @@ 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.SettingNameAutoGenerated; import com.azure.resourcemanager.security.models.Settings; public final class SettingsImpl implements Settings { @@ -29,28 +29,25 @@ public SettingsImpl(SettingsClient innerClient, com.azure.resourcemanager.securi public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new SettingImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SettingImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new SettingImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SettingImpl(inner1, this.manager())); } - public Response getWithResponse(SettingName settingName, Context context) { + public Response getWithResponse(SettingNameAutoGenerated settingName, Context context) { Response inner = this.serviceClient().getWithResponse(settingName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SettingImpl(inner.getValue(), this.manager())); } else { return null; } } - public Setting get(SettingName settingName) { + public Setting get(SettingNameAutoGenerated settingName) { SettingInner inner = this.serviceClient().get(settingName); if (inner != null) { return new SettingImpl(inner, this.manager()); @@ -59,20 +56,18 @@ public Setting get(SettingName settingName) { } } - public Response updateWithResponse(SettingName settingName, SettingInner setting, Context context) { + public Response updateWithResponse(SettingNameAutoGenerated settingName, SettingInner setting, + Context context) { Response inner = this.serviceClient().updateWithResponse(settingName, setting, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SettingImpl(inner.getValue(), this.manager())); } else { return null; } } - public Setting update(SettingName settingName, SettingInner setting) { + public Setting update(SettingNameAutoGenerated settingName, SettingInner setting) { SettingInner inner = this.serviceClient().update(settingName, setting); if (inner != null) { return new SettingImpl(inner, this.manager()); diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SoftwareInventoriesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SoftwareInventoriesClientImpl.java index 9136222bcbf7f..562260a456154 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SoftwareInventoriesClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SoftwareInventoriesClientImpl.java @@ -30,22 +30,28 @@ import com.azure.resourcemanager.security.models.SoftwaresList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in SoftwareInventoriesClient. */ +/** + * An instance of this class provides access to all the operations defined in SoftwareInventoriesClient. + */ public final class SoftwareInventoriesClientImpl implements SoftwareInventoriesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final SoftwareInventoriesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final SecurityCenterImpl client; /** * Initializes an instance of SoftwareInventoriesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ SoftwareInventoriesClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(SoftwareInventoriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(SoftwareInventoriesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -56,76 +62,58 @@ public final class SoftwareInventoriesClientImpl implements SoftwareInventoriesC @Host("{$host}") @ServiceInterface(name = "SecurityCenterSoftwa") public interface SoftwareInventoriesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByExtendedResource( - @HostParam("$host") String endpoint, + Mono> listByExtendedResource(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceNamespace") String resourceNamespace, - @PathParam("resourceType") String resourceType, - @PathParam("resourceName") String resourceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceNamespace") String resourceNamespace, @PathParam("resourceType") String resourceType, + @PathParam("resourceName") String resourceName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/softwareInventories") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories/{softwareName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories/{softwareName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceNamespace") String resourceNamespace, - @PathParam("resourceType") String resourceType, - @PathParam("resourceName") String resourceName, - @PathParam("softwareName") String softwareName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceNamespace") String resourceNamespace, @PathParam("resourceType") String resourceType, + @PathParam("resourceName") String resourceName, @PathParam("softwareName") String softwareName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByExtendedResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Gets the software inventory of the virtual machine. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -133,22 +121,18 @@ Mono> listBySubscriptionNext( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the software inventory of the virtual machine along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByExtendedResourceSinglePageAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { + private Mono> listByExtendedResourceSinglePageAsync(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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -168,35 +152,18 @@ private Mono> listByExtendedResourceSinglePageAsync final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .listByExtendedResource( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + context -> service.listByExtendedResource(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, resourceNamespace, resourceType, resourceName, apiVersion, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the software inventory of the virtual machine. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -205,22 +172,18 @@ private Mono> listByExtendedResourceSinglePageAsync * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the software inventory of the virtual machine along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByExtendedResourceSinglePageAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { + private Mono> listByExtendedResourceSinglePageAsync(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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -240,32 +203,17 @@ private Mono> listByExtendedResourceSinglePageAsync final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByExtendedResource( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByExtendedResource(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + resourceNamespace, resourceType, resourceName, apiVersion, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets the software inventory of the virtual machine. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -275,19 +223,17 @@ private Mono> listByExtendedResourceSinglePageAsync * @return the software inventory of the virtual machine as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByExtendedResourceAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - return new PagedFlux<>( - () -> - listByExtendedResourceSinglePageAsync(resourceGroupName, resourceNamespace, resourceType, resourceName), - nextLink -> listByExtendedResourceNextSinglePageAsync(nextLink)); + private PagedFlux listByExtendedResourceAsync(String resourceGroupName, String resourceNamespace, + String resourceType, String resourceName) { + return new PagedFlux<>(() -> listByExtendedResourceSinglePageAsync(resourceGroupName, resourceNamespace, + resourceType, resourceName), nextLink -> listByExtendedResourceNextSinglePageAsync(nextLink)); } /** * Gets the software inventory of the virtual machine. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -298,20 +244,18 @@ private PagedFlux listByExtendedResourceAsync( * @return the software inventory of the virtual machine as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByExtendedResourceAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - return new PagedFlux<>( - () -> - listByExtendedResourceSinglePageAsync( - resourceGroupName, resourceNamespace, resourceType, resourceName, context), + private PagedFlux listByExtendedResourceAsync(String resourceGroupName, String resourceNamespace, + String resourceType, String resourceName, Context context) { + return new PagedFlux<>(() -> listByExtendedResourceSinglePageAsync(resourceGroupName, resourceNamespace, + resourceType, resourceName, context), nextLink -> listByExtendedResourceNextSinglePageAsync(nextLink, context)); } /** * Gets the software inventory of the virtual machine. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -321,17 +265,17 @@ private PagedFlux listByExtendedResourceAsync( * @return the software inventory of the virtual machine as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { + public PagedIterable listByExtendedResource(String resourceGroupName, String resourceNamespace, + String resourceType, String resourceName) { return new PagedIterable<>( listByExtendedResourceAsync(resourceGroupName, resourceNamespace, resourceType, resourceName)); } /** * Gets the software inventory of the virtual machine. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -342,130 +286,105 @@ public PagedIterable listByExtendedResource( * @return the software inventory of the virtual machine as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { + public PagedIterable listByExtendedResource(String resourceGroupName, String resourceNamespace, + String resourceType, String resourceName, Context context) { return new PagedIterable<>( listByExtendedResourceAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, context)); } /** * Gets the software inventory of all virtual machines in 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 the software inventory of all virtual machines in the subscriptions along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2021-05-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, + accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the software inventory of all virtual machines in 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 the software inventory of all virtual machines in the subscriptions along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2021-05-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets the software inventory of all virtual machines in 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 the software inventory of all virtual machines in the subscriptions as paginated response with {@link - * PagedFlux}. + * @return the software inventory of all virtual machines in the subscriptions as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { - return new PagedFlux<>( - () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** * Gets the software inventory of all virtual machines in 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 the software inventory of all virtual machines in the subscriptions as paginated response with {@link - * PagedFlux}. + * @return the software inventory of all virtual machines in the subscriptions as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** * Gets the software inventory of all virtual machines in 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 the software inventory of all virtual machines in the subscriptions as paginated response with {@link - * PagedIterable}. + * @return the software inventory of all virtual machines in the subscriptions as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -474,13 +393,13 @@ public PagedIterable list() { /** * Gets the software inventory of all virtual machines in 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 the software inventory of all virtual machines in the subscriptions as paginated response with {@link - * PagedIterable}. + * @return the software inventory of all virtual machines in the subscriptions as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -489,9 +408,9 @@ public PagedIterable list(Context context) { /** * Gets a single software data of the virtual machine. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -500,26 +419,18 @@ public PagedIterable list(Context context) { * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single software data of the virtual machine along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String softwareName) { + private Mono> getWithResponseAsync(String resourceGroupName, String resourceNamespace, + String resourceType, String resourceName, String softwareName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -542,27 +453,16 @@ private Mono> getWithResponseAsync( final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - softwareName, - apiVersion, - accept, - context)) + context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + resourceNamespace, resourceType, resourceName, softwareName, apiVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets a single software data of the virtual machine. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -572,27 +472,18 @@ private Mono> getWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single software data of the virtual machine along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String softwareName, - Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String resourceNamespace, + String resourceType, String resourceName, String softwareName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -614,25 +505,15 @@ private Mono> getWithResponseAsync( final String apiVersion = "2021-05-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - softwareName, - apiVersion, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + resourceNamespace, resourceType, resourceName, softwareName, apiVersion, accept, context); } /** * Gets a single software data of the virtual machine. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -643,21 +524,17 @@ private Mono> getWithResponseAsync( * @return a single software data of the virtual machine on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String softwareName) { + private Mono getAsync(String resourceGroupName, String resourceNamespace, String resourceType, + String resourceName, String softwareName) { return getWithResponseAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, softwareName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets a single software data of the virtual machine. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -669,23 +546,17 @@ private Mono getAsync( * @return a single software data of the virtual machine along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String softwareName, - Context context) { - return getWithResponseAsync( - resourceGroupName, resourceNamespace, resourceType, resourceName, softwareName, context) - .block(); + public Response getWithResponse(String resourceGroupName, String resourceNamespace, + String resourceType, String resourceName, String softwareName, Context context) { + return getWithResponseAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, softwareName, + context).block(); } /** * Gets a single software data of the virtual machine. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -696,27 +567,23 @@ public Response getWithResponse( * @return a single software data of the virtual machine. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SoftwareInner get( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String softwareName) { - return getWithResponse( - resourceGroupName, resourceNamespace, resourceType, resourceName, softwareName, Context.NONE) - .getValue(); + public SoftwareInner get(String resourceGroupName, String resourceNamespace, String resourceType, + String resourceName, String softwareName) { + return getWithResponse(resourceGroupName, resourceNamespace, resourceType, resourceName, softwareName, + Context.NONE).getValue(); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 software inventory of the virtual machine along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByExtendedResourceNextSinglePageAsync(String nextLink) { @@ -724,76 +591,59 @@ private Mono> listByExtendedResourceNextSinglePageA 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.")); + 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.listByExtendedResourceNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new 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 - *

The nextLink parameter. + * + * The nextLink 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 software inventory of the virtual machine along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByExtendedResourceNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByExtendedResourceNextSinglePageAsync(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.")); + 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 - .listByExtendedResourceNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByExtendedResourceNext(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 - *

The nextLink parameter. + * + * The nextLink 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 software inventory of the virtual machine along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -801,38 +651,30 @@ private Mono> listBySubscriptionNextSinglePageAsync 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.")); + 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)) + .>map(res -> new 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 - *

The nextLink parameter. + * + * The nextLink 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 software inventory of the virtual machine along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { @@ -840,23 +682,13 @@ private Mono> listBySubscriptionNextSinglePageAsync 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.")); + 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)); + 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/SoftwareInventoriesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SoftwareInventoriesImpl.java index fdbee743a3209..5f249c5c1ed07 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SoftwareInventoriesImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SoftwareInventoriesImpl.java @@ -21,71 +21,52 @@ public final class SoftwareInventoriesImpl implements SoftwareInventories { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public SoftwareInventoriesImpl( - SoftwareInventoriesClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + public SoftwareInventoriesImpl(SoftwareInventoriesClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - PagedIterable inner = - this - .serviceClient() - .listByExtendedResource(resourceGroupName, resourceNamespace, resourceType, resourceName); - return Utils.mapPage(inner, inner1 -> new SoftwareImpl(inner1, this.manager())); + public PagedIterable listByExtendedResource(String resourceGroupName, String resourceNamespace, + String resourceType, String resourceName) { + PagedIterable inner = this.serviceClient().listByExtendedResource(resourceGroupName, + resourceNamespace, resourceType, resourceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SoftwareImpl(inner1, this.manager())); } - public PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - PagedIterable inner = - this - .serviceClient() - .listByExtendedResource(resourceGroupName, resourceNamespace, resourceType, resourceName, context); - return Utils.mapPage(inner, inner1 -> new SoftwareImpl(inner1, this.manager())); + public PagedIterable listByExtendedResource(String resourceGroupName, String resourceNamespace, + String resourceType, String resourceName, Context context) { + PagedIterable inner = this.serviceClient().listByExtendedResource(resourceGroupName, + resourceNamespace, resourceType, resourceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SoftwareImpl(inner1, this.manager())); } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new SoftwareImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SoftwareImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new SoftwareImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SoftwareImpl(inner1, this.manager())); } - public Response getWithResponse( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String softwareName, - Context context) { - Response inner = - this - .serviceClient() - .getWithResponse( - resourceGroupName, resourceNamespace, resourceType, resourceName, softwareName, context); + public Response getWithResponse(String resourceGroupName, String resourceNamespace, String resourceType, + String resourceName, String softwareName, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceGroupName, resourceNamespace, + resourceType, resourceName, softwareName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SoftwareImpl(inner.getValue(), this.manager())); } else { return null; } } - public Software get( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, + public Software get(String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, String softwareName) { - SoftwareInner inner = - this.serviceClient().get(resourceGroupName, resourceNamespace, resourceType, resourceName, softwareName); + SoftwareInner inner + = this.serviceClient().get(resourceGroupName, resourceNamespace, resourceType, resourceName, softwareName); if (inner != null) { return new SoftwareImpl(inner, this.manager()); } else { 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 index 434e0aa1a792e..e6758e2a84512 100644 --- 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 @@ -38,24 +38,24 @@ */ public final class SqlVulnerabilityAssessmentBaselineRulesClientImpl implements SqlVulnerabilityAssessmentBaselineRulesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final SqlVulnerabilityAssessmentBaselineRulesService service; - /** The service client containing this operation class. */ + /** + * 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.service = RestProxy.create(SqlVulnerabilityAssessmentBaselineRulesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -66,75 +66,58 @@ public final class SqlVulnerabilityAssessmentBaselineRulesClientImpl @Host("{$host}") @ServiceInterface(name = "SecurityCenterSqlVul") public interface SqlVulnerabilityAssessmentBaselineRulesService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Put("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("ruleId") String ruleId, - @QueryParam("workspaceId") String workspaceId, + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("ruleId") String ruleId, @QueryParam("workspaceId") String workspaceId, @QueryParam("api-version") String apiVersion, @PathParam(value = "resourceId", encoded = true) String resourceId, - @BodyParam("application/json") RuleResultsInput body, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") RuleResultsInput body, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("ruleId") String ruleId, - @QueryParam("workspaceId") String workspaceId, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @HeaderParam("Accept") String accept, + Mono> get(@HostParam("$host") String endpoint, @PathParam("ruleId") String ruleId, + @QueryParam("workspaceId") String workspaceId, @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceId", encoded = true) String resourceId, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Delete("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}") - @ExpectedResponses({200, 204}) + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("ruleId") String ruleId, - @QueryParam("workspaceId") String workspaceId, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @HeaderParam("Accept") String accept, + Mono> delete(@HostParam("$host") String endpoint, @PathParam("ruleId") String ruleId, + @QueryParam("workspaceId") String workspaceId, @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceId", encoded = true) String resourceId, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("workspaceId") String workspaceId, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @HeaderParam("Accept") String accept, + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("workspaceId") String workspaceId, @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceId", encoded = true) String resourceId, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Post("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> add( - @HostParam("$host") String endpoint, - @QueryParam("workspaceId") String workspaceId, - @QueryParam("api-version") String apiVersion, + Mono> add(@HostParam("$host") String endpoint, + @QueryParam("workspaceId") String workspaceId, @QueryParam("api-version") String apiVersion, @PathParam(value = "resourceId", encoded = true) String resourceId, - @BodyParam("application/json") RulesResultsInput body, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") RulesResultsInput body, @HeaderParam("Accept") String accept, Context context); } /** * Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - * + * * @param ruleId The rule Id. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -145,13 +128,11 @@ Mono> add( * @return rule results along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String ruleId, String workspaceId, String resourceId, RuleResultsInput body) { + private Mono> createOrUpdateWithResponseAsync(String ruleId, String workspaceId, + String resourceId, RuleResultsInput body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (ruleId == null) { return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); @@ -168,24 +149,14 @@ private Mono> createOrUpdateWithResponseAsync( final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - ruleId, - workspaceId, - apiVersion, - resourceId, - body, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), ruleId, workspaceId, apiVersion, + resourceId, body, accept, 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 ruleId The rule Id. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -197,13 +168,11 @@ private Mono> createOrUpdateWithResponseAsync( * @return rule results along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String ruleId, String workspaceId, String resourceId, RuleResultsInput body, Context context) { + private Mono> createOrUpdateWithResponseAsync(String ruleId, String workspaceId, + String resourceId, RuleResultsInput body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (ruleId == null) { return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); @@ -220,14 +189,13 @@ private Mono> createOrUpdateWithResponseAsync( final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), ruleId, workspaceId, apiVersion, resourceId, body, accept, context); + return service.createOrUpdate(this.client.getEndpoint(), ruleId, workspaceId, apiVersion, resourceId, body, + accept, context); } /** * Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - * + * * @param ruleId The rule Id. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -245,7 +213,7 @@ private Mono createOrUpdateAsync(String ruleId, String workspa /** * Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - * + * * @param ruleId The rule Id. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -257,14 +225,14 @@ private Mono createOrUpdateAsync(String ruleId, String workspa * @return rule results along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String ruleId, String workspaceId, String resourceId, RuleResultsInput body, Context context) { + public Response createOrUpdateWithResponse(String ruleId, String workspaceId, String resourceId, + RuleResultsInput body, Context context) { return createOrUpdateWithResponseAsync(ruleId, workspaceId, resourceId, body, context).block(); } /** * Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - * + * * @param ruleId The rule Id. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -281,7 +249,7 @@ public RuleResultsInner createOrUpdate(String ruleId, String workspaceId, String /** * Gets the results for a given rule in the Baseline. - * + * * @param ruleId The rule Id. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -289,16 +257,14 @@ public RuleResultsInner createOrUpdate(String ruleId, String workspaceId, String * @throws ManagementException 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String ruleId, String workspaceId, String resourceId) { + private Mono> getWithResponseAsync(String ruleId, String workspaceId, + String resourceId) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (ruleId == null) { return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); @@ -312,16 +278,14 @@ private Mono> getWithResponseAsync( final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get(this.client.getEndpoint(), ruleId, workspaceId, apiVersion, resourceId, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), ruleId, workspaceId, apiVersion, resourceId, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the results for a given rule in the Baseline. - * + * * @param ruleId The rule Id. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -330,16 +294,14 @@ private Mono> getWithResponseAsync( * @throws ManagementException 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String ruleId, String workspaceId, String resourceId, Context context) { + private Mono> getWithResponseAsync(String ruleId, String workspaceId, String resourceId, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (ruleId == null) { return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); @@ -358,7 +320,7 @@ private Mono> getWithResponseAsync( /** * Gets the results for a given rule in the Baseline. - * + * * @param ruleId The rule Id. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -374,7 +336,7 @@ private Mono getAsync(String ruleId, String workspaceId, Strin /** * Gets the results for a given rule in the Baseline. - * + * * @param ruleId The rule Id. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -385,14 +347,14 @@ private Mono getAsync(String ruleId, String workspaceId, Strin * @return the results for a given rule in the Baseline along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String ruleId, String workspaceId, String resourceId, Context context) { + public Response getWithResponse(String ruleId, String workspaceId, String resourceId, + Context context) { return getWithResponseAsync(ruleId, workspaceId, resourceId, context).block(); } /** * Gets the results for a given rule in the Baseline. - * + * * @param ruleId The rule Id. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -408,7 +370,7 @@ public RuleResultsInner get(String ruleId, String workspaceId, String resourceId /** * Deletes a rule from the Baseline of a given database. - * + * * @param ruleId The rule Id. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -420,10 +382,8 @@ public RuleResultsInner get(String ruleId, String workspaceId, String resourceId @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String ruleId, String workspaceId, String resourceId) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (ruleId == null) { return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); @@ -437,17 +397,14 @@ private Mono> deleteWithResponseAsync(String ruleId, String works final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), ruleId, workspaceId, apiVersion, resourceId, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), ruleId, workspaceId, apiVersion, + resourceId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes a rule from the Baseline of a given database. - * + * * @param ruleId The rule Id. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -458,13 +415,11 @@ private Mono> deleteWithResponseAsync(String ruleId, String works * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String ruleId, String workspaceId, String resourceId, Context context) { + private Mono> deleteWithResponseAsync(String ruleId, String workspaceId, String resourceId, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (ruleId == null) { return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); @@ -483,7 +438,7 @@ private Mono> deleteWithResponseAsync( /** * Deletes a rule from the Baseline of a given database. - * + * * @param ruleId The rule Id. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -499,7 +454,7 @@ private Mono deleteAsync(String ruleId, String workspaceId, String resourc /** * Deletes a rule from the Baseline of a given database. - * + * * @param ruleId The rule Id. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -516,7 +471,7 @@ public Response deleteWithResponse(String ruleId, String workspaceId, Stri /** * Deletes a rule from the Baseline of a given database. - * + * * @param ruleId The rule Id. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -531,22 +486,20 @@ public void delete(String ruleId, String workspaceId, String resourceId) { /** * Gets the results for all rules in the Baseline. - * + * * @param workspaceId The workspace Id. * @param resourceId The 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 along with {@link Response} on successful completion of {@link - * Mono}. + * @return the results for all rules in the Baseline along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync(String workspaceId, String resourceId) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (workspaceId == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceId is required and cannot be null.")); @@ -556,33 +509,29 @@ private Mono> listWithResponseAsync(String workspace } final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.list(this.client.getEndpoint(), workspaceId, apiVersion, resourceId, accept, context)) + return FluxUtil.withContext( + context -> service.list(this.client.getEndpoint(), workspaceId, apiVersion, resourceId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the results for all rules in the Baseline. - * + * * @param workspaceId The workspace Id. * @param resourceId The 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 results for all rules in the Baseline along with {@link Response} on successful completion of {@link - * Mono}. + * @return the results for all rules in the Baseline along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String workspaceId, String resourceId, Context context) { + private Mono> listWithResponseAsync(String workspaceId, String resourceId, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (workspaceId == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceId is required and cannot be null.")); @@ -598,7 +547,7 @@ private Mono> listWithResponseAsync( /** * Gets the results for all rules in the Baseline. - * + * * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -613,7 +562,7 @@ private Mono listAsync(String workspaceId, String resourceId) /** * Gets the results for all rules in the Baseline. - * + * * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. * @param context The context to associate with this operation. @@ -629,7 +578,7 @@ public Response listWithResponse(String workspaceId, String r /** * Gets the results for all rules in the Baseline. - * + * * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -644,7 +593,7 @@ public RulesResultsInner list(String workspaceId, String resourceId) { /** * Add a list of baseline rules. Will overwrite any previously existing results (for all rules). - * + * * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. * @param body The baseline rules. @@ -654,13 +603,11 @@ public RulesResultsInner list(String workspaceId, String resourceId) { * @return a list of rules results along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> addWithResponseAsync( - String workspaceId, String resourceId, RulesResultsInput body) { + private Mono> addWithResponseAsync(String workspaceId, String resourceId, + RulesResultsInput body) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (workspaceId == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceId is required and cannot be null.")); @@ -674,15 +621,14 @@ private Mono> addWithResponseAsync( final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service.add(this.client.getEndpoint(), workspaceId, apiVersion, resourceId, body, accept, context)) + .withContext(context -> service.add(this.client.getEndpoint(), workspaceId, apiVersion, resourceId, body, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Add a list of baseline rules. Will overwrite any previously existing results (for all rules). - * + * * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. * @param body The baseline rules. @@ -693,13 +639,11 @@ private Mono> addWithResponseAsync( * @return a list of rules results along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> addWithResponseAsync( - String workspaceId, String resourceId, RulesResultsInput body, Context context) { + private Mono> addWithResponseAsync(String workspaceId, String resourceId, + RulesResultsInput body, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (workspaceId == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceId is required and cannot be null.")); @@ -718,7 +662,7 @@ private Mono> addWithResponseAsync( /** * Add a list of baseline rules. Will overwrite any previously existing results (for all rules). - * + * * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -734,7 +678,7 @@ private Mono addAsync(String workspaceId, String resourceId) /** * Add a list of baseline rules. Will overwrite any previously existing results (for all rules). - * + * * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. * @param body The baseline rules. @@ -745,14 +689,14 @@ private Mono addAsync(String workspaceId, String resourceId) * @return a list of rules results along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response addWithResponse( - String workspaceId, String resourceId, RulesResultsInput body, Context context) { + public Response addWithResponse(String workspaceId, String resourceId, RulesResultsInput body, + Context context) { return addWithResponseAsync(workspaceId, resourceId, body, context).block(); } /** * Add a list of baseline rules. Will overwrite any previously existing results (for all rules). - * + * * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. 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 index 2f3bbda297510..350e1af599c10 100644 --- 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 @@ -23,22 +23,18 @@ public final class SqlVulnerabilityAssessmentBaselineRulesImpl implements SqlVul private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public SqlVulnerabilityAssessmentBaselineRulesImpl( - SqlVulnerabilityAssessmentBaselineRulesClient innerClient, + public SqlVulnerabilityAssessmentBaselineRulesImpl(SqlVulnerabilityAssessmentBaselineRulesClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response getWithResponse( - String ruleId, String workspaceId, String resourceId, Context context) { - Response inner = - this.serviceClient().getWithResponse(ruleId, workspaceId, resourceId, context); + public Response getWithResponse(String ruleId, String workspaceId, String resourceId, + Context context) { + Response inner + = this.serviceClient().getWithResponse(ruleId, workspaceId, resourceId, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new RuleResultsImpl(inner.getValue(), this.manager())); } else { return null; @@ -65,10 +61,7 @@ public void delete(String ruleId, String workspaceId, String resourceId) { public Response listWithResponse(String workspaceId, String resourceId, Context context) { Response inner = this.serviceClient().listWithResponse(workspaceId, resourceId, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new RulesResultsImpl(inner.getValue(), this.manager())); } else { return null; @@ -84,15 +77,12 @@ public RulesResults list(String workspaceId, String resourceId) { } } - public Response addWithResponse( - String workspaceId, String resourceId, RulesResultsInput body, Context context) { - Response inner = - this.serviceClient().addWithResponse(workspaceId, resourceId, body, context); + public Response addWithResponse(String workspaceId, String resourceId, RulesResultsInput body, + Context context) { + Response inner + = this.serviceClient().addWithResponse(workspaceId, resourceId, body, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new RulesResultsImpl(inner.getValue(), this.manager())); } else { return null; 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 index ba2ec1708d839..a6fdac184b14d 100644 --- 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 @@ -32,67 +32,57 @@ */ public final class SqlVulnerabilityAssessmentScanResultsClientImpl implements SqlVulnerabilityAssessmentScanResultsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final SqlVulnerabilityAssessmentScanResultsService service; - /** The service client containing this operation class. */ + /** + * 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.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. + * The interface defining all the services for SecurityCenterSqlVulnerabilityAssessmentScanResults to be used by + * the proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "SecurityCenterSqlVul") public interface SqlVulnerabilityAssessmentScanResultsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults/{scanResultId}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults/{scanResultId}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("scanId") String scanId, - @PathParam("scanResultId") String scanResultId, - @QueryParam("workspaceId") String workspaceId, + Mono> get(@HostParam("$host") String endpoint, @PathParam("scanId") String scanId, + @PathParam("scanResultId") String scanResultId, @QueryParam("workspaceId") String workspaceId, @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @HeaderParam("Accept") String accept, + @PathParam(value = "resourceId", encoded = true) String resourceId, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("scanId") String scanId, - @QueryParam("workspaceId") String workspaceId, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @HeaderParam("Accept") String accept, + Mono> list(@HostParam("$host") String endpoint, @PathParam("scanId") String scanId, + @QueryParam("workspaceId") String workspaceId, @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceId", encoded = true) String resourceId, @HeaderParam("Accept") String accept, Context context); } /** * Gets the scan results of a single rule in a scan record. - * + * * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. * @param scanResultId The rule Id of the results. * @param workspaceId The workspace Id. @@ -101,16 +91,14 @@ Mono> list( * @throws ManagementException 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}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String scanId, String scanResultId, String workspaceId, String resourceId) { + private Mono> getWithResponseAsync(String scanId, String scanResultId, String workspaceId, + String resourceId) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (scanId == null) { return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); @@ -127,24 +115,14 @@ private Mono> getWithResponseAsync( final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - scanId, - scanResultId, - workspaceId, - apiVersion, - resourceId, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), scanId, scanResultId, workspaceId, + apiVersion, resourceId, 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. Type 'latest' to get the scan results for the latest scan. * @param scanResultId The rule Id of the results. * @param workspaceId The workspace Id. @@ -154,16 +132,14 @@ private Mono> getWithResponseAsync( * @throws ManagementException 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}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String scanId, String scanResultId, String workspaceId, String resourceId, Context context) { + private Mono> getWithResponseAsync(String scanId, String scanResultId, String workspaceId, + String resourceId, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (scanId == null) { return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); @@ -180,13 +156,13 @@ private Mono> getWithResponseAsync( final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get(this.client.getEndpoint(), scanId, scanResultId, workspaceId, apiVersion, resourceId, accept, context); + return service.get(this.client.getEndpoint(), scanId, scanResultId, workspaceId, apiVersion, resourceId, accept, + context); } /** * Gets the scan results of a single rule in a scan record. - * + * * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. * @param scanResultId The rule Id of the results. * @param workspaceId The workspace Id. @@ -204,7 +180,7 @@ private Mono getAsync(String scanId, String scanResultId, Strin /** * Gets the scan results of a single rule in a scan record. - * + * * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. * @param scanResultId The rule Id of the results. * @param workspaceId The workspace Id. @@ -216,14 +192,14 @@ private Mono getAsync(String scanId, String scanResultId, Strin * @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 workspaceId, String resourceId, Context context) { + public Response getWithResponse(String scanId, String scanResultId, String workspaceId, + String resourceId, Context context) { return getWithResponseAsync(scanId, scanResultId, workspaceId, resourceId, context).block(); } /** * Gets the scan results of a single rule in a scan record. - * + * * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. * @param scanResultId The rule Id of the results. * @param workspaceId The workspace Id. @@ -240,7 +216,7 @@ public ScanResultInner get(String scanId, String scanResultId, String workspaceI /** * Gets a list of scan results for a single scan record. - * + * * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -248,16 +224,14 @@ public ScanResultInner get(String scanId, String scanResultId, String workspaceI * @throws ManagementException thrown if 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 Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String scanId, String workspaceId, String resourceId) { + private Mono> listWithResponseAsync(String scanId, String workspaceId, + String resourceId) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (scanId == null) { return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); @@ -271,16 +245,14 @@ private Mono> listWithResponseAsync( final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), scanId, workspaceId, apiVersion, resourceId, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), scanId, workspaceId, apiVersion, resourceId, + accept, context)) .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. Type 'latest' to get the scan results for the latest scan. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -289,16 +261,14 @@ private Mono> listWithResponseAsync( * @throws ManagementException thrown if 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 Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String scanId, String workspaceId, String resourceId, Context context) { + private Mono> listWithResponseAsync(String scanId, String workspaceId, String resourceId, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (scanId == null) { return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); @@ -317,7 +287,7 @@ private Mono> listWithResponseAsync( /** * Gets a list of scan results for a single scan record. - * + * * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -333,7 +303,7 @@ private Mono listAsync(String scanId, String workspaceId, Stri /** * Gets a list of scan results for a single scan record. - * + * * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -344,14 +314,14 @@ private Mono listAsync(String scanId, String workspaceId, Stri * @return a list of scan results for a single scan record along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse( - String scanId, String workspaceId, String resourceId, Context context) { + public Response listWithResponse(String scanId, String workspaceId, String resourceId, + Context context) { return listWithResponseAsync(scanId, workspaceId, resourceId, context).block(); } /** * Gets a list of scan results for a single scan record. - * + * * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. 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 index ede3a2500e802..ac44a1c6049b8 100644 --- 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 @@ -22,22 +22,18 @@ public final class SqlVulnerabilityAssessmentScanResultsImpl implements SqlVulne private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public SqlVulnerabilityAssessmentScanResultsImpl( - SqlVulnerabilityAssessmentScanResultsClient innerClient, + public SqlVulnerabilityAssessmentScanResultsImpl(SqlVulnerabilityAssessmentScanResultsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response getWithResponse( - String scanId, String scanResultId, String workspaceId, String resourceId, Context context) { - Response inner = - this.serviceClient().getWithResponse(scanId, scanResultId, workspaceId, resourceId, context); + public Response getWithResponse(String scanId, String scanResultId, String workspaceId, + String resourceId, Context context) { + Response inner + = this.serviceClient().getWithResponse(scanId, scanResultId, workspaceId, resourceId, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ScanResultImpl(inner.getValue(), this.manager())); } else { return null; @@ -53,15 +49,12 @@ public ScanResult get(String scanId, String scanResultId, String workspaceId, St } } - public Response listWithResponse( - String scanId, String workspaceId, String resourceId, Context context) { - Response inner = - this.serviceClient().listWithResponse(scanId, workspaceId, resourceId, context); + public Response listWithResponse(String scanId, String workspaceId, String resourceId, + Context context) { + Response inner + = this.serviceClient().listWithResponse(scanId, workspaceId, resourceId, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ScanResultsImpl(inner.getValue(), this.manager())); } else { return null; 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 index 3a315100d9df3..3bd2eb0709aab 100644 --- 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 @@ -26,81 +26,74 @@ import com.azure.resourcemanager.security.fluent.models.ScansInner; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in SqlVulnerabilityAssessmentScansClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final SqlVulnerabilityAssessmentScansService service; - /** The service client containing this operation class. */ + /** + * 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.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. + * The interface defining all the services for SecurityCenterSqlVulnerabilityAssessmentScans to be used by the + * proxy service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "SecurityCenterSqlVul") public interface SqlVulnerabilityAssessmentScansService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("scanId") String scanId, - @QueryParam("workspaceId") String workspaceId, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @HeaderParam("Accept") String accept, + Mono> get(@HostParam("$host") String endpoint, @PathParam("scanId") String scanId, + @QueryParam("workspaceId") String workspaceId, @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceId", encoded = true) String resourceId, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("workspaceId") String workspaceId, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @HeaderParam("Accept") String accept, + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("workspaceId") String workspaceId, @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceId", encoded = true) String resourceId, @HeaderParam("Accept") String accept, 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 workspaceId The workspace Id. * @param resourceId The 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 along with {@link Response} on successful completion of {@link - * Mono}. + * @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 workspaceId, String resourceId) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (scanId == null) { return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); @@ -114,16 +107,14 @@ private Mono> getWithResponseAsync(String scanId, String wor final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get(this.client.getEndpoint(), scanId, workspaceId, apiVersion, resourceId, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), scanId, workspaceId, apiVersion, resourceId, + 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 workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -131,17 +122,15 @@ private Mono> getWithResponseAsync(String scanId, String wor * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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}. + * @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 workspaceId, String resourceId, Context context) { + private Mono> getWithResponseAsync(String scanId, String workspaceId, String resourceId, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (scanId == null) { return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); @@ -160,7 +149,7 @@ private Mono> getWithResponseAsync( /** * 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 workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -176,7 +165,7 @@ private Mono getAsync(String scanId, String workspaceId, String resou /** * 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 workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -193,7 +182,7 @@ public Response getWithResponse(String scanId, String workspaceId, St /** * 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 workspaceId The workspace Id. * @param resourceId The identifier of the resource. @@ -209,7 +198,7 @@ public ScanInner get(String scanId, String workspaceId, String resourceId) { /** * Gets a list of scan records. - * + * * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -220,10 +209,8 @@ public ScanInner get(String scanId, String workspaceId, String resourceId) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync(String workspaceId, String resourceId) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (workspaceId == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceId is required and cannot be null.")); @@ -233,16 +220,14 @@ private Mono> listWithResponseAsync(String workspaceId, Str } final String apiVersion = "2023-02-01-preview"; final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.list(this.client.getEndpoint(), workspaceId, apiVersion, resourceId, accept, context)) + return FluxUtil.withContext( + context -> service.list(this.client.getEndpoint(), workspaceId, apiVersion, resourceId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets a list of scan records. - * + * * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. * @param context The context to associate with this operation. @@ -254,10 +239,8 @@ private Mono> listWithResponseAsync(String workspaceId, Str @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync(String workspaceId, String resourceId, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (workspaceId == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceId is required and cannot be null.")); @@ -273,7 +256,7 @@ private Mono> listWithResponseAsync(String workspaceId, Str /** * Gets a list of scan records. - * + * * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -288,7 +271,7 @@ private Mono listAsync(String workspaceId, String resourceId) { /** * Gets a list of scan records. - * + * * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. * @param context The context to associate with this operation. @@ -304,7 +287,7 @@ public Response listWithResponse(String workspaceId, String resource /** * Gets a list of scan records. - * + * * @param workspaceId The workspace Id. * @param resourceId The identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. 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 index 8f16764d6269d..a5c3bb15481a1 100644 --- 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 @@ -22,8 +22,7 @@ public final class SqlVulnerabilityAssessmentScansImpl implements SqlVulnerabili private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public SqlVulnerabilityAssessmentScansImpl( - SqlVulnerabilityAssessmentScansClient innerClient, + public SqlVulnerabilityAssessmentScansImpl(SqlVulnerabilityAssessmentScansClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -32,10 +31,7 @@ public SqlVulnerabilityAssessmentScansImpl( public Response getWithResponse(String scanId, String workspaceId, String resourceId, Context context) { Response inner = this.serviceClient().getWithResponse(scanId, workspaceId, resourceId, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ScanImpl(inner.getValue(), this.manager())); } else { return null; @@ -54,10 +50,7 @@ public Scan get(String scanId, String workspaceId, String resourceId) { public Response listWithResponse(String workspaceId, String resourceId, Context context) { Response inner = this.serviceClient().listWithResponse(workspaceId, resourceId, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ScansImpl(inner.getValue(), this.manager())); } else { return null; 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 index a93f80e557e9d..bac88385900c2 100644 --- 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 @@ -30,22 +30,28 @@ import com.azure.resourcemanager.security.models.SecuritySubAssessmentList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in SubAssessmentsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final SubAssessmentsService service; - /** The service client containing this operation class. */ + /** + * 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.service + = RestProxy.create(SubAssessmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -56,81 +62,65 @@ public final class SubAssessmentsClientImpl implements SubAssessmentsClient { @Host("{$host}") @ServiceInterface(name = "SecurityCenterSubAss") public interface SubAssessmentsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/{scope}/providers/Microsoft.Security/subAssessments") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAll( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, - Context context); + Mono> listAll(@HostParam("$host") 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"}) + @Headers({ "Content-Type: application/json" }) @Get("/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("assessmentName") String assessmentName, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") 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"}) + @Headers({ "Content-Type: application/json" }) @Get("/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments/{subAssessmentName}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, + Mono> get(@HostParam("$host") 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, + @PathParam("subAssessmentName") String subAssessmentName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Get security sub-assessments on all your scanned resources inside a subscription scope. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @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.")); + 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.")); @@ -139,37 +129,28 @@ private Mono> listAllSinglePageAsync(S 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)) + .>map(res -> new 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 Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * @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.")); + 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.")); @@ -177,29 +158,21 @@ private Mono> listAllSinglePageAsync(S 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)); + 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 Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAllAsync(String scope) { @@ -208,32 +181,32 @@ private PagedFlux listAllAsync(String scope) { /** * Get security sub-assessments on all your scanned resources inside a subscription scope. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAllAsync(String scope, Context context) { - return new PagedFlux<>( - () -> listAllSinglePageAsync(scope, context), nextLink -> listAllNextSinglePageAsync(nextLink, 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 Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listAll(String scope) { @@ -242,15 +215,15 @@ public PagedIterable listAll(String scope) { /** * Get security sub-assessments on all your scanned resources inside a subscription scope. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listAll(String scope, Context context) { @@ -259,23 +232,21 @@ public PagedIterable listAll(String scope, Context c /** * Get security sub-assessments on all your scanned resources inside a scope. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @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 security sub-assessments on all your scanned resources inside a scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * 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.")); + 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.")); @@ -288,39 +259,30 @@ private Mono> listSinglePageAsync(Stri 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)) + .>map(res -> new 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 Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @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 security sub-assessments on all your scanned resources inside a scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String scope, String assessmentName, Context context) { + 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.")); + 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.")); @@ -331,68 +293,59 @@ private Mono> listSinglePageAsync( 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)); + 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 Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @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 security sub-assessments on all your scanned resources inside a scope as paginated response with {@link - * PagedFlux}. + * @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)); + return new PagedFlux<>(() -> listSinglePageAsync(scope, assessmentName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** * Get security sub-assessments on all your scanned resources inside a scope. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @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 security sub-assessments on all your scanned resources inside a scope as paginated response with {@link - * PagedFlux}. + * @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), + 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 Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @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 security sub-assessments on all your scanned resources inside a scope as paginated response with {@link - * PagedIterable}. + * @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) { @@ -401,16 +354,16 @@ public PagedIterable list(String scope, String asses /** * Get security sub-assessments on all your scanned resources inside a scope. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @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 security sub-assessments on all your scanned resources inside a scope as paginated response with {@link - * PagedIterable}. + * @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) { @@ -419,25 +372,23 @@ public PagedIterable list(String scope, String asses /** * Get a security sub-assessment on your scanned resource. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param assessmentName The 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}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String scope, String assessmentName, String subAssessmentName) { + 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.")); + 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.")); @@ -452,25 +403,16 @@ private Mono> getWithResponseAsync( 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)) + .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 Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param assessmentName The 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. @@ -478,16 +420,14 @@ private Mono> getWithResponseAsync( * @throws ManagementException 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}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String scope, String assessmentName, String subAssessmentName, Context context) { + 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.")); + 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.")); @@ -502,15 +442,15 @@ private Mono> getWithResponseAsync( 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); + return service.get(this.client.getEndpoint(), apiVersion, scope, assessmentName, subAssessmentName, accept, + context); } /** * Get a security sub-assessment on your scanned resource. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param assessmentName The 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. @@ -526,9 +466,9 @@ private Mono getAsync(String scope, String assessmen /** * Get a security sub-assessment on your scanned resource. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param assessmentName The 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. @@ -538,16 +478,16 @@ private Mono getAsync(String scope, String assessmen * @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) { + 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 Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param assessmentName The 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. @@ -562,14 +502,15 @@ public SecuritySubAssessmentInner get(String scope, String assessmentName, Strin /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 security sub-assessments along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return list of security sub-assessments along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAllNextSinglePageAsync(String nextLink) { @@ -577,75 +518,58 @@ private Mono> listAllNextSinglePageAsy 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.")); + 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)) + .>map(res -> new 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 - *

The nextLink parameter. + * + * The nextLink 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 security sub-assessments along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return list of security sub-assessments along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync( - String nextLink, Context context) { + 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.")); + 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)); + 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)); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 security sub-assessments along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return list of security sub-assessments along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -653,37 +577,28 @@ private Mono> listNextSinglePageAsync( 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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 security sub-assessments along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return list of security sub-assessments along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -691,23 +606,13 @@ private Mono> listNextSinglePageAsync( 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.")); + 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)); + 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/SubAssessmentsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubAssessmentsImpl.java index ed66f565392b7..65469f631ba75 100644 --- 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 @@ -21,41 +21,38 @@ public final class SubAssessmentsImpl implements SubAssessments { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public SubAssessmentsImpl( - SubAssessmentsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + public SubAssessmentsImpl(SubAssessmentsClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable listAll(String scope) { PagedIterable inner = this.serviceClient().listAll(scope); - return Utils.mapPage(inner, inner1 -> new SecuritySubAssessmentImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new SecuritySubAssessmentImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecuritySubAssessmentImpl(inner1, this.manager())); } public PagedIterable list(String scope, String assessmentName) { PagedIterable inner = this.serviceClient().list(scope, assessmentName); - return Utils.mapPage(inner, inner1 -> new SecuritySubAssessmentImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new SecuritySubAssessmentImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecuritySubAssessmentImpl(inner1, this.manager())); } - public Response getWithResponse( - String scope, String assessmentName, String subAssessmentName, Context context) { - Response inner = - this.serviceClient().getWithResponse(scope, assessmentName, subAssessmentName, context); + public Response getWithResponse(String scope, String assessmentName, + String subAssessmentName, Context context) { + Response inner + = this.serviceClient().getWithResponse(scope, assessmentName, subAssessmentName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SecuritySubAssessmentImpl(inner.getValue(), this.manager())); } else { return null; 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 index 846466c0abe1b..a019dcc886b49 100644 --- 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 @@ -32,17 +32,23 @@ 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. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final TasksService service; - /** The service client containing this operation class. */ + /** + * 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) { @@ -57,229 +63,158 @@ public final class TasksClientImpl implements TasksClient { @Host("{$host}") @ServiceInterface(name = "SecurityCenterTasks") public interface TasksService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/tasks") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") 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"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegion( - @HostParam("$host") 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); + Mono> listByHomeRegion(@HostParam("$host") 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({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getSubscriptionLevelTask( - @HostParam("$host") 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); + Mono> getSubscriptionLevelTask(@HostParam("$host") 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"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}/{taskUpdateActionType}") - @ExpectedResponses({204}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}/{taskUpdateActionType}") + @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateSubscriptionLevelTaskState( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @PathParam("taskName") String taskName, + Mono> updateSubscriptionLevelTaskState(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("ascLocation") String ascLocation, @PathParam("taskName") String taskName, @PathParam("taskUpdateActionType") TaskUpdateActionType taskUpdateActionType, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") 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); + Mono> listByResourceGroup(@HostParam("$host") 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({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}") - @ExpectedResponses({200}) + @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("$host") 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); + Mono> getResourceGroupLevelTask(@HostParam("$host") 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"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}/{taskUpdateActionType}") - @ExpectedResponses({204}) + @Headers({ "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("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ascLocation") String ascLocation, + Mono> updateResourceGroupLevelTaskState(@HostParam("$host") 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, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByHomeRegionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * 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}. + * @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)) + .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}. + * @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)); + .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. @@ -293,7 +228,7 @@ private PagedFlux listAsync(String filter) { /** * 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}. @@ -306,7 +241,7 @@ private PagedFlux listAsync() { /** * 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. @@ -316,13 +251,13 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, context), nextLink -> listNextSinglePageAsync(nextLink, 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}. @@ -335,7 +270,7 @@ public 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. @@ -350,29 +285,25 @@ public PagedIterable list(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. + * 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}. + * @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -380,56 +311,36 @@ private Mono> listByHomeRegionSinglePageAsync(S 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)) + .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. + * 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}. + * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -438,30 +349,17 @@ private Mono> listByHomeRegionSinglePageAsync( 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)); + .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. + * locations. * @param filter OData filter. Optional. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -470,16 +368,15 @@ private Mono> listByHomeRegionSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByHomeRegionAsync(String ascLocation, String filter) { - return new PagedFlux<>( - () -> listByHomeRegionSinglePageAsync(ascLocation, 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. + * 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. @@ -488,16 +385,15 @@ private PagedFlux listByHomeRegionAsync(String ascLocation, S @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByHomeRegionAsync(String ascLocation) { final String filter = null; - return new PagedFlux<>( - () -> listByHomeRegionSinglePageAsync(ascLocation, 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. + * locations. * @param filter OData filter. Optional. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -507,16 +403,15 @@ private PagedFlux listByHomeRegionAsync(String ascLocation) { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByHomeRegionAsync(String ascLocation, String filter, Context context) { - return new PagedFlux<>( - () -> listByHomeRegionSinglePageAsync(ascLocation, filter, 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. + * 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. @@ -530,9 +425,9 @@ public 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. + * locations. * @param filter OData filter. Optional. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -547,30 +442,26 @@ public PagedIterable listByHomeRegion(String ascLocation, Str /** * 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. + * 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}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSubscriptionLevelTaskWithResponseAsync( - String ascLocation, String taskName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -581,47 +472,34 @@ private Mono> getSubscriptionLevelTaskWithResponseAs 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)) + .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. + * 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}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSubscriptionLevelTaskWithResponseAsync( - String ascLocation, String taskName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -632,28 +510,21 @@ private Mono> getSubscriptionLevelTaskWithResponseAs 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); + 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. + * 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}. + * @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) { @@ -663,9 +534,9 @@ private Mono getSubscriptionLevelTaskAsync(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. + * 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. @@ -674,16 +545,16 @@ private Mono getSubscriptionLevelTaskAsync(String ascLocation * @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) { + 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. + * 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. @@ -697,9 +568,9 @@ public SecurityTaskInner getSubscriptionLevelTask(String ascLocation, String tas /** * 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. + * 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. @@ -708,19 +579,15 @@ public SecurityTaskInner getSubscriptionLevelTask(String ascLocation, String tas * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSubscriptionLevelTaskStateWithResponseAsync( - String ascLocation, String taskName, TaskUpdateActionType taskUpdateActionType) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -735,26 +602,16 @@ private Mono> updateSubscriptionLevelTaskStateWithResponseAsync( final String apiVersion = "2015-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .updateSubscriptionLevelTaskState( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - taskName, - taskUpdateActionType, - accept, - context)) + .withContext(context -> service.updateSubscriptionLevelTaskState(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), ascLocation, taskName, taskUpdateActionType, 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. + * 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. @@ -764,19 +621,15 @@ private Mono> updateSubscriptionLevelTaskStateWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -791,23 +644,15 @@ private Mono> updateSubscriptionLevelTaskStateWithResponseAsync( final String apiVersion = "2015-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .updateSubscriptionLevelTaskState( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - taskName, - taskUpdateActionType, - accept, - context); + return service.updateSubscriptionLevelTaskState(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), ascLocation, taskName, taskUpdateActionType, 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. + * 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. @@ -816,17 +661,17 @@ private Mono> updateSubscriptionLevelTaskStateWithResponseAsync( * @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) { + 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. + * 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. @@ -836,17 +681,17 @@ private Mono updateSubscriptionLevelTaskStateAsync( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateSubscriptionLevelTaskStateWithResponse( - String ascLocation, String taskName, TaskUpdateActionType taskUpdateActionType, Context context) { + 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. + * 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. @@ -854,39 +699,35 @@ public Response updateSubscriptionLevelTaskStateWithResponse( * @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) { + 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 resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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}. + * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -898,59 +739,38 @@ private Mono> listByResourceGroupSinglePageAsyn 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)) + .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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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}. + * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -963,33 +783,19 @@ private Mono> listByResourceGroupSinglePageAsyn 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)); + .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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param filter OData filter. Optional. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -997,20 +803,19 @@ private Mono> listByResourceGroupSinglePageAsyn * @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), + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1019,18 +824,17 @@ private PagedFlux listByResourceGroupAsync( @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, String ascLocation) { final String filter = null; - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, ascLocation, 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param filter OData filter. Optional. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1039,8 +843,8 @@ private PagedFlux listByResourceGroupAsync(String resourceGro * @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) { + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String ascLocation, + String filter, Context context) { return new PagedFlux<>( () -> listByResourceGroupSinglePageAsync(resourceGroupName, ascLocation, filter, context), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); @@ -1048,11 +852,11 @@ private PagedFlux listByResourceGroupAsync( /** * Recommended tasks that will help improve the security of the subscription proactively. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1066,11 +870,11 @@ public PagedIterable listByResourceGroup(String resourceGroup /** * Recommended tasks that will help improve the security of the subscription proactively. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param filter OData filter. Optional. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1079,39 +883,35 @@ public PagedIterable listByResourceGroup(String resourceGroup * @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) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getResourceGroupLevelTaskWithResponseAsync( - String resourceGroupName, String ascLocation, String taskName) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1126,50 +926,36 @@ private Mono> getResourceGroupLevelTaskWithResponseA 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)) + .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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getResourceGroupLevelTaskWithResponseAsync( - String resourceGroupName, String ascLocation, String taskName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1184,46 +970,38 @@ private Mono> getResourceGroupLevelTaskWithResponseA 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); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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}. + * @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) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1232,18 +1010,18 @@ private Mono getResourceGroupLevelTaskAsync( * @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) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1257,11 +1035,11 @@ public SecurityTaskInner getResourceGroupLevelTask(String resourceGroupName, Str /** * Recommended tasks that will help improve the security of the subscription proactively. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1270,19 +1048,15 @@ public SecurityTaskInner getResourceGroupLevelTask(String resourceGroupName, Str * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1301,29 +1075,19 @@ private Mono> updateResourceGroupLevelTaskStateWithResponseAsync( final String apiVersion = "2015-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .updateResourceGroupLevelTaskState( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - taskName, - taskUpdateActionType, - accept, - context)) + .withContext(context -> service.updateResourceGroupLevelTaskState(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, ascLocation, taskName, taskUpdateActionType, 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1333,23 +1097,15 @@ private Mono> updateResourceGroupLevelTaskStateWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1368,26 +1124,18 @@ private Mono> updateResourceGroupLevelTaskStateWithResponseAsync( final String apiVersion = "2015-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .updateResourceGroupLevelTaskState( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - taskName, - taskUpdateActionType, - accept, - context); + return service.updateResourceGroupLevelTaskState(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, ascLocation, taskName, taskUpdateActionType, accept, + context); } /** * Recommended tasks that will help improve the security of the subscription proactively. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1396,20 +1144,19 @@ private Mono> updateResourceGroupLevelTaskStateWithResponseAsync( * @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()); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1419,24 +1166,19 @@ private Mono updateResourceGroupLevelTaskStateAsync( * @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(); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -1444,22 +1186,23 @@ public Response updateResourceGroupLevelTaskStateWithResponse( * @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); + public void updateResourceGroupLevelTaskState(String resourceGroupName, String ascLocation, String taskName, + TaskUpdateActionType taskUpdateActionType) { + updateResourceGroupLevelTaskStateWithResponse(resourceGroupName, ascLocation, taskName, taskUpdateActionType, + Context.NONE); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 security task recommendations along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @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) { @@ -1467,37 +1210,28 @@ private Mono> listNextSinglePageAsync(String ne 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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 security task recommendations along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @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) { @@ -1505,36 +1239,27 @@ private Mono> listNextSinglePageAsync(String ne 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.")); + 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)); + 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 - *

The nextLink parameter. + * + * The nextLink 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 security task recommendations along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @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) { @@ -1542,75 +1267,58 @@ private Mono> listByHomeRegionNextSinglePageAsy 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.")); + 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)) + .>map(res -> new 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 - *

The nextLink parameter. + * + * The nextLink 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 security task recommendations along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @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) { + 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.")); + 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)); + 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 - *

The nextLink parameter. + * + * The nextLink 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 security task recommendations along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @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) { @@ -1618,63 +1326,45 @@ private Mono> listByResourceGroupNextSinglePage 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.")); + 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)) + .>map(res -> new 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 - *

The nextLink parameter. + * + * The nextLink 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 security task recommendations along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @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) { + 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.")); + 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)); + 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/TasksImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TasksImpl.java index ec884a63c55c3..7def20fbf2b04 100644 --- 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 @@ -29,33 +29,30 @@ public TasksImpl(TasksClient innerClient, com.azure.resourcemanager.security.Sec public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new SecurityTaskImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new SecurityTaskImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityTaskImpl(inner1, this.manager())); } public PagedIterable listByHomeRegion(String ascLocation) { PagedIterable inner = this.serviceClient().listByHomeRegion(ascLocation); - return Utils.mapPage(inner, inner1 -> new SecurityTaskImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new SecurityTaskImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityTaskImpl(inner1, this.manager())); } - public Response getSubscriptionLevelTaskWithResponse( - String ascLocation, String taskName, Context context) { - Response inner = - this.serviceClient().getSubscriptionLevelTaskWithResponse(ascLocation, taskName, context); + public Response getSubscriptionLevelTaskWithResponse(String ascLocation, String taskName, + Context context) { + Response inner + = this.serviceClient().getSubscriptionLevelTaskWithResponse(ascLocation, taskName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SecurityTaskImpl(inner.getValue(), this.manager())); } else { return null; @@ -71,42 +68,36 @@ public SecurityTask getSubscriptionLevelTask(String ascLocation, String taskName } } - public Response updateSubscriptionLevelTaskStateWithResponse( - String ascLocation, String taskName, TaskUpdateActionType taskUpdateActionType, Context context) { - return this - .serviceClient() - .updateSubscriptionLevelTaskStateWithResponse(ascLocation, taskName, taskUpdateActionType, context); + 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) { + public void updateSubscriptionLevelTaskState(String ascLocation, String taskName, + TaskUpdateActionType taskUpdateActionType) { this.serviceClient().updateSubscriptionLevelTaskState(ascLocation, taskName, taskUpdateActionType); } public PagedIterable listByResourceGroup(String resourceGroupName, String ascLocation) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName, ascLocation); - return Utils.mapPage(inner, inner1 -> new SecurityTaskImpl(inner1, this.manager())); + 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 Utils.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 getResourceGroupLevelTaskWithResponse( - String resourceGroupName, String ascLocation, String taskName, Context context) { - Response inner = - this - .serviceClient() - .getResourceGroupLevelTaskWithResponse(resourceGroupName, ascLocation, taskName, context); + public Response getResourceGroupLevelTaskWithResponse(String resourceGroupName, String ascLocation, + String taskName, Context context) { + Response inner = this.serviceClient() + .getResourceGroupLevelTaskWithResponse(resourceGroupName, ascLocation, taskName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new SecurityTaskImpl(inner.getValue(), this.manager())); } else { return null; @@ -114,8 +105,8 @@ public Response getResourceGroupLevelTaskWithResponse( } public SecurityTask getResourceGroupLevelTask(String resourceGroupName, String ascLocation, String taskName) { - SecurityTaskInner inner = - this.serviceClient().getResourceGroupLevelTask(resourceGroupName, ascLocation, taskName); + SecurityTaskInner inner + = this.serviceClient().getResourceGroupLevelTask(resourceGroupName, ascLocation, taskName); if (inner != null) { return new SecurityTaskImpl(inner, this.manager()); } else { @@ -123,23 +114,16 @@ public SecurityTask getResourceGroupLevelTask(String resourceGroupName, String a } } - public Response updateResourceGroupLevelTaskStateWithResponse( - String resourceGroupName, - String ascLocation, - String taskName, - TaskUpdateActionType taskUpdateActionType, - Context context) { - return this - .serviceClient() - .updateResourceGroupLevelTaskStateWithResponse( - resourceGroupName, ascLocation, taskName, taskUpdateActionType, context); + 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 void updateResourceGroupLevelTaskState(String resourceGroupName, String ascLocation, String taskName, + TaskUpdateActionType taskUpdateActionType) { + this.serviceClient().updateResourceGroupLevelTaskState(resourceGroupName, ascLocation, taskName, + taskUpdateActionType); } private TasksClient serviceClient() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesClientImpl.java index 28a78eafba17b..25fc532781967 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesClientImpl.java @@ -30,22 +30,28 @@ import com.azure.resourcemanager.security.models.TopologyList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in TopologiesClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final TopologiesService service; - /** The service client containing this operation class. */ + /** + * 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.service + = RestProxy.create(TopologiesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -56,153 +62,111 @@ public final class TopologiesClientImpl implements TopologiesClient { @Host("{$host}") @ServiceInterface(name = "SecurityCenterTopolo") public interface TopologiesService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/topologies") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/topologies") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegion( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByHomeRegion(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("ascLocation") String ascLocation, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/topologies/{topologyResourceName}") - @ExpectedResponses({200}) + @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("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ascLocation") String ascLocation, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, @PathParam("topologyResourceName") String topologyResourceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByHomeRegionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context 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}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, + accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets 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}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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(), this.client.getSubscriptionId(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, 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}. + * @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() { @@ -211,27 +175,27 @@ private PagedFlux 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 - * PagedFlux}. + * @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)); + 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}. + * @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() { @@ -240,13 +204,13 @@ public 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 ManagementException thrown 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}. + * @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) { @@ -255,28 +219,24 @@ public PagedIterable list(Context 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. + * 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}. + * @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -284,54 +244,35 @@ private Mono> listByHomeRegionSinglePageAsy final String apiVersion = "2020-01-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByHomeRegion( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - ascLocation, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByHomeRegion(this.client.getEndpoint(), this.client.getSubscriptionId(), + ascLocation, apiVersion, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets 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. + * 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}. + * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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.")); @@ -340,66 +281,57 @@ private Mono> listByHomeRegionSinglePageAsy final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByHomeRegion( - this.client.getEndpoint(), this.client.getSubscriptionId(), ascLocation, apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByHomeRegion(this.client.getEndpoint(), this.client.getSubscriptionId(), ascLocation, apiVersion, + 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. + * 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}. + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByHomeRegionAsync(String ascLocation) { - return new PagedFlux<>( - () -> listByHomeRegionSinglePageAsync(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. + * 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}. + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByHomeRegionAsync(String ascLocation, Context context) { - return new PagedFlux<>( - () -> listByHomeRegionSinglePageAsync(ascLocation, 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. + * 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}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByHomeRegion(String ascLocation) { @@ -408,15 +340,15 @@ public 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. + * 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}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByHomeRegion(String ascLocation, Context context) { @@ -425,11 +357,11 @@ public PagedIterable listByHomeRegion(String ascLocation, /** * Gets a specific topology component. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -437,19 +369,15 @@ public PagedIterable listByHomeRegion(String ascLocation, * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -465,28 +393,18 @@ private Mono> getWithResponseAsync( final String apiVersion = "2020-01-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - topologyResourceName, - apiVersion, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, ascLocation, topologyResourceName, apiVersion, 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -495,19 +413,15 @@ private Mono> getWithResponseAsync( * @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) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -523,25 +437,17 @@ private Mono> getWithResponseAsync( final String apiVersion = "2020-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - topologyResourceName, - apiVersion, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, ascLocation, + topologyResourceName, apiVersion, accept, context); } /** * Gets a specific topology component. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -549,19 +455,19 @@ private Mono> getWithResponseAsync( * @return a specific topology component on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String ascLocation, String topologyResourceName) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -570,18 +476,18 @@ private Mono getAsync( * @return a specific topology component along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String ascLocation, String topologyResourceName, Context context) { + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -595,9 +501,10 @@ public TopologyResourceInner get(String resourceGroupName, String ascLocation, S /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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. @@ -609,31 +516,22 @@ private Mono> listNextSinglePageAsync(Strin 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -646,31 +544,22 @@ private Mono> listNextSinglePageAsync(Strin 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.")); + 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)); + 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -682,31 +571,23 @@ private Mono> listByHomeRegionNextSinglePag 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.")); + 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)) + .>map(res -> new 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 - *

The nextLink parameter. + * + * The nextLink 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. @@ -714,29 +595,19 @@ private Mono> listByHomeRegionNextSinglePag * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionNextSinglePageAsync( - String nextLink, Context context) { + 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.")); + 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)); + return service.listByHomeRegionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesImpl.java index 7aa969963df63..368bedb9ddc8d 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesImpl.java @@ -21,41 +21,38 @@ public final class TopologiesImpl implements Topologies { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public TopologiesImpl( - TopologiesClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + public TopologiesImpl(TopologiesClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new TopologyResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TopologyResourceImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new TopologyResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TopologyResourceImpl(inner1, this.manager())); } public PagedIterable listByHomeRegion(String ascLocation) { PagedIterable inner = this.serviceClient().listByHomeRegion(ascLocation); - return Utils.mapPage(inner, inner1 -> new TopologyResourceImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new TopologyResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TopologyResourceImpl(inner1, this.manager())); } - public Response getWithResponse( - String resourceGroupName, String ascLocation, String topologyResourceName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, ascLocation, topologyResourceName, context); + public Response getWithResponse(String resourceGroupName, String ascLocation, + String topologyResourceName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, ascLocation, topologyResourceName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new TopologyResourceImpl(inner.getValue(), this.manager())); } else { return null; 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 index 9a4e235014809..33b2c36fb7169 100644 --- 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 @@ -16,8 +16,8 @@ public final class TopologyResourceImpl implements TopologyResource { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - TopologyResourceImpl( - TopologyResourceInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + TopologyResourceImpl(TopologyResourceInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 index 2fdd469eb2601..495178a9739bf 100644 --- 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 @@ -45,22 +45,14 @@ private com.azure.resourcemanager.security.SecurityManager manager() { private String workspaceSettingName; public WorkspaceSetting create() { - this.innerObject = - serviceManager - .serviceClient() - .getWorkspaceSettings() - .createWithResponse(workspaceSettingName, this.innerModel(), Context.NONE) - .getValue(); + 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(); + this.innerObject = serviceManager.serviceClient().getWorkspaceSettings() + .createWithResponse(workspaceSettingName, this.innerModel(), context).getValue(); return this; } @@ -75,49 +67,33 @@ public WorkspaceSettingImpl update() { } public WorkspaceSetting apply() { - this.innerObject = - serviceManager - .serviceClient() - .getWorkspaceSettings() - .updateWithResponse(workspaceSettingName, this.innerModel(), Context.NONE) - .getValue(); + 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(); + this.innerObject = serviceManager.serviceClient().getWorkspaceSettings() + .updateWithResponse(workspaceSettingName, this.innerModel(), context).getValue(); return this; } - WorkspaceSettingImpl( - WorkspaceSettingInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { + WorkspaceSettingImpl(WorkspaceSettingInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.workspaceSettingName = Utils.getValueFromIdByName(innerObject.id(), "workspaceSettings"); + this.workspaceSettingName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaceSettings"); } public WorkspaceSetting refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getWorkspaceSettings() - .getWithResponse(workspaceSettingName, Context.NONE) - .getValue(); + 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(); + this.innerObject = serviceManager.serviceClient().getWorkspaceSettings() + .getWithResponse(workspaceSettingName, context).getValue(); 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 index 7c0ea16bebaca..0ca76484bc655 100644 --- 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 @@ -34,22 +34,28 @@ import com.azure.resourcemanager.security.models.WorkspaceSettingList; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in WorkspaceSettingsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final WorkspaceSettingsService service; - /** The service client containing this operation class. */ + /** + * 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.service + = RestProxy.create(WorkspaceSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -60,165 +66,122 @@ public final class WorkspaceSettingsClientImpl implements WorkspaceSettingsClien @Host("{$host}") @ServiceInterface(name = "SecurityCenterWorksp") public interface WorkspaceSettingsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("workspaceSettingName") String workspaceSettingName, - @HeaderParam("Accept") String accept, + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("workspaceSettingName") String workspaceSettingName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("workspaceSettingName") String workspaceSettingName, - @BodyParam("application/json") WorkspaceSettingInner workspaceSetting, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkspaceSettingInner workspaceSetting, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("workspaceSettingName") String workspaceSettingName, - @BodyParam("application/json") WorkspaceSettingInner workspaceSetting, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") WorkspaceSettingInner workspaceSetting, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}") - @ExpectedResponses({204}) + @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("workspaceSettingName") String workspaceSettingName, - @HeaderParam("Accept") String accept, + @PathParam("workspaceSettingName") String workspaceSettingName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") 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. - * + * * @throws ManagementException thrown 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}. + * @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)) + .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}. + * @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be 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)); + 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}. @@ -231,7 +194,7 @@ private PagedFlux 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. @@ -240,14 +203,14 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, 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}. @@ -260,7 +223,7 @@ public 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 ManagementException thrown if the request is rejected by server. @@ -275,27 +238,23 @@ public PagedIterable list(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}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (workspaceSettingName == null) { return Mono @@ -304,44 +263,32 @@ private Mono> getWithResponseAsync(String worksp 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)) + .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}. + * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (workspaceSettingName == null) { return Mono @@ -350,26 +297,20 @@ private Mono> getWithResponseAsync(String worksp 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); + 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String workspaceSettingName) { @@ -379,7 +320,7 @@ private Mono getAsync(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. - * + * * @param workspaceSettingName Name of the security setting. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -395,7 +336,7 @@ public Response getWithResponse(String workspaceSettingNa /** * 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. @@ -409,29 +350,25 @@ public 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String workspaceSettingName, WorkspaceSettingInner workspaceSetting) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (workspaceSettingName == null) { return Mono @@ -446,23 +383,14 @@ private Mono> createWithResponseAsync( final String apiVersion = "2017-08-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - workspaceSettingName, - workspaceSetting, - accept, - context)) + .withContext(context -> service.create(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), workspaceSettingName, workspaceSetting, accept, 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. @@ -470,22 +398,18 @@ private Mono> createWithResponseAsync( * @throws 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}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String workspaceSettingName, WorkspaceSettingInner workspaceSetting, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (workspaceSettingName == null) { return Mono @@ -500,38 +424,31 @@ private Mono> createWithResponseAsync( final String apiVersion = "2017-08-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - workspaceSettingName, - workspaceSetting, - accept, - context); + return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + workspaceSettingName, workspaceSetting, accept, 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String workspaceSettingName, WorkspaceSettingInner workspaceSetting) { + 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. @@ -541,14 +458,14 @@ private Mono createAsync( * @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) { + 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. @@ -563,29 +480,25 @@ public WorkspaceSettingInner create(String workspaceSettingName, WorkspaceSettin /** * 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}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String workspaceSettingName, WorkspaceSettingInner workspaceSetting) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (workspaceSettingName == null) { return Mono @@ -600,23 +513,14 @@ private Mono> updateWithResponseAsync( final String apiVersion = "2017-08-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - workspaceSettingName, - workspaceSetting, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), workspaceSettingName, workspaceSetting, accept, 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. @@ -624,22 +528,18 @@ private Mono> updateWithResponseAsync( * @throws 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}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String workspaceSettingName, WorkspaceSettingInner workspaceSetting, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (workspaceSettingName == null) { return Mono @@ -654,38 +554,31 @@ private Mono> updateWithResponseAsync( final String apiVersion = "2017-08-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - workspaceSettingName, - workspaceSetting, - accept, - context); + return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + workspaceSettingName, workspaceSetting, accept, 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}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String workspaceSettingName, WorkspaceSettingInner workspaceSetting) { + 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. @@ -695,14 +588,14 @@ private Mono updateAsync( * @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) { + 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. @@ -717,7 +610,7 @@ public WorkspaceSettingInner update(String workspaceSettingName, WorkspaceSettin /** * 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. @@ -727,16 +620,12 @@ public WorkspaceSettingInner update(String workspaceSettingName, WorkspaceSettin @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (workspaceSettingName == null) { return Mono @@ -745,22 +634,14 @@ private Mono> deleteWithResponseAsync(String workspaceSettingName final String apiVersion = "2017-08-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - workspaceSettingName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), workspaceSettingName, accept, 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. @@ -771,16 +652,12 @@ private Mono> deleteWithResponseAsync(String workspaceSettingName @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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (workspaceSettingName == null) { return Mono @@ -789,19 +666,13 @@ private Mono> deleteWithResponseAsync(String workspaceSettingName final String apiVersion = "2017-08-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - workspaceSettingName, - accept, - context); + return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + workspaceSettingName, accept, 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. @@ -815,7 +686,7 @@ private Mono deleteAsync(String workspaceSettingName) { /** * 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. @@ -830,7 +701,7 @@ public Response deleteWithResponse(String workspaceSettingName, Context co /** * 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. @@ -843,14 +714,15 @@ public void delete(String workspaceSettingName) { /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink 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 workspace settings response along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @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) { @@ -858,37 +730,28 @@ private Mono> listNextSinglePageAsync(Strin 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.")); + 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)) + 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 - *

The nextLink parameter. + * + * The nextLink 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 workspace settings response along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @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) { @@ -896,23 +759,13 @@ private Mono> listNextSinglePageAsync(Strin 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.")); + 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)); + 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 index 5917842ee7d16..766cb1dcc73ec 100644 --- 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 @@ -21,29 +21,26 @@ public final class WorkspaceSettingsImpl implements WorkspaceSettings { private final com.azure.resourcemanager.security.SecurityManager serviceManager; - public WorkspaceSettingsImpl( - WorkspaceSettingsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + public WorkspaceSettingsImpl(WorkspaceSettingsClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new WorkspaceSettingImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkspaceSettingImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new WorkspaceSettingImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkspaceSettingImpl(inner1, this.manager())); } public Response getWithResponse(String workspaceSettingName, Context context) { Response inner = this.serviceClient().getWithResponse(workspaceSettingName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new WorkspaceSettingImpl(inner.getValue(), this.manager())); } else { return null; @@ -68,53 +65,37 @@ public void delete(String workspaceSettingName) { } public WorkspaceSetting getById(String id) { - String workspaceSettingName = Utils.getValueFromIdByName(id, "workspaceSettings"); + 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))); + 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 = Utils.getValueFromIdByName(id, "workspaceSettings"); + 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))); + 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 = Utils.getValueFromIdByName(id, "workspaceSettings"); + 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))); + 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 = Utils.getValueFromIdByName(id, "workspaceSettings"); + 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))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaceSettings'.", id))); } return this.deleteWithResponse(workspaceSettingName, context); } 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 index 5a853f731e889..25e2d88d98644 100644 --- 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 @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the implementations for SecurityCenter. API spec for Microsoft.Security (Azure Security Center) - * resource provider. + * Package containing the implementations for SecurityCenter. + * API spec for Microsoft.Security (Azure Security Center) 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 index 72e27397e81a3..692f9c353be23 100644 --- 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 @@ -8,20 +8,28 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The connectivity state of the external AAD solution. */ +/** + * The connectivity state of the external AAD solution. + */ public final class AadConnectivityState extends ExpandableStringEnum { - /** Static value Discovered for AadConnectivityState. */ + /** + * Static value Discovered for AadConnectivityState. + */ public static final AadConnectivityState DISCOVERED = fromString("Discovered"); - /** Static value NotLicensed for AadConnectivityState. */ + /** + * Static value NotLicensed for AadConnectivityState. + */ public static final AadConnectivityState NOT_LICENSED = fromString("NotLicensed"); - /** Static value Connected for AadConnectivityState. */ + /** + * Static value Connected for AadConnectivityState. + */ public static final AadConnectivityState CONNECTED = fromString("Connected"); /** * Creates a new instance of AadConnectivityState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,7 +38,7 @@ public AadConnectivityState() { /** * Creates or finds a AadConnectivityState from its string representation. - * + * * @param name a name to look for. * @return the corresponding AadConnectivityState. */ @@ -41,7 +49,7 @@ public static AadConnectivityState fromString(String name) { /** * Gets known AadConnectivityState values. - * + * * @return known AadConnectivityState values. */ public static Collection values() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityStateAutoGenerated.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityStateAutoGenerated.java index 6cea9268f7e21..3793ecc192a6f 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityStateAutoGenerated.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityStateAutoGenerated.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Describes an Azure resource with kind. */ +/** + * Describes an Azure resource with kind. + */ @Fluent public class AadConnectivityStateAutoGenerated { /* @@ -16,13 +18,15 @@ public class AadConnectivityStateAutoGenerated { @JsonProperty(value = "connectivityState") private AadConnectivityState connectivityState; - /** Creates an instance of AadConnectivityStateAutoGenerated class. */ + /** + * Creates an instance of AadConnectivityStateAutoGenerated class. + */ public AadConnectivityStateAutoGenerated() { } /** * Get the connectivityState property: The connectivity state of the external AAD solution. - * + * * @return the connectivityState value. */ public AadConnectivityState connectivityState() { @@ -31,7 +35,7 @@ public AadConnectivityState connectivityState() { /** * Set the connectivityState property: The connectivity state of the external AAD solution. - * + * * @param connectivityState the connectivityState value to set. * @return the AadConnectivityStateAutoGenerated object itself. */ @@ -42,7 +46,7 @@ public AadConnectivityStateAutoGenerated withConnectivityState(AadConnectivitySt /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 400b5421f072c..e681f71836317 100644 --- 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 @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents an AAD identity protection solution which sends logs to an OMS workspace. */ +/** + * Represents an AAD identity protection solution which sends logs to an OMS workspace. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("AAD") @Fluent @@ -21,13 +23,15 @@ public final class AadExternalSecuritySolution extends ExternalSecuritySolutionI @JsonProperty(value = "properties") private AadSolutionProperties properties; - /** Creates an instance of AadExternalSecuritySolution class. */ + /** + * Creates an instance of AadExternalSecuritySolution class. + */ public AadExternalSecuritySolution() { } /** * Get the properties property: The external security solution properties for AAD solutions. - * + * * @return the properties value. */ public AadSolutionProperties properties() { @@ -36,7 +40,7 @@ public AadSolutionProperties properties() { /** * Set the properties property: The external security solution properties for AAD solutions. - * + * * @param properties the properties value to set. * @return the AadExternalSecuritySolution object itself. */ @@ -47,7 +51,7 @@ public AadExternalSecuritySolution withProperties(AadSolutionProperties properti /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 66c9643e1e5e5..19b2c7df3f4e9 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The external security solution properties for AAD solutions. */ +/** + * The external security solution properties for AAD solutions. + */ @Fluent public final class AadSolutionProperties extends ExternalSecuritySolutionProperties { /* @@ -16,13 +18,15 @@ public final class AadSolutionProperties extends ExternalSecuritySolutionPropert @JsonProperty(value = "connectivityState") private AadConnectivityState connectivityState; - /** Creates an instance of AadSolutionProperties class. */ + /** + * Creates an instance of AadSolutionProperties class. + */ public AadSolutionProperties() { } /** * Get the connectivityState property: The connectivity state of the external AAD solution. - * + * * @return the connectivityState value. */ public AadConnectivityState connectivityState() { @@ -31,7 +35,7 @@ public AadConnectivityState connectivityState() { /** * Set the connectivityState property: The connectivity state of the external AAD solution. - * + * * @param connectivityState the connectivityState value to set. * @return the AadSolutionProperties object itself. */ @@ -40,21 +44,27 @@ public AadSolutionProperties withConnectivityState(AadConnectivityState connecti return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AadSolutionProperties withDeviceVendor(String deviceVendor) { super.withDeviceVendor(deviceVendor); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AadSolutionProperties withDeviceType(String deviceType) { super.withDeviceType(deviceType); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AadSolutionProperties withWorkspace(ConnectedWorkspace workspace) { super.withWorkspace(workspace); @@ -63,7 +73,7 @@ public AadSolutionProperties withWorkspace(ConnectedWorkspace workspace) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 9f8d0c26c7956..e10d2e3b73718 100644 --- 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 @@ -8,20 +8,28 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The type of the action that will be triggered by the Automation. */ +/** + * The type of the action that will be triggered by the Automation. + */ public final class ActionType extends ExpandableStringEnum { - /** Static value LogicApp for ActionType. */ + /** + * Static value LogicApp for ActionType. + */ public static final ActionType LOGIC_APP = fromString("LogicApp"); - /** Static value EventHub for ActionType. */ + /** + * Static value EventHub for ActionType. + */ public static final ActionType EVENT_HUB = fromString("EventHub"); - /** Static value Workspace for ActionType. */ + /** + * Static value Workspace for ActionType. + */ public static final ActionType WORKSPACE = fromString("Workspace"); /** * Creates a new instance of ActionType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,7 +38,7 @@ public ActionType() { /** * Creates or finds a ActionType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ActionType. */ @@ -41,7 +49,7 @@ public static ActionType fromString(String name) { /** * Gets known ActionType values. - * + * * @return known ActionType values. */ public static Collection values() { 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 new file mode 100644 index 0000000000000..38c754d0aa607 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionableRemediation.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Configuration payload for PR Annotations. + */ +@Fluent +public final class ActionableRemediation { + /* + * ActionableRemediation Setting. + * None - the setting was never set. + * Enabled - ActionableRemediation is enabled. + * Disabled - ActionableRemediation is disabled. + */ + @JsonProperty(value = "state") + private ActionableRemediationState state; + + /* + * Gets or sets list of categories and severity levels. + */ + @JsonProperty(value = "categoryConfigurations") + private List categoryConfigurations; + + /* + * Repository branch configuration for PR Annotations. + */ + @JsonProperty(value = "branchConfiguration") + private TargetBranchConfiguration branchConfiguration; + + /* + * Update Settings. + * + * Enabled - Resource should inherit configurations from parent. + * Disabled - Resource should not inherit configurations from parent. + */ + @JsonProperty(value = "inheritFromParentState") + 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(); + } + } +} 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 new file mode 100644 index 0000000000000..3a7ee9c6462b4 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionableRemediationState.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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 { + /** + * Static value None for ActionableRemediationState. + */ + public static final ActionableRemediationState NONE = fromString("None"); + + /** + * Static value Disabled for ActionableRemediationState. + */ + public static final ActionableRemediationState DISABLED = fromString("Disabled"); + + /** + * Static value Enabled for ActionableRemediationState. + */ + 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. + */ + @JsonCreator + 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/ActiveConnectionsNotInAllowedRange.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActiveConnectionsNotInAllowedRange.java index b8f0145eb2882..6b7905f7e4d52 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActiveConnectionsNotInAllowedRange.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActiveConnectionsNotInAllowedRange.java @@ -9,37 +9,49 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.Duration; -/** Number of active connections is not in allowed range. */ +/** + * Number of active connections is not in allowed range. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") @JsonTypeName("ActiveConnectionsNotInAllowedRange") @Fluent public final class ActiveConnectionsNotInAllowedRange extends TimeWindowCustomAlertRule { - /** Creates an instance of ActiveConnectionsNotInAllowedRange class. */ + /** + * Creates an instance of ActiveConnectionsNotInAllowedRange class. + */ public ActiveConnectionsNotInAllowedRange() { } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ActiveConnectionsNotInAllowedRange withTimeWindowSize(Duration timeWindowSize) { super.withTimeWindowSize(timeWindowSize); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ActiveConnectionsNotInAllowedRange withMinThreshold(int minThreshold) { super.withMinThreshold(minThreshold); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ActiveConnectionsNotInAllowedRange withMaxThreshold(int maxThreshold) { super.withMaxThreshold(maxThreshold); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ActiveConnectionsNotInAllowedRange withIsEnabled(boolean isEnabled) { super.withIsEnabled(isEnabled); @@ -48,7 +60,7 @@ public ActiveConnectionsNotInAllowedRange withIsEnabled(boolean isEnabled) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlGroup.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlGroup.java index cb789472d0892..7f2d4319197a1 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlGroup.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlGroup.java @@ -9,32 +9,34 @@ import com.azure.resourcemanager.security.fluent.models.AdaptiveApplicationControlGroupInner; import java.util.List; -/** An immutable client-side representation of AdaptiveApplicationControlGroup. */ +/** + * An immutable client-side representation of AdaptiveApplicationControlGroup. + */ public interface AdaptiveApplicationControlGroup { /** * 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(); @@ -42,7 +44,7 @@ public interface AdaptiveApplicationControlGroup { /** * Gets the enforcementMode property: The application control policy enforcement/protection mode of the machine * group. - * + * * @return the enforcementMode value. */ EnforcementMode enforcementMode(); @@ -50,246 +52,281 @@ public interface AdaptiveApplicationControlGroup { /** * Gets the protectionMode property: The protection mode of the collection/file types. Exe/Msi/Script are used for * Windows, Executable is used for Linux. - * + * * @return the protectionMode value. */ ProtectionMode protectionMode(); /** * Gets the configurationStatus property: The configuration status of the machines group or machine or rule. - * + * * @return the configurationStatus value. */ ConfigurationStatus configurationStatus(); /** * Gets the recommendationStatus property: The initial recommendation status of the machine group or machine. - * + * * @return the recommendationStatus value. */ RecommendationStatus recommendationStatus(); /** * Gets the issues property: The issues property. - * + * * @return the issues value. */ List issues(); /** * Gets the sourceSystem property: The source type of the machine group. - * + * * @return the sourceSystem value. */ SourceSystem sourceSystem(); /** * Gets the vmRecommendations property: The vmRecommendations property. - * + * * @return the vmRecommendations value. */ List vmRecommendations(); /** * Gets the pathRecommendations property: The pathRecommendations property. - * + * * @return the pathRecommendations value. */ List pathRecommendations(); /** * 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 inner com.azure.resourcemanager.security.fluent.models.AdaptiveApplicationControlGroupInner object. - * + * * @return the inner object. */ AdaptiveApplicationControlGroupInner innerModel(); - /** The entirety of the AdaptiveApplicationControlGroup definition. */ + /** + * The entirety of the AdaptiveApplicationControlGroup definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The AdaptiveApplicationControlGroup definition stages. */ + + /** + * The AdaptiveApplicationControlGroup definition stages. + */ interface DefinitionStages { - /** The first stage of the AdaptiveApplicationControlGroup definition. */ + /** + * The first stage of the AdaptiveApplicationControlGroup definition. + */ interface Blank extends WithParentResource { } - /** The stage of the AdaptiveApplicationControlGroup definition allowing to specify parent resource. */ + + /** + * The stage of the AdaptiveApplicationControlGroup definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies ascLocation. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @return the next definition stage. */ WithCreate withExistingLocation(String ascLocation); } + /** * The stage of the AdaptiveApplicationControlGroup 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.WithEnforcementMode, - DefinitionStages.WithProtectionMode, - DefinitionStages.WithVmRecommendations, - DefinitionStages.WithPathRecommendations { + interface WithCreate extends DefinitionStages.WithEnforcementMode, DefinitionStages.WithProtectionMode, + DefinitionStages.WithVmRecommendations, DefinitionStages.WithPathRecommendations { /** * Executes the create request. - * + * * @return the created resource. */ AdaptiveApplicationControlGroup create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ AdaptiveApplicationControlGroup create(Context context); } - /** The stage of the AdaptiveApplicationControlGroup definition allowing to specify enforcementMode. */ + + /** + * The stage of the AdaptiveApplicationControlGroup definition allowing to specify enforcementMode. + */ interface WithEnforcementMode { /** * Specifies the enforcementMode property: The application control policy enforcement/protection mode of the * machine group. - * + * * @param enforcementMode The application control policy enforcement/protection mode of the machine group. * @return the next definition stage. */ WithCreate withEnforcementMode(EnforcementMode enforcementMode); } - /** The stage of the AdaptiveApplicationControlGroup definition allowing to specify protectionMode. */ + + /** + * The stage of the AdaptiveApplicationControlGroup definition allowing to specify protectionMode. + */ interface WithProtectionMode { /** * Specifies the protectionMode property: The protection mode of the collection/file types. Exe/Msi/Script * are used for Windows, Executable is used for Linux.. - * + * * @param protectionMode The protection mode of the collection/file types. Exe/Msi/Script are used for - * Windows, Executable is used for Linux. + * Windows, Executable is used for Linux. * @return the next definition stage. */ WithCreate withProtectionMode(ProtectionMode protectionMode); } - /** The stage of the AdaptiveApplicationControlGroup definition allowing to specify vmRecommendations. */ + + /** + * The stage of the AdaptiveApplicationControlGroup definition allowing to specify vmRecommendations. + */ interface WithVmRecommendations { /** * Specifies the vmRecommendations property: The vmRecommendations property.. - * + * * @param vmRecommendations The vmRecommendations property. * @return the next definition stage. */ WithCreate withVmRecommendations(List vmRecommendations); } - /** The stage of the AdaptiveApplicationControlGroup definition allowing to specify pathRecommendations. */ + + /** + * The stage of the AdaptiveApplicationControlGroup definition allowing to specify pathRecommendations. + */ interface WithPathRecommendations { /** * Specifies the pathRecommendations property: The pathRecommendations property.. - * + * * @param pathRecommendations The pathRecommendations property. * @return the next definition stage. */ WithCreate withPathRecommendations(List pathRecommendations); } } + /** * Begins update for the AdaptiveApplicationControlGroup resource. - * + * * @return the stage of resource update. */ AdaptiveApplicationControlGroup.Update update(); - /** The template for AdaptiveApplicationControlGroup update. */ - interface Update - extends UpdateStages.WithEnforcementMode, - UpdateStages.WithProtectionMode, - UpdateStages.WithVmRecommendations, - UpdateStages.WithPathRecommendations { + /** + * The template for AdaptiveApplicationControlGroup update. + */ + interface Update extends UpdateStages.WithEnforcementMode, UpdateStages.WithProtectionMode, + UpdateStages.WithVmRecommendations, UpdateStages.WithPathRecommendations { /** * Executes the update request. - * + * * @return the updated resource. */ AdaptiveApplicationControlGroup apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ AdaptiveApplicationControlGroup apply(Context context); } - /** The AdaptiveApplicationControlGroup update stages. */ + + /** + * The AdaptiveApplicationControlGroup update stages. + */ interface UpdateStages { - /** The stage of the AdaptiveApplicationControlGroup update allowing to specify enforcementMode. */ + /** + * The stage of the AdaptiveApplicationControlGroup update allowing to specify enforcementMode. + */ interface WithEnforcementMode { /** * Specifies the enforcementMode property: The application control policy enforcement/protection mode of the * machine group. - * + * * @param enforcementMode The application control policy enforcement/protection mode of the machine group. * @return the next definition stage. */ Update withEnforcementMode(EnforcementMode enforcementMode); } - /** The stage of the AdaptiveApplicationControlGroup update allowing to specify protectionMode. */ + + /** + * The stage of the AdaptiveApplicationControlGroup update allowing to specify protectionMode. + */ interface WithProtectionMode { /** * Specifies the protectionMode property: The protection mode of the collection/file types. Exe/Msi/Script * are used for Windows, Executable is used for Linux.. - * + * * @param protectionMode The protection mode of the collection/file types. Exe/Msi/Script are used for - * Windows, Executable is used for Linux. + * Windows, Executable is used for Linux. * @return the next definition stage. */ Update withProtectionMode(ProtectionMode protectionMode); } - /** The stage of the AdaptiveApplicationControlGroup update allowing to specify vmRecommendations. */ + + /** + * The stage of the AdaptiveApplicationControlGroup update allowing to specify vmRecommendations. + */ interface WithVmRecommendations { /** * Specifies the vmRecommendations property: The vmRecommendations property.. - * + * * @param vmRecommendations The vmRecommendations property. * @return the next definition stage. */ Update withVmRecommendations(List vmRecommendations); } - /** The stage of the AdaptiveApplicationControlGroup update allowing to specify pathRecommendations. */ + + /** + * The stage of the AdaptiveApplicationControlGroup update allowing to specify pathRecommendations. + */ interface WithPathRecommendations { /** * Specifies the pathRecommendations property: The pathRecommendations property.. - * + * * @param pathRecommendations The pathRecommendations property. * @return the next definition stage. */ Update withPathRecommendations(List pathRecommendations); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ AdaptiveApplicationControlGroup refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlGroups.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlGroups.java index a394948e92051..259c22a7be243 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlGroups.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlGroups.java @@ -7,18 +7,20 @@ import com.azure.resourcemanager.security.fluent.models.AdaptiveApplicationControlGroupsInner; import java.util.List; -/** An immutable client-side representation of AdaptiveApplicationControlGroups. */ +/** + * An immutable client-side representation of AdaptiveApplicationControlGroups. + */ public interface AdaptiveApplicationControlGroups { /** * Gets the value property: The value property. - * + * * @return the value value. */ List value(); /** * Gets the inner com.azure.resourcemanager.security.fluent.models.AdaptiveApplicationControlGroupsInner object. - * + * * @return the inner object. */ AdaptiveApplicationControlGroupsInner innerModel(); diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlIssue.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlIssue.java index a4c59fbd56e6c..660a6b156bc5c 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlIssue.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlIssue.java @@ -8,32 +8,46 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** An alert that machines within a group can have. */ +/** + * An alert that machines within a group can have. + */ public final class AdaptiveApplicationControlIssue extends ExpandableStringEnum { - /** Static value ViolationsAudited for AdaptiveApplicationControlIssue. */ + /** + * Static value ViolationsAudited for AdaptiveApplicationControlIssue. + */ public static final AdaptiveApplicationControlIssue VIOLATIONS_AUDITED = fromString("ViolationsAudited"); - /** Static value ViolationsBlocked for AdaptiveApplicationControlIssue. */ + /** + * Static value ViolationsBlocked for AdaptiveApplicationControlIssue. + */ public static final AdaptiveApplicationControlIssue VIOLATIONS_BLOCKED = fromString("ViolationsBlocked"); - /** Static value MsiAndScriptViolationsAudited for AdaptiveApplicationControlIssue. */ - public static final AdaptiveApplicationControlIssue MSI_AND_SCRIPT_VIOLATIONS_AUDITED = - fromString("MsiAndScriptViolationsAudited"); + /** + * Static value MsiAndScriptViolationsAudited for AdaptiveApplicationControlIssue. + */ + public static final AdaptiveApplicationControlIssue MSI_AND_SCRIPT_VIOLATIONS_AUDITED + = fromString("MsiAndScriptViolationsAudited"); - /** Static value MsiAndScriptViolationsBlocked for AdaptiveApplicationControlIssue. */ - public static final AdaptiveApplicationControlIssue MSI_AND_SCRIPT_VIOLATIONS_BLOCKED = - fromString("MsiAndScriptViolationsBlocked"); + /** + * Static value MsiAndScriptViolationsBlocked for AdaptiveApplicationControlIssue. + */ + public static final AdaptiveApplicationControlIssue MSI_AND_SCRIPT_VIOLATIONS_BLOCKED + = fromString("MsiAndScriptViolationsBlocked"); - /** Static value ExecutableViolationsAudited for AdaptiveApplicationControlIssue. */ - public static final AdaptiveApplicationControlIssue EXECUTABLE_VIOLATIONS_AUDITED = - fromString("ExecutableViolationsAudited"); + /** + * Static value ExecutableViolationsAudited for AdaptiveApplicationControlIssue. + */ + public static final AdaptiveApplicationControlIssue EXECUTABLE_VIOLATIONS_AUDITED + = fromString("ExecutableViolationsAudited"); - /** Static value RulesViolatedManually for AdaptiveApplicationControlIssue. */ + /** + * Static value RulesViolatedManually for AdaptiveApplicationControlIssue. + */ public static final AdaptiveApplicationControlIssue RULES_VIOLATED_MANUALLY = fromString("RulesViolatedManually"); /** * Creates a new instance of AdaptiveApplicationControlIssue value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -42,7 +56,7 @@ public AdaptiveApplicationControlIssue() { /** * Creates or finds a AdaptiveApplicationControlIssue from its string representation. - * + * * @param name a name to look for. * @return the corresponding AdaptiveApplicationControlIssue. */ @@ -53,7 +67,7 @@ public static AdaptiveApplicationControlIssue fromString(String name) { /** * Gets known AdaptiveApplicationControlIssue values. - * + * * @return known AdaptiveApplicationControlIssue values. */ public static Collection values() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlIssueSummary.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlIssueSummary.java index 57abcac239b7e..dedc12ab3abfb 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlIssueSummary.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlIssueSummary.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Represents a summary of the alerts of the machine group. */ +/** + * Represents a summary of the alerts of the machine group. + */ @Fluent public final class AdaptiveApplicationControlIssueSummary { /* @@ -22,13 +24,15 @@ public final class AdaptiveApplicationControlIssueSummary { @JsonProperty(value = "numberOfVms") private Float numberOfVms; - /** Creates an instance of AdaptiveApplicationControlIssueSummary class. */ + /** + * Creates an instance of AdaptiveApplicationControlIssueSummary class. + */ public AdaptiveApplicationControlIssueSummary() { } /** * Get the issue property: An alert that machines within a group can have. - * + * * @return the issue value. */ public AdaptiveApplicationControlIssue issue() { @@ -37,7 +41,7 @@ public AdaptiveApplicationControlIssue issue() { /** * Set the issue property: An alert that machines within a group can have. - * + * * @param issue the issue value to set. * @return the AdaptiveApplicationControlIssueSummary object itself. */ @@ -48,7 +52,7 @@ public AdaptiveApplicationControlIssueSummary withIssue(AdaptiveApplicationContr /** * Get the numberOfVms property: The number of machines in the group that have this alert. - * + * * @return the numberOfVms value. */ public Float numberOfVms() { @@ -57,7 +61,7 @@ public Float numberOfVms() { /** * Set the numberOfVms property: The number of machines in the group that have this alert. - * + * * @param numberOfVms the numberOfVms value to set. * @return the AdaptiveApplicationControlIssueSummary object itself. */ @@ -68,7 +72,7 @@ public AdaptiveApplicationControlIssueSummary withNumberOfVms(Float numberOfVms) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControls.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControls.java index e2584d847eb74..f6dc614ced7c3 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControls.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControls.java @@ -7,11 +7,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of AdaptiveApplicationControls. */ +/** + * Resource collection API of AdaptiveApplicationControls. + */ public interface AdaptiveApplicationControls { /** * Gets a list of application control machine groups for the subscription. - * + * * @param includePathRecommendations Include the policy rules. * @param summary Return output in a summarized form. * @param context The context to associate with this operation. @@ -20,12 +22,12 @@ public interface AdaptiveApplicationControls { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of application control machine groups for the subscription along with {@link Response}. */ - Response listWithResponse( - Boolean includePathRecommendations, Boolean summary, Context context); + Response listWithResponse(Boolean includePathRecommendations, Boolean summary, + Context context); /** * Gets a list of application control machine groups 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 application control machine groups for the subscription. @@ -34,9 +36,9 @@ Response listWithResponse( /** * Gets an application control VM/server group. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param groupName Name of an application control machine group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -48,9 +50,9 @@ Response listWithResponse( /** * Gets an application control VM/server group. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param groupName Name of an application control machine group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -61,9 +63,9 @@ Response listWithResponse( /** * Delete an application control machine group. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param groupName Name of an application control machine group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -75,9 +77,9 @@ Response listWithResponse( /** * Delete an application control machine group. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param groupName Name of an application control machine group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -87,7 +89,7 @@ Response listWithResponse( /** * Gets an application control VM/server 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. @@ -98,7 +100,7 @@ Response listWithResponse( /** * Gets an application control VM/server group. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -110,7 +112,7 @@ Response listWithResponse( /** * Delete an application control machine 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. @@ -120,7 +122,7 @@ Response listWithResponse( /** * Delete an application control machine group. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -132,7 +134,7 @@ Response listWithResponse( /** * Begins definition for a new AdaptiveApplicationControlGroup resource. - * + * * @param name resource name. * @return the first stage of the new AdaptiveApplicationControlGroup definition. */ diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveNetworkHardening.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveNetworkHardening.java index 8cd1c579fa38c..7909db507d640 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveNetworkHardening.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveNetworkHardening.java @@ -8,39 +8,41 @@ import java.time.OffsetDateTime; import java.util.List; -/** An immutable client-side representation of AdaptiveNetworkHardening. */ +/** + * An immutable client-side representation of AdaptiveNetworkHardening. + */ public interface AdaptiveNetworkHardening { /** * 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 rules property: The security rules which are recommended to be effective on the VM. - * + * * @return the rules value. */ List rules(); /** * Gets the rulesCalculationTime property: The UTC time on which the rules were calculated. - * + * * @return the rulesCalculationTime value. */ OffsetDateTime rulesCalculationTime(); @@ -48,14 +50,14 @@ public interface AdaptiveNetworkHardening { /** * Gets the effectiveNetworkSecurityGroups property: The Network Security Groups effective on the network interfaces * of the protected resource. - * + * * @return the effectiveNetworkSecurityGroups value. */ List effectiveNetworkSecurityGroups(); /** * Gets the inner com.azure.resourcemanager.security.fluent.models.AdaptiveNetworkHardeningInner object. - * + * * @return the inner object. */ AdaptiveNetworkHardeningInner innerModel(); diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveNetworkHardeningEnforceRequest.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveNetworkHardeningEnforceRequest.java index 0c6dfdd280f70..0e95b9a6fe2dc 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveNetworkHardeningEnforceRequest.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveNetworkHardeningEnforceRequest.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The AdaptiveNetworkHardeningEnforceRequest model. */ +/** + * The AdaptiveNetworkHardeningEnforceRequest model. + */ @Fluent public final class AdaptiveNetworkHardeningEnforceRequest { /* @@ -25,13 +27,15 @@ public final class AdaptiveNetworkHardeningEnforceRequest { @JsonProperty(value = "networkSecurityGroups", required = true) private List networkSecurityGroups; - /** Creates an instance of AdaptiveNetworkHardeningEnforceRequest class. */ + /** + * Creates an instance of AdaptiveNetworkHardeningEnforceRequest class. + */ public AdaptiveNetworkHardeningEnforceRequest() { } /** * Get the rules property: The rules to enforce. - * + * * @return the rules value. */ public List rules() { @@ -40,7 +44,7 @@ public List rules() { /** * Set the rules property: The rules to enforce. - * + * * @param rules the rules value to set. * @return the AdaptiveNetworkHardeningEnforceRequest object itself. */ @@ -50,9 +54,9 @@ public AdaptiveNetworkHardeningEnforceRequest withRules(List rules) { } /** - * Get the networkSecurityGroups property: The Azure resource IDs of the effective network security groups that will - * be updated with the created security rules from the Adaptive Network Hardening rules. - * + * Get the networkSecurityGroups property: The Azure resource IDs of the effective network security groups that + * will be updated with the created security rules from the Adaptive Network Hardening rules. + * * @return the networkSecurityGroups value. */ public List networkSecurityGroups() { @@ -60,9 +64,9 @@ public List networkSecurityGroups() { } /** - * Set the networkSecurityGroups property: The Azure resource IDs of the effective network security groups that will - * be updated with the created security rules from the Adaptive Network Hardening rules. - * + * Set the networkSecurityGroups property: The Azure resource IDs of the effective network security groups that + * will be updated with the created security rules from the Adaptive Network Hardening rules. + * * @param networkSecurityGroups the networkSecurityGroups value to set. * @return the AdaptiveNetworkHardeningEnforceRequest object itself. */ @@ -73,24 +77,19 @@ public AdaptiveNetworkHardeningEnforceRequest withNetworkSecurityGroups(List e.validate()); } if (networkSecurityGroups() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property networkSecurityGroups in model" - + " AdaptiveNetworkHardeningEnforceRequest")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property networkSecurityGroups in model AdaptiveNetworkHardeningEnforceRequest")); } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveNetworkHardenings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveNetworkHardenings.java index 735512030947b..2adb4a994600a 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveNetworkHardenings.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveNetworkHardenings.java @@ -8,13 +8,15 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of AdaptiveNetworkHardenings. */ +/** + * Resource collection API of AdaptiveNetworkHardenings. + */ public interface AdaptiveNetworkHardenings { /** * Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -22,16 +24,16 @@ public interface AdaptiveNetworkHardenings { * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of Adaptive Network Hardenings resources in scope of an extended resource as paginated response - * with {@link PagedIterable}. + * with {@link PagedIterable}. */ - PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName); + PagedIterable listByExtendedResource(String resourceGroupName, String resourceNamespace, + String resourceType, String resourceName); /** * Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -40,16 +42,16 @@ PagedIterable listByExtendedResource( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of Adaptive Network Hardenings resources in scope of an extended resource as paginated response - * with {@link PagedIterable}. + * with {@link PagedIterable}. */ - PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context); + PagedIterable listByExtendedResource(String resourceGroupName, String resourceNamespace, + String resourceType, String resourceName, Context context); /** * Gets a single Adaptive Network Hardening resource. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -60,19 +62,14 @@ PagedIterable listByExtendedResource( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single Adaptive Network Hardening resource along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - Context context); + Response getWithResponse(String resourceGroupName, String resourceNamespace, + String resourceType, String resourceName, String adaptiveNetworkHardeningResourceName, Context context); /** * Gets a single Adaptive Network Hardening resource. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -82,18 +79,14 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single Adaptive Network Hardening resource. */ - AdaptiveNetworkHardening get( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName); + AdaptiveNetworkHardening get(String resourceGroupName, String resourceNamespace, String resourceType, + String resourceName, String adaptiveNetworkHardeningResourceName); /** * Enforces the given rules on the NSG(s) listed in the request. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -103,19 +96,14 @@ AdaptiveNetworkHardening get( * @throws com.azure.core.management.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 enforce( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body); + void enforce(String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, + String adaptiveNetworkHardeningResourceName, AdaptiveNetworkHardeningEnforceRequest body); /** * Enforces the given rules on the NSG(s) listed in the request. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param resourceNamespace The Namespace of the resource. * @param resourceType The type of the resource. * @param resourceName Name of the resource. @@ -126,12 +114,6 @@ void enforce( * @throws com.azure.core.management.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 enforce( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body, - Context context); + void enforce(String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, + String adaptiveNetworkHardeningResourceName, AdaptiveNetworkHardeningEnforceRequest body, Context context); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveNetworkHardeningsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveNetworkHardeningsList.java index f4c80bcc0897b..45483b050a143 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveNetworkHardeningsList.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveNetworkHardeningsList.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Response for ListAdaptiveNetworkHardenings API service call. */ +/** + * Response for ListAdaptiveNetworkHardenings API service call. + */ @Fluent public final class AdaptiveNetworkHardeningsList { /* @@ -24,13 +26,15 @@ public final class AdaptiveNetworkHardeningsList { @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of AdaptiveNetworkHardeningsList class. */ + /** + * Creates an instance of AdaptiveNetworkHardeningsList class. + */ public AdaptiveNetworkHardeningsList() { } /** * Get the value property: A list of Adaptive Network Hardenings resources. - * + * * @return the value value. */ public List value() { @@ -39,7 +43,7 @@ public List value() { /** * Set the value property: A list of Adaptive Network Hardenings resources. - * + * * @param value the value value to set. * @return the AdaptiveNetworkHardeningsList object itself. */ @@ -50,7 +54,7 @@ public AdaptiveNetworkHardeningsList withValue(List { - /** Static value Alerts for AdditionalWorkspaceDataType. */ + /** + * Static value Alerts for AdditionalWorkspaceDataType. + */ public static final AdditionalWorkspaceDataType ALERTS = fromString("Alerts"); - /** Static value RawEvents for AdditionalWorkspaceDataType. */ + /** + * Static value RawEvents for AdditionalWorkspaceDataType. + */ public static final AdditionalWorkspaceDataType RAW_EVENTS = fromString("RawEvents"); /** * Creates a new instance of AdditionalWorkspaceDataType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +33,7 @@ public AdditionalWorkspaceDataType() { /** * Creates or finds a AdditionalWorkspaceDataType from its string representation. - * + * * @param name a name to look for. * @return the corresponding AdditionalWorkspaceDataType. */ @@ -38,7 +44,7 @@ public static AdditionalWorkspaceDataType fromString(String name) { /** * Gets known AdditionalWorkspaceDataType values. - * + * * @return known AdditionalWorkspaceDataType values. */ public static Collection values() { 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 index e893e00c1bbcf..51f98a039b2ba 100644 --- 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 @@ -8,14 +8,18 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Workspace type. */ +/** + * Workspace type. + */ public final class AdditionalWorkspaceType extends ExpandableStringEnum { - /** Static value Sentinel for AdditionalWorkspaceType. */ + /** + * Static value Sentinel for AdditionalWorkspaceType. + */ public static final AdditionalWorkspaceType SENTINEL = fromString("Sentinel"); /** * Creates a new instance of AdditionalWorkspaceType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -24,7 +28,7 @@ public AdditionalWorkspaceType() { /** * Creates or finds a AdditionalWorkspaceType from its string representation. - * + * * @param name a name to look for. * @return the corresponding AdditionalWorkspaceType. */ @@ -35,7 +39,7 @@ public static AdditionalWorkspaceType fromString(String name) { /** * Gets known AdditionalWorkspaceType values. - * + * * @return known AdditionalWorkspaceType values. */ public static Collection values() { 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 index 7cd4c486ec2d6..83f3eef478b31 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Properties of the additional workspaces. */ +/** + * Properties of the additional workspaces. + */ @Fluent public final class AdditionalWorkspacesProperties { /* @@ -29,13 +31,15 @@ public final class AdditionalWorkspacesProperties { @JsonProperty(value = "dataTypes") private List dataTypes; - /** Creates an instance of AdditionalWorkspacesProperties class. */ + /** + * Creates an instance of AdditionalWorkspacesProperties class. + */ public AdditionalWorkspacesProperties() { } /** * Get the workspace property: Workspace resource id. - * + * * @return the workspace value. */ public String workspace() { @@ -44,7 +48,7 @@ public String workspace() { /** * Set the workspace property: Workspace resource id. - * + * * @param workspace the workspace value to set. * @return the AdditionalWorkspacesProperties object itself. */ @@ -55,7 +59,7 @@ public AdditionalWorkspacesProperties withWorkspace(String workspace) { /** * Get the type property: Workspace type. - * + * * @return the type value. */ public AdditionalWorkspaceType type() { @@ -64,7 +68,7 @@ public AdditionalWorkspaceType type() { /** * Set the type property: Workspace type. - * + * * @param type the type value to set. * @return the AdditionalWorkspacesProperties object itself. */ @@ -75,7 +79,7 @@ public AdditionalWorkspacesProperties withType(AdditionalWorkspaceType type) { /** * Get the dataTypes property: List of data types sent to workspace. - * + * * @return the dataTypes value. */ public List dataTypes() { @@ -84,7 +88,7 @@ public List dataTypes() { /** * Set the dataTypes property: List of data types sent to workspace. - * + * * @param dataTypes the dataTypes value to set. * @return the AdditionalWorkspacesProperties object itself. */ @@ -95,7 +99,7 @@ public AdditionalWorkspacesProperties withDataTypes(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(); @@ -162,21 +164,21 @@ public interface Alert { * 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(); @@ -184,7 +186,7 @@ public interface Alert { /** * 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(); @@ -192,49 +194,49 @@ public interface Alert { /** * 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 index b835d2cab6fbb..1f984f888d8de 100644 --- 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 @@ -12,7 +12,9 @@ import java.util.HashMap; import java.util.Map; -/** Changing set of properties depending on the entity type. */ +/** + * Changing set of properties depending on the entity type. + */ @Fluent public final class AlertEntity { /* @@ -24,15 +26,18 @@ public final class AlertEntity { /* * Changing set of properties depending on the entity type. */ - @JsonIgnore private Map additionalProperties; + @JsonIgnore + private Map additionalProperties; - /** Creates an instance of AlertEntity class. */ + /** + * Creates an instance of AlertEntity class. + */ public AlertEntity() { } /** * Get the type property: Type of entity. - * + * * @return the type value. */ public String type() { @@ -41,7 +46,7 @@ public String type() { /** * Get the additionalProperties property: Changing set of properties depending on the entity type. - * + * * @return the additionalProperties value. */ @JsonAnyGetter @@ -51,7 +56,7 @@ public Map additionalProperties() { /** * Set the additionalProperties property: Changing set of properties depending on the entity type. - * + * * @param additionalProperties the additionalProperties value to set. * @return the AlertEntity object itself. */ @@ -70,7 +75,7 @@ void withAdditionalProperties(String key, Object value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertList.java index 3e5b19511e577..3e68de674d551 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertList.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertList.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of security alerts. */ +/** + * List of security alerts. + */ @Fluent public final class AlertList { /* @@ -24,13 +26,15 @@ public final class AlertList { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of AlertList class. */ + /** + * Creates an instance of AlertList class. + */ public AlertList() { } /** * Get the value property: describes security alert properties. - * + * * @return the value value. */ public List value() { @@ -39,7 +43,7 @@ public List value() { /** * Set the value property: describes security alert properties. - * + * * @param value the value value to set. * @return the AlertList object itself. */ @@ -50,7 +54,7 @@ public AlertList withValue(List value) { /** * Get the nextLink property: The URI to fetch the next page. - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +63,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index b0e6a2f61c503..a26abb60d3f03 100644 --- 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 @@ -12,7 +12,9 @@ import java.util.HashMap; import java.util.Map; -/** Changing set of properties depending on the supportingEvidence type. */ +/** + * Changing set of properties depending on the supportingEvidence type. + */ @Fluent public final class AlertPropertiesSupportingEvidence { /* @@ -24,15 +26,18 @@ public final class AlertPropertiesSupportingEvidence { /* * Changing set of properties depending on the supportingEvidence type. */ - @JsonIgnore private Map additionalProperties; + @JsonIgnore + private Map additionalProperties; - /** Creates an instance of AlertPropertiesSupportingEvidence class. */ + /** + * Creates an instance of AlertPropertiesSupportingEvidence class. + */ public AlertPropertiesSupportingEvidence() { } /** * Get the type property: Type of the supportingEvidence. - * + * * @return the type value. */ public String type() { @@ -41,7 +46,7 @@ public String type() { /** * Get the additionalProperties property: Changing set of properties depending on the supportingEvidence type. - * + * * @return the additionalProperties value. */ @JsonAnyGetter @@ -51,7 +56,7 @@ public Map additionalProperties() { /** * Set the additionalProperties property: Changing set of properties depending on the supportingEvidence type. - * + * * @param additionalProperties the additionalProperties value to set. * @return the AlertPropertiesSupportingEvidence object itself. */ @@ -70,7 +75,7 @@ void withAdditionalProperties(String key, Object value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 52eb272a6f137..70543515ed02d 100644 --- 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 @@ -13,21 +13,29 @@ * https://docs.microsoft.com/en-us/azure/security-center/security-center-alerts-overview#how-are-alerts-classified. */ public final class AlertSeverity extends ExpandableStringEnum { - /** Static value Informational for AlertSeverity. */ + /** + * Static value Informational for AlertSeverity. + */ public static final AlertSeverity INFORMATIONAL = fromString("Informational"); - /** Static value Low for AlertSeverity. */ + /** + * Static value Low for AlertSeverity. + */ public static final AlertSeverity LOW = fromString("Low"); - /** Static value Medium for AlertSeverity. */ + /** + * Static value Medium for AlertSeverity. + */ public static final AlertSeverity MEDIUM = fromString("Medium"); - /** Static value High for AlertSeverity. */ + /** + * Static value High for AlertSeverity. + */ public static final AlertSeverity HIGH = fromString("High"); /** * Creates a new instance of AlertSeverity value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -36,7 +44,7 @@ public AlertSeverity() { /** * Creates or finds a AlertSeverity from its string representation. - * + * * @param name a name to look for. * @return the corresponding AlertSeverity. */ @@ -47,7 +55,7 @@ public static AlertSeverity fromString(String name) { /** * Gets known AlertSeverity values. - * + * * @return known AlertSeverity values. */ public static Collection values() { 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 index 63f1f1f6633b0..1f2fe7999191f 100644 --- 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 @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; -/** Simulate alerts according to this bundles. */ +/** + * Simulate alerts according to this bundles. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("Bundles") @Fluent @@ -21,13 +23,15 @@ public final class AlertSimulatorBundlesRequestProperties extends AlertSimulator @JsonProperty(value = "bundles") private List bundles; - /** Creates an instance of AlertSimulatorBundlesRequestProperties class. */ + /** + * Creates an instance of AlertSimulatorBundlesRequestProperties class. + */ public AlertSimulatorBundlesRequestProperties() { } /** * Get the bundles property: Bundles list. - * + * * @return the bundles value. */ public List bundles() { @@ -36,7 +40,7 @@ public List bundles() { /** * Set the bundles property: Bundles list. - * + * * @param bundles the bundles value to set. * @return the AlertSimulatorBundlesRequestProperties object itself. */ @@ -47,7 +51,7 @@ public AlertSimulatorBundlesRequestProperties withBundles(List bundl /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 0e6c98294c16b..68b3a74dde86c 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Alert Simulator request body. */ +/** + * Alert Simulator request body. + */ @Fluent public final class AlertSimulatorRequestBody { /* @@ -16,13 +18,15 @@ public final class AlertSimulatorRequestBody { @JsonProperty(value = "properties") private AlertSimulatorRequestProperties properties; - /** Creates an instance of AlertSimulatorRequestBody class. */ + /** + * Creates an instance of AlertSimulatorRequestBody class. + */ public AlertSimulatorRequestBody() { } /** * Get the properties property: Alert Simulator request body data. - * + * * @return the properties value. */ public AlertSimulatorRequestProperties properties() { @@ -31,7 +35,7 @@ public AlertSimulatorRequestProperties properties() { /** * Set the properties property: Alert Simulator request body data. - * + * * @param properties the properties value to set. * @return the AlertSimulatorRequestBody object itself. */ @@ -42,7 +46,7 @@ public AlertSimulatorRequestBody withProperties(AlertSimulatorRequestProperties /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index f4bc7b5b76c87..5a7b49c61c35a 100644 --- 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 @@ -14,28 +14,33 @@ import java.util.HashMap; import java.util.Map; -/** Describes properties of an alert simulation request. */ +/** + * Describes properties of an alert simulation request. + */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind", defaultImpl = AlertSimulatorRequestProperties.class) @JsonTypeName("AlertSimulatorRequestProperties") -@JsonSubTypes({@JsonSubTypes.Type(name = "Bundles", value = AlertSimulatorBundlesRequestProperties.class)}) +@JsonSubTypes({ @JsonSubTypes.Type(name = "Bundles", value = AlertSimulatorBundlesRequestProperties.class) }) @Fluent public class AlertSimulatorRequestProperties { /* * Describes properties of an alert simulation request */ - @JsonIgnore private Map additionalProperties; + @JsonIgnore + private Map additionalProperties; - /** Creates an instance of AlertSimulatorRequestProperties class. */ + /** + * Creates an instance of AlertSimulatorRequestProperties class. + */ public AlertSimulatorRequestProperties() { } /** * Get the additionalProperties property: Describes properties of an alert simulation request. - * + * * @return the additionalProperties value. */ @JsonAnyGetter @@ -45,7 +50,7 @@ public Map additionalProperties() { /** * Set the additionalProperties property: Describes properties of an alert simulation request. - * + * * @param additionalProperties the additionalProperties value to set. * @return the AlertSimulatorRequestProperties object itself. */ @@ -64,7 +69,7 @@ void withAdditionalProperties(String key, Object value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 4a5d9c3eebbcb..833c884ccc655 100644 --- 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 @@ -8,23 +8,33 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The life cycle status of the alert. */ +/** + * The life cycle status of the alert. + */ public final class AlertStatus extends ExpandableStringEnum { - /** Static value Active for AlertStatus. */ + /** + * Static value Active for AlertStatus. + */ public static final AlertStatus ACTIVE = fromString("Active"); - /** Static value InProgress for AlertStatus. */ + /** + * Static value InProgress for AlertStatus. + */ public static final AlertStatus IN_PROGRESS = fromString("InProgress"); - /** Static value Resolved for AlertStatus. */ + /** + * Static value Resolved for AlertStatus. + */ public static final AlertStatus RESOLVED = fromString("Resolved"); - /** Static value Dismissed for AlertStatus. */ + /** + * Static value Dismissed for AlertStatus. + */ public static final AlertStatus DISMISSED = fromString("Dismissed"); /** * Creates a new instance of AlertStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,7 +43,7 @@ public AlertStatus() { /** * Creates or finds a AlertStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding AlertStatus. */ @@ -44,7 +54,7 @@ public static AlertStatus fromString(String name) { /** * Gets known AlertStatus values. - * + * * @return known AlertStatus values. */ public static Collection values() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSyncSettings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSyncSettings.java index 029123d935682..a355252434c4e 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSyncSettings.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSyncSettings.java @@ -11,7 +11,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents an alert sync setting. */ +/** + * Represents an alert sync setting. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("AlertSyncSettings") @Fluent @@ -22,13 +24,15 @@ public final class AlertSyncSettings extends SettingInner { @JsonProperty(value = "properties") private AlertSyncSettingProperties innerProperties; - /** Creates an instance of AlertSyncSettings class. */ + /** + * Creates an instance of AlertSyncSettings class. + */ public AlertSyncSettings() { } /** * Get the innerProperties property: Alert sync setting data. - * + * * @return the innerProperties value. */ private AlertSyncSettingProperties innerProperties() { @@ -37,7 +41,7 @@ private AlertSyncSettingProperties innerProperties() { /** * Get the enabled property: Is the alert sync setting enabled. - * + * * @return the enabled value. */ public Boolean enabled() { @@ -46,7 +50,7 @@ public Boolean enabled() { /** * Set the enabled property: Is the alert sync setting enabled. - * + * * @param enabled the enabled value to set. * @return the AlertSyncSettings object itself. */ @@ -60,7 +64,7 @@ public AlertSyncSettings withEnabled(Boolean enabled) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Alerts.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Alerts.java index 6b849c8c6c062..5091d717a7a54 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Alerts.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Alerts.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Alerts. */ +/** + * Resource collection API of Alerts. + */ public interface Alerts { /** * 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}. @@ -21,7 +23,7 @@ public interface Alerts { /** * 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. @@ -32,9 +34,9 @@ public interface Alerts { /** * List all the alerts that are associated with the resource group. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -44,9 +46,9 @@ public interface Alerts { /** * List all the alerts that are associated with the resource group. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -57,9 +59,9 @@ public interface Alerts { /** * 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. + * 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. @@ -69,9 +71,9 @@ public interface Alerts { /** * 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. + * 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. @@ -82,11 +84,11 @@ public interface Alerts { /** * 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. + * locations. * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -96,11 +98,11 @@ public interface Alerts { /** * 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. + * locations. * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -111,9 +113,9 @@ 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. + * 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. @@ -125,9 +127,9 @@ 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. + * 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. @@ -138,29 +140,29 @@ public interface Alerts { /** * Get an alert that is associated a resource group or a resource in a resource group. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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}. + * @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); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -171,9 +173,9 @@ Response getResourceGroupLevelWithResponse( /** * Update the alert's state. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -181,14 +183,14 @@ Response getResourceGroupLevelWithResponse( * @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); + 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. + * 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. @@ -198,9 +200,9 @@ Response updateSubscriptionLevelStateToDismissWithResponse( /** * Update the alert's state. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -208,14 +210,14 @@ Response updateSubscriptionLevelStateToDismissWithResponse( * @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); + 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. + * 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. @@ -225,9 +227,9 @@ Response updateSubscriptionLevelStateToResolveWithResponse( /** * Update the alert's state. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -235,14 +237,14 @@ Response updateSubscriptionLevelStateToResolveWithResponse( * @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); + 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. + * 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. @@ -252,9 +254,9 @@ Response updateSubscriptionLevelStateToActivateWithResponse( /** * Update the alert's state. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -262,14 +264,14 @@ Response updateSubscriptionLevelStateToActivateWithResponse( * @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); + 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. + * 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. @@ -279,11 +281,11 @@ Response updateSubscriptionLevelStateToInProgressWithResponse( /** * Update the alert's state. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -291,16 +293,16 @@ Response updateSubscriptionLevelStateToInProgressWithResponse( * @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); + Response updateResourceGroupLevelStateToResolveWithResponse(String resourceGroupName, String ascLocation, + String alertName, Context context); /** * Update the alert's state. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -310,11 +312,11 @@ Response updateResourceGroupLevelStateToResolveWithResponse( /** * Update the alert's state. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -322,16 +324,16 @@ Response updateResourceGroupLevelStateToResolveWithResponse( * @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); + Response updateResourceGroupLevelStateToDismissWithResponse(String resourceGroupName, String ascLocation, + String alertName, Context context); /** * Update the alert's state. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -341,11 +343,11 @@ Response updateResourceGroupLevelStateToDismissWithResponse( /** * Update the alert's state. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -353,16 +355,16 @@ Response updateResourceGroupLevelStateToDismissWithResponse( * @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); + Response updateResourceGroupLevelStateToActivateWithResponse(String resourceGroupName, String ascLocation, + String alertName, Context context); /** * Update the alert's state. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -372,11 +374,11 @@ Response updateResourceGroupLevelStateToActivateWithResponse( /** * Update the alert's state. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -384,16 +386,16 @@ Response updateResourceGroupLevelStateToActivateWithResponse( * @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); + Response updateResourceGroupLevelStateToInProgressWithResponse(String resourceGroupName, String ascLocation, + String alertName, Context context); /** * Update the alert's state. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -403,9 +405,9 @@ Response updateResourceGroupLevelStateToInProgressWithResponse( /** * Simulate security alerts. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param alertSimulatorRequestBody Alert Simulator Request Properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -415,9 +417,9 @@ Response updateResourceGroupLevelStateToInProgressWithResponse( /** * Simulate security alerts. - * + * * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * locations. * @param alertSimulatorRequestBody Alert Simulator Request Properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. 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 index 4e7c2860f5f7e..84cf7a11c1b7c 100644 --- 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 @@ -7,82 +7,84 @@ import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; import java.time.OffsetDateTime; -/** An immutable client-side representation of AlertsSuppressionRule. */ +/** + * 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 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 - * this field will default to the maximum allowed expiration date. - * + * 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 index 201e06daeff1b..dba56aff33f47 100644 --- 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 @@ -9,11 +9,13 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; -/** Resource collection API of AlertsSuppressionRules. */ +/** + * Resource collection API of AlertsSuppressionRules. + */ public interface AlertsSuppressionRules { /** * 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}. @@ -22,7 +24,7 @@ public interface AlertsSuppressionRules { /** * 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. @@ -34,20 +36,20 @@ 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}. + * @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. @@ -58,7 +60,7 @@ public interface AlertsSuppressionRules { /** * 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. @@ -67,12 +69,12 @@ public interface AlertsSuppressionRules { * @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); + 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. @@ -84,7 +86,7 @@ Response updateWithResponse( /** * 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. @@ -96,7 +98,7 @@ Response updateWithResponse( /** * 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. diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRulesList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRulesList.java index 7d0e5106fcd2e..2e37c951cc5a6 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRulesList.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRulesList.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Suppression rules list for subscription. */ +/** + * Suppression rules list for subscription. + */ @Fluent public final class AlertsSuppressionRulesList { /* @@ -25,13 +27,15 @@ public final class AlertsSuppressionRulesList { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of AlertsSuppressionRulesList class. */ + /** + * Creates an instance of AlertsSuppressionRulesList class. + */ public AlertsSuppressionRulesList() { } /** * Get the value property: The value property. - * + * * @return the value value. */ public List value() { @@ -40,7 +44,7 @@ public List value() { /** * Set the value property: The value property. - * + * * @param value the value value to set. * @return the AlertsSuppressionRulesList object itself. */ @@ -51,7 +55,7 @@ public AlertsSuppressionRulesList withValue(List val /** * Get the nextLink property: URI to fetch the next page. - * + * * @return the nextLink value. */ public String nextLink() { @@ -60,15 +64,13 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model AlertsSuppressionRulesList")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model AlertsSuppressionRulesList")); } else { value().forEach(e -> e.validate()); } 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 index 7dc20e8e9240b..cd3d58d7360f8 100644 --- 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 @@ -8,90 +8,92 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of AllowedConnections. */ +/** + * Resource collection API of AllowedConnections. + */ public interface AllowedConnections { /** * 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}. + * @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}. + * @return the list of all possible traffic between resources for the subscription as paginated response with + * {@link PagedIterable}. */ PagedIterable list(Context 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. + * 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}. + * 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. + * 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}. + * response with {@link PagedIterable}. */ PagedIterable listByHomeRegion(String ascLocation, 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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}. + * type along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String ascLocation, ConnectionType connectionType, Context context); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. + * type. */ AllowedConnectionsResource get(String resourceGroupName, String ascLocation, ConnectionType connectionType); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowedConnectionsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowedConnectionsList.java index aa29c6120ec3f..f6d956c3eff21 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowedConnectionsList.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowedConnectionsList.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of all possible traffic between Azure resources. */ +/** + * List of all possible traffic between Azure resources. + */ @Immutable public final class AllowedConnectionsList { /* @@ -24,13 +26,15 @@ public final class AllowedConnectionsList { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of AllowedConnectionsList class. */ + /** + * Creates an instance of AllowedConnectionsList class. + */ public AllowedConnectionsList() { } /** * Get the value property: The value property. - * + * * @return the value value. */ public List value() { @@ -39,7 +43,7 @@ public List value() { /** * Get the nextLink property: The URI to fetch the next page. - * + * * @return the nextLink value. */ public String nextLink() { @@ -48,7 +52,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index f7544bb61cefe..92477f0db9964 100644 --- 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 @@ -8,53 +8,55 @@ import java.time.OffsetDateTime; import java.util.List; -/** An immutable client-side representation of AllowedConnectionsResource. */ +/** + * 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 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 index 31e157bbd2e82..4cb2d83dc1ec2 100644 --- 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 @@ -12,7 +12,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; -/** A custom alert rule that checks if a value (depends on the custom alert type) is allowed. */ +/** + * A custom alert rule that checks if a value (depends on the custom alert type) is allowed. + */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, @@ -23,8 +25,7 @@ @JsonSubTypes.Type(name = "ConnectionToIpNotAllowed", value = ConnectionToIpNotAllowed.class), @JsonSubTypes.Type(name = "ConnectionFromIpNotAllowed", value = ConnectionFromIpNotAllowed.class), @JsonSubTypes.Type(name = "LocalUserNotAllowed", value = LocalUserNotAllowed.class), - @JsonSubTypes.Type(name = "ProcessNotAllowed", value = ProcessNotAllowed.class) -}) + @JsonSubTypes.Type(name = "ProcessNotAllowed", value = ProcessNotAllowed.class) }) @Fluent public class AllowlistCustomAlertRule extends ListCustomAlertRule { /* @@ -33,13 +34,15 @@ public class AllowlistCustomAlertRule extends ListCustomAlertRule { @JsonProperty(value = "allowlistValues", required = true) private List allowlistValues; - /** Creates an instance of AllowlistCustomAlertRule class. */ + /** + * Creates an instance of AllowlistCustomAlertRule class. + */ public AllowlistCustomAlertRule() { } /** * 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() { @@ -48,7 +51,7 @@ public List 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. */ @@ -57,7 +60,9 @@ public AllowlistCustomAlertRule withAllowlistValues(List allowlistValues return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AllowlistCustomAlertRule withIsEnabled(boolean isEnabled) { super.withIsEnabled(isEnabled); @@ -66,17 +71,15 @@ public AllowlistCustomAlertRule withIsEnabled(boolean isEnabled) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (allowlistValues() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property allowlistValues in model AllowlistCustomAlertRule")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property allowlistValues in model AllowlistCustomAlertRule")); } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AmqpC2DMessagesNotInAllowedRange.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AmqpC2DMessagesNotInAllowedRange.java index 14079d7a02f2c..d1aaa099e6179 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AmqpC2DMessagesNotInAllowedRange.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AmqpC2DMessagesNotInAllowedRange.java @@ -9,37 +9,49 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.Duration; -/** Number of cloud to device messages (AMQP protocol) is not in allowed range. */ +/** + * Number of cloud to device messages (AMQP protocol) is not in allowed range. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") @JsonTypeName("AmqpC2DMessagesNotInAllowedRange") @Fluent public final class AmqpC2DMessagesNotInAllowedRange extends TimeWindowCustomAlertRule { - /** Creates an instance of AmqpC2DMessagesNotInAllowedRange class. */ + /** + * Creates an instance of AmqpC2DMessagesNotInAllowedRange class. + */ public AmqpC2DMessagesNotInAllowedRange() { } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AmqpC2DMessagesNotInAllowedRange withTimeWindowSize(Duration timeWindowSize) { super.withTimeWindowSize(timeWindowSize); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AmqpC2DMessagesNotInAllowedRange withMinThreshold(int minThreshold) { super.withMinThreshold(minThreshold); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AmqpC2DMessagesNotInAllowedRange withMaxThreshold(int maxThreshold) { super.withMaxThreshold(maxThreshold); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AmqpC2DMessagesNotInAllowedRange withIsEnabled(boolean isEnabled) { super.withIsEnabled(isEnabled); @@ -48,7 +60,7 @@ public AmqpC2DMessagesNotInAllowedRange withIsEnabled(boolean isEnabled) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AmqpC2DRejectedMessagesNotInAllowedRange.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AmqpC2DRejectedMessagesNotInAllowedRange.java index 833c457e1fcc1..e5794a72d5486 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AmqpC2DRejectedMessagesNotInAllowedRange.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AmqpC2DRejectedMessagesNotInAllowedRange.java @@ -9,37 +9,49 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.Duration; -/** Number of rejected cloud to device messages (AMQP protocol) is not in allowed range. */ +/** + * Number of rejected cloud to device messages (AMQP protocol) is not in allowed range. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") @JsonTypeName("AmqpC2DRejectedMessagesNotInAllowedRange") @Fluent public final class AmqpC2DRejectedMessagesNotInAllowedRange extends TimeWindowCustomAlertRule { - /** Creates an instance of AmqpC2DRejectedMessagesNotInAllowedRange class. */ + /** + * Creates an instance of AmqpC2DRejectedMessagesNotInAllowedRange class. + */ public AmqpC2DRejectedMessagesNotInAllowedRange() { } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AmqpC2DRejectedMessagesNotInAllowedRange withTimeWindowSize(Duration timeWindowSize) { super.withTimeWindowSize(timeWindowSize); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AmqpC2DRejectedMessagesNotInAllowedRange withMinThreshold(int minThreshold) { super.withMinThreshold(minThreshold); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AmqpC2DRejectedMessagesNotInAllowedRange withMaxThreshold(int maxThreshold) { super.withMaxThreshold(maxThreshold); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AmqpC2DRejectedMessagesNotInAllowedRange withIsEnabled(boolean isEnabled) { super.withIsEnabled(isEnabled); @@ -48,7 +60,7 @@ public AmqpC2DRejectedMessagesNotInAllowedRange withIsEnabled(boolean isEnabled) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AmqpD2CMessagesNotInAllowedRange.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AmqpD2CMessagesNotInAllowedRange.java index d7cb03368abcc..ffc5b1fc88a09 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AmqpD2CMessagesNotInAllowedRange.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AmqpD2CMessagesNotInAllowedRange.java @@ -9,37 +9,49 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.Duration; -/** Number of device to cloud messages (AMQP protocol) is not in allowed range. */ +/** + * Number of device to cloud messages (AMQP protocol) is not in allowed range. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") @JsonTypeName("AmqpD2CMessagesNotInAllowedRange") @Fluent public final class AmqpD2CMessagesNotInAllowedRange extends TimeWindowCustomAlertRule { - /** Creates an instance of AmqpD2CMessagesNotInAllowedRange class. */ + /** + * Creates an instance of AmqpD2CMessagesNotInAllowedRange class. + */ public AmqpD2CMessagesNotInAllowedRange() { } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AmqpD2CMessagesNotInAllowedRange withTimeWindowSize(Duration timeWindowSize) { super.withTimeWindowSize(timeWindowSize); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AmqpD2CMessagesNotInAllowedRange withMinThreshold(int minThreshold) { super.withMinThreshold(minThreshold); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AmqpD2CMessagesNotInAllowedRange withMaxThreshold(int maxThreshold) { super.withMaxThreshold(maxThreshold); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AmqpD2CMessagesNotInAllowedRange withIsEnabled(boolean isEnabled) { super.withIsEnabled(isEnabled); @@ -48,7 +60,7 @@ public AmqpD2CMessagesNotInAllowedRange withIsEnabled(boolean isEnabled) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 new file mode 100644 index 0000000000000..610c40f3c2c61 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AnnotateDefaultBranchState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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 { + /** + * Static value Disabled for AnnotateDefaultBranchState. + */ + public static final AnnotateDefaultBranchState DISABLED = fromString("Disabled"); + + /** + * Static value Enabled for AnnotateDefaultBranchState. + */ + 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. + */ + @JsonCreator + 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 new file mode 100644 index 0000000000000..e20f45dc9be3a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollection.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +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 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/ApiCollectionResponseList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionList.java similarity index 77% rename from sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionResponseList.java rename to sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionList.java index 2666ef5311234..df603453bbd43 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionResponseList.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionList.java @@ -5,18 +5,20 @@ package com.azure.resourcemanager.security.models; import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.security.fluent.models.ApiCollectionResponseInner; +import com.azure.resourcemanager.security.fluent.models.ApiCollectionInner; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Page of a list of API collections as represented by Defender for APIs. */ +/** + * Page of a list of API collections as represented by Microsoft Defender for APIs. + */ @Immutable -public final class ApiCollectionResponseList { +public final class ApiCollectionList { /* * API collections in this page. */ @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; + private List value; /* * The URI to fetch the next page. @@ -24,22 +26,24 @@ public final class ApiCollectionResponseList { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of ApiCollectionResponseList class. */ - public ApiCollectionResponseList() { + /** + * Creates an instance of ApiCollectionList class. + */ + public ApiCollectionList() { } /** * Get the value property: API collections in this page. - * + * * @return the value value. */ - public List 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() { @@ -48,7 +52,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionOffboardings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionOffboardings.java deleted file mode 100644 index 8fbc3ffe617e9..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionOffboardings.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of ApiCollectionOffboardings. */ -public interface ApiCollectionOffboardings { - /** - * Offboard an Azure API Management API from Defender for APIs - * - *

Offboard an Azure API Management API from 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 apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API 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 deleteWithResponse( - String resourceGroupName, String serviceName, String apiCollectionId, Context context); - - /** - * Offboard an Azure API Management API from Defender for APIs - * - *

Offboard an Azure API Management API from 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 apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API 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 delete(String resourceGroupName, String serviceName, String apiCollectionId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionOnboardings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionOnboardings.java deleted file mode 100644 index c4109ca69adb4..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionOnboardings.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of ApiCollectionOnboardings. */ -public interface ApiCollectionOnboardings { - /** - * Onboard an Azure API Management API to Defender for APIs - * - *

Onboard an Azure API Management API to 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 apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API 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 an API collection as represented by Defender for APIs along with {@link Response}. - */ - Response createWithResponse( - String resourceGroupName, String serviceName, String apiCollectionId, Context context); - - /** - * Onboard an Azure API Management API to Defender for APIs - * - *

Onboard an Azure API Management API to 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 apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API 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 an API collection as represented by Defender for APIs. - */ - ApiCollectionResponse create(String resourceGroupName, String serviceName, String apiCollectionId); -} 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 index d21a442595cb1..e8883e5365b7a 100644 --- 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 @@ -8,78 +8,210 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of ApiCollections. */ +/** + * Resource collection API of ApiCollections. + */ public interface ApiCollections { /** - * Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs - * - *

Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API - * Management API is onboarded to 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. - * + * 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 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 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 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 that have been onboarded to Microsoft Defender for APIs + * as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 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 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 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 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 a list of Azure API Management APIs that have been onboarded to Defender for APIs as paginated response - * with {@link PagedIterable}. + * @return an API collection as represented by Microsoft Defender for APIs. */ - PagedIterable list(String resourceGroupName, String serviceName); + ApiCollection onboardAzureApiManagementApi(String resourceGroupName, String serviceName, String apiId); /** - * Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs - * - *

Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API - * Management API is onboarded to 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. - * + * 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 a list of Azure API Management APIs that have been onboarded to Defender for APIs as paginated response - * with {@link PagedIterable}. + * @return an API collection as represented by Microsoft Defender for APIs. */ - PagedIterable list(String resourceGroupName, String serviceName, Context context); + ApiCollection onboardAzureApiManagementApi(String resourceGroupName, String serviceName, String apiId, + Context context); /** - * Gets an Azure API Management API if it has been onboarded to Defender for APIs - * - *

Gets an Azure API Management API if it has been onboarded to Defender for APIs. If an Azure API Management API - * is onboarded to 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. - * + * 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 apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. + * @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 Azure API Management API if it has been onboarded to Defender for APIs along with {@link Response}. + * @return the {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String serviceName, String apiCollectionId, Context context); + Response offboardAzureApiManagementApiWithResponse(String resourceGroupName, String serviceName, String apiId, + Context context); /** - * Gets an Azure API Management API if it has been onboarded to Defender for APIs - * - *

Gets an Azure API Management API if it has been onboarded to Defender for APIs. If an Azure API Management API - * is onboarded to 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. - * + * 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 apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. + * @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 Azure API Management API if it has been onboarded to Defender for APIs. */ - ApiCollectionResponse get(String resourceGroupName, String serviceName, String apiCollectionId); + void offboardAzureApiManagementApi(String resourceGroupName, String serviceName, String apiId); } 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 index 9a2925359582e..51f5fa4954dee 100644 --- 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 @@ -8,218 +8,252 @@ import com.azure.resourcemanager.security.fluent.models.ApplicationInner; import java.util.List; -/** An immutable client-side representation of Application. */ +/** + * 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 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. */ + /** + * The entirety of the Application definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { } - /** The Application definition stages. */ + + /** + * The Application definition stages. + */ interface DefinitionStages { - /** The first stage of the Application definition. */ + /** + * 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 { + 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. */ + + /** + * 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. */ + + /** + * 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. */ + + /** + * 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. */ + + /** + * 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 { + /** + * 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. */ + + /** + * The Application update stages. + */ interface UpdateStages { - /** The stage of the Application update allowing to specify displayName. */ + /** + * 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. */ + + /** + * 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. */ + + /** + * 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. */ + + /** + * 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. */ diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationOperations.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationOperations.java index 233b962c3115a..e5c4555d335d7 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationOperations.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationOperations.java @@ -7,11 +7,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of ApplicationOperations. */ +/** + * Resource collection API of ApplicationOperations. + */ public interface ApplicationOperations { /** * 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. @@ -23,7 +25,7 @@ public interface ApplicationOperations { /** * 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. @@ -34,7 +36,7 @@ public interface ApplicationOperations { /** * 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. @@ -46,7 +48,7 @@ public interface ApplicationOperations { /** * 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. @@ -56,7 +58,7 @@ public interface ApplicationOperations { /** * 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. @@ -67,7 +69,7 @@ public interface ApplicationOperations { /** * 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. @@ -79,7 +81,7 @@ public interface ApplicationOperations { /** * 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. @@ -89,7 +91,7 @@ public interface ApplicationOperations { /** * 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. @@ -101,7 +103,7 @@ public interface ApplicationOperations { /** * Begins definition for a new Application resource. - * + * * @param name resource name. * @return the first stage of the new Application definition. */ 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 index 9d2dd77b7267b..0709908b82c83 100644 --- 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 @@ -8,14 +8,18 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The application source, what it affects, e.g. Assessments. */ +/** + * The application source, what it affects, e.g. Assessments. + */ public final class ApplicationSourceResourceType extends ExpandableStringEnum { - /** Static value Assessments for ApplicationSourceResourceType. */ + /** + * Static value Assessments for ApplicationSourceResourceType. + */ public static final ApplicationSourceResourceType ASSESSMENTS = fromString("Assessments"); /** * Creates a new instance of ApplicationSourceResourceType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -24,7 +28,7 @@ public ApplicationSourceResourceType() { /** * Creates or finds a ApplicationSourceResourceType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ApplicationSourceResourceType. */ @@ -35,7 +39,7 @@ public static ApplicationSourceResourceType fromString(String name) { /** * Gets known ApplicationSourceResourceType values. - * + * * @return known ApplicationSourceResourceType values. */ public static Collection values() { 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 index 64f396cfe67c1..5efcf23b1b757 100644 --- 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 @@ -7,27 +7,29 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of Applications. */ +/** + * Resource collection API of Applications. + */ public interface Applications { /** * 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}. + * @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}. + * @return a list of all relevant applications over a subscription level scope 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/ApplicationsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationsList.java index deccd03c7231d..78731b63b2d7c 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationsList.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationsList.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Page of a security applications list. */ +/** + * Page of a security applications list. + */ @Immutable public final class ApplicationsList { /* @@ -24,13 +26,15 @@ public final class ApplicationsList { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of ApplicationsList class. */ + /** + * Creates an instance of ApplicationsList class. + */ public ApplicationsList() { } /** * Get the value property: Collection of applications in this page. - * + * * @return the value value. */ public List value() { @@ -39,7 +43,7 @@ public List value() { /** * Get the nextLink property: The URI to fetch the next page. - * + * * @return the nextLink value. */ public String nextLink() { @@ -48,7 +52,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index f052a42ed9163..2b6a9cd03eba3 100644 --- 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 @@ -6,39 +6,41 @@ import com.azure.resourcemanager.security.fluent.models.AscLocationInner; -/** An immutable client-side representation of AscLocation. */ +/** + * 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 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/AscLocationList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AscLocationList.java index c8d7e61915583..37c1ab8c536ea 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AscLocationList.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AscLocationList.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of locations where ASC saves your data. */ +/** + * List of locations where ASC saves your data. + */ @Immutable public final class AscLocationList { /* @@ -24,13 +26,15 @@ public final class AscLocationList { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of AscLocationList class. */ + /** + * Creates an instance of AscLocationList class. + */ public AscLocationList() { } /** * Get the value property: The value property. - * + * * @return the value value. */ public List value() { @@ -39,7 +43,7 @@ public List value() { /** * Get the nextLink property: The URI to fetch the next page. - * + * * @return the nextLink value. */ public String nextLink() { @@ -48,7 +52,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index ac3b775039ef3..0491ec20d2dd8 100644 --- 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 @@ -8,21 +8,29 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Sub-assessment resource type. */ +/** + * Sub-assessment resource type. + */ public final class AssessedResourceType extends ExpandableStringEnum { - /** Static value SqlServerVulnerability for AssessedResourceType. */ + /** + * Static value SqlServerVulnerability for AssessedResourceType. + */ public static final AssessedResourceType SQL_SERVER_VULNERABILITY = fromString("SqlServerVulnerability"); - /** Static value ContainerRegistryVulnerability for AssessedResourceType. */ - public static final AssessedResourceType CONTAINER_REGISTRY_VULNERABILITY = - fromString("ContainerRegistryVulnerability"); + /** + * Static value ContainerRegistryVulnerability for AssessedResourceType. + */ + public static final AssessedResourceType CONTAINER_REGISTRY_VULNERABILITY + = fromString("ContainerRegistryVulnerability"); - /** Static value ServerVulnerability for AssessedResourceType. */ + /** + * Static value ServerVulnerability for AssessedResourceType. + */ public static final AssessedResourceType SERVER_VULNERABILITY = fromString("ServerVulnerability"); /** * Creates a new instance of AssessedResourceType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -31,7 +39,7 @@ public AssessedResourceType() { /** * Creates or finds a AssessedResourceType from its string representation. - * + * * @param name a name to look for. * @return the corresponding AssessedResourceType. */ @@ -42,7 +50,7 @@ public static AssessedResourceType fromString(String name) { /** * Gets known AssessedResourceType values. - * + * * @return known AssessedResourceType values. */ public static Collection values() { 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 index 7c6620d027bd9..0b4cfd261e351 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** Links relevant to the assessment. */ +/** + * Links relevant to the assessment. + */ @Immutable public final class AssessmentLinks { /* @@ -16,13 +18,15 @@ public final class AssessmentLinks { @JsonProperty(value = "azurePortalUri", access = JsonProperty.Access.WRITE_ONLY) private String azurePortalUri; - /** Creates an instance of AssessmentLinks class. */ + /** + * Creates an instance of AssessmentLinks class. + */ public AssessmentLinks() { } /** * Get the azurePortalUri property: Link to assessment in Azure Portal. - * + * * @return the azurePortalUri value. */ public String azurePortalUri() { @@ -31,7 +35,7 @@ public String azurePortalUri() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 3acea6c5664ad..7ff0e4acab510 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** The result of the assessment. */ +/** + * The result of the assessment. + */ @Fluent public class AssessmentStatus { /* @@ -29,13 +31,15 @@ public class AssessmentStatus { @JsonProperty(value = "description") private String description; - /** Creates an instance of AssessmentStatus class. */ + /** + * 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() { @@ -44,7 +48,7 @@ public AssessmentStatusCode 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. */ @@ -55,7 +59,7 @@ public AssessmentStatus withCode(AssessmentStatusCode code) { /** * Get the cause property: Programmatic code for the cause of the assessment status. - * + * * @return the cause value. */ public String cause() { @@ -64,7 +68,7 @@ public String 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. */ @@ -75,7 +79,7 @@ public AssessmentStatus withCause(String cause) { /** * Get the description property: Human readable description of the assessment status. - * + * * @return the description value. */ public String description() { @@ -84,7 +88,7 @@ public String description() { /** * Set the description property: Human readable description of the assessment status. - * + * * @param description the description value to set. * @return the AssessmentStatus object itself. */ @@ -95,14 +99,13 @@ public AssessmentStatus withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (code() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property code in model AssessmentStatus")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property code in model AssessmentStatus")); } } 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 index bb42fd8a66536..68c19755a065f 100644 --- 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 @@ -8,20 +8,28 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Programmatic code for the status of the assessment. */ +/** + * Programmatic code for the status of the assessment. + */ public final class AssessmentStatusCode extends ExpandableStringEnum { - /** Static value Healthy for AssessmentStatusCode. */ + /** + * Static value Healthy for AssessmentStatusCode. + */ public static final AssessmentStatusCode HEALTHY = fromString("Healthy"); - /** Static value Unhealthy for AssessmentStatusCode. */ + /** + * Static value Unhealthy for AssessmentStatusCode. + */ public static final AssessmentStatusCode UNHEALTHY = fromString("Unhealthy"); - /** Static value NotApplicable for AssessmentStatusCode. */ + /** + * Static value NotApplicable for AssessmentStatusCode. + */ public static final AssessmentStatusCode NOT_APPLICABLE = fromString("NotApplicable"); /** * Creates a new instance of AssessmentStatusCode value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,7 +38,7 @@ public AssessmentStatusCode() { /** * Creates or finds a AssessmentStatusCode from its string representation. - * + * * @param name a name to look for. * @return the corresponding AssessmentStatusCode. */ @@ -41,7 +49,7 @@ public static AssessmentStatusCode fromString(String name) { /** * Gets known AssessmentStatusCode values. - * + * * @return known AssessmentStatusCode values. */ public static Collection values() { 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 index 44837f46729be..d268c5ef77ded 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; -/** The result of the assessment. */ +/** + * The result of the assessment. + */ @Fluent public final class AssessmentStatusResponse extends AssessmentStatus { /* @@ -23,14 +25,16 @@ public final class AssessmentStatusResponse extends AssessmentStatus { @JsonProperty(value = "statusChangeDate", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime statusChangeDate; - /** Creates an instance of AssessmentStatusResponse class. */ + /** + * Creates an instance of AssessmentStatusResponse class. + */ public 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() { @@ -40,28 +44,34 @@ public OffsetDateTime 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; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AssessmentStatusResponse withCode(AssessmentStatusCode code) { super.withCode(code); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AssessmentStatusResponse withCause(String cause) { super.withCause(cause); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AssessmentStatusResponse withDescription(String description) { super.withDescription(description); @@ -70,7 +80,7 @@ public AssessmentStatusResponse withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 18580a1dd30e2..ecf72873685d3 100644 --- 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 @@ -13,21 +13,29 @@ * Policy definition. */ public final class AssessmentType extends ExpandableStringEnum { - /** Static value BuiltIn for AssessmentType. */ + /** + * Static value BuiltIn for AssessmentType. + */ public static final AssessmentType BUILT_IN = fromString("BuiltIn"); - /** Static value CustomPolicy for AssessmentType. */ + /** + * Static value CustomPolicy for AssessmentType. + */ public static final AssessmentType CUSTOM_POLICY = fromString("CustomPolicy"); - /** Static value CustomerManaged for AssessmentType. */ + /** + * Static value CustomerManaged for AssessmentType. + */ public static final AssessmentType CUSTOMER_MANAGED = fromString("CustomerManaged"); - /** Static value VerifiedPartner for AssessmentType. */ + /** + * Static value VerifiedPartner for AssessmentType. + */ public static final AssessmentType VERIFIED_PARTNER = fromString("VerifiedPartner"); /** * Creates a new instance of AssessmentType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -36,7 +44,7 @@ public AssessmentType() { /** * Creates or finds a AssessmentType from its string representation. - * + * * @param name a name to look for. * @return the corresponding AssessmentType. */ @@ -47,7 +55,7 @@ public static AssessmentType fromString(String name) { /** * Gets known AssessmentType values. - * + * * @return known AssessmentType values. */ public static Collection values() { 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 index d986d2a6d2542..b5a734d81404d 100644 --- 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 @@ -8,38 +8,40 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Assessments. */ +/** + * Resource collection API of Assessments. + */ public interface Assessments { /** * Get security assessments on all your scanned resources inside a scope. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @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 Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @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 resourceId The identifier of the resource. * @param assessmentName The Assessment Key - Unique key for the assessment type. * @param expand OData expand. Optional. @@ -49,12 +51,12 @@ public interface Assessments { * @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); + Response getWithResponse(String resourceId, String assessmentName, ExpandEnum expand, + Context context); /** * Get a security assessment on your scanned resource. - * + * * @param resourceId The identifier of the resource. * @param assessmentName The Assessment Key - Unique key for the assessment type. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -67,7 +69,7 @@ Response getWithResponse( /** * 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 identifier of the resource. * @param assessmentName The Assessment Key - Unique key for the assessment type. * @param context The context to associate with this operation. @@ -81,7 +83,7 @@ Response getWithResponse( /** * 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 identifier of the resource. * @param assessmentName The Assessment Key - Unique key for the assessment type. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -92,7 +94,7 @@ Response getWithResponse( /** * 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. @@ -103,7 +105,7 @@ Response getWithResponse( /** * 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. @@ -117,7 +119,7 @@ Response getWithResponse( /** * 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. @@ -128,7 +130,7 @@ Response getWithResponse( /** * 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. @@ -140,7 +142,7 @@ Response getWithResponse( /** * Begins definition for a new SecurityAssessmentResponse resource. - * + * * @param name resource name. * @return the first stage of the new SecurityAssessmentResponse definition. */ 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 index e5145325396c8..33e7a2d02d99d 100644 --- 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 @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of AssessmentsMetadatas. */ +/** + * Resource collection API of AssessmentsMetadatas. + */ public interface AssessmentsMetadatas { /** * 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}. @@ -21,7 +23,7 @@ public interface AssessmentsMetadatas { /** * 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. @@ -32,7 +34,7 @@ public interface AssessmentsMetadatas { /** * 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. @@ -44,7 +46,7 @@ public interface AssessmentsMetadatas { /** * 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. @@ -55,29 +57,29 @@ public interface AssessmentsMetadatas { /** * 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}. + * @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}. + * @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 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. @@ -85,12 +87,12 @@ public interface AssessmentsMetadatas { * @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); + 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. @@ -102,7 +104,7 @@ Response getInSubscriptionWithResponse( /** * 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. @@ -115,7 +117,7 @@ Response getInSubscriptionWithResponse( /** * 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. @@ -125,7 +127,7 @@ Response getInSubscriptionWithResponse( /** * 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. @@ -136,7 +138,7 @@ Response getInSubscriptionWithResponse( /** * 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. @@ -149,7 +151,7 @@ Response getInSubscriptionWithResponse( /** * 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. @@ -160,7 +162,7 @@ Response getInSubscriptionWithResponse( /** * 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. @@ -172,7 +174,7 @@ Response getInSubscriptionWithResponse( /** * Begins definition for a new SecurityAssessmentMetadataResponse resource. - * + * * @param name resource name. * @return the first stage of the new SecurityAssessmentMetadataResponse definition. */ 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 index 218d2ba95a851..2609dfb7d76cb 100644 --- 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 @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents an ATA security solution which sends logs to an OMS workspace. */ +/** + * Represents an ATA security solution which sends logs to an OMS workspace. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("ATA") @Fluent @@ -21,13 +23,15 @@ public final class AtaExternalSecuritySolution extends ExternalSecuritySolutionI @JsonProperty(value = "properties") private AtaSolutionProperties properties; - /** Creates an instance of AtaExternalSecuritySolution class. */ + /** + * Creates an instance of AtaExternalSecuritySolution class. + */ public AtaExternalSecuritySolution() { } /** * Get the properties property: The external security solution properties for ATA solutions. - * + * * @return the properties value. */ public AtaSolutionProperties properties() { @@ -36,7 +40,7 @@ public AtaSolutionProperties properties() { /** * Set the properties property: The external security solution properties for ATA solutions. - * + * * @param properties the properties value to set. * @return the AtaExternalSecuritySolution object itself. */ @@ -47,7 +51,7 @@ public AtaExternalSecuritySolution withProperties(AtaSolutionProperties properti /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 5167966f1d5d5..ec7f9ebb9d130 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The external security solution properties for ATA solutions. */ +/** + * The external security solution properties for ATA solutions. + */ @Fluent public final class AtaSolutionProperties extends ExternalSecuritySolutionProperties { /* @@ -16,13 +18,15 @@ public final class AtaSolutionProperties extends ExternalSecuritySolutionPropert @JsonProperty(value = "lastEventReceived") private String lastEventReceived; - /** Creates an instance of AtaSolutionProperties class. */ + /** + * Creates an instance of AtaSolutionProperties class. + */ public AtaSolutionProperties() { } /** * Get the lastEventReceived property: The lastEventReceived property. - * + * * @return the lastEventReceived value. */ public String lastEventReceived() { @@ -31,7 +35,7 @@ public String lastEventReceived() { /** * Set the lastEventReceived property: The lastEventReceived property. - * + * * @param lastEventReceived the lastEventReceived value to set. * @return the AtaSolutionProperties object itself. */ @@ -40,21 +44,27 @@ public AtaSolutionProperties withLastEventReceived(String lastEventReceived) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AtaSolutionProperties withDeviceVendor(String deviceVendor) { super.withDeviceVendor(deviceVendor); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AtaSolutionProperties withDeviceType(String deviceType) { super.withDeviceType(deviceType); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public AtaSolutionProperties withWorkspace(ConnectedWorkspace workspace) { super.withWorkspace(workspace); @@ -63,7 +73,7 @@ public AtaSolutionProperties withWorkspace(ConnectedWorkspace workspace) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationDetailsProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationDetailsProperties.java index 71b7f498e5e93..cfa26ae891dcf 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationDetailsProperties.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationDetailsProperties.java @@ -11,7 +11,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; -/** Settings for cloud authentication management. */ +/** + * Settings for cloud authentication management. + */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, @@ -21,8 +23,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(name = "awsCreds", value = AwsCredsAuthenticationDetailsProperties.class), @JsonSubTypes.Type(name = "awsAssumeRole", value = AwAssumeRoleAuthenticationDetailsProperties.class), - @JsonSubTypes.Type(name = "gcpCredentials", value = GcpCredentialsDetailsProperties.class) -}) + @JsonSubTypes.Type(name = "gcpCredentials", value = GcpCredentialsDetailsProperties.class) }) @Immutable public class AuthenticationDetailsProperties { /* @@ -37,13 +38,15 @@ public class AuthenticationDetailsProperties { @JsonProperty(value = "grantedPermissions", access = JsonProperty.Access.WRITE_ONLY) private List grantedPermissions; - /** Creates an instance of AuthenticationDetailsProperties class. */ + /** + * Creates an instance of AuthenticationDetailsProperties class. + */ public AuthenticationDetailsProperties() { } /** * Get the authenticationProvisioningState property: State of the multi-cloud connector. - * + * * @return the authenticationProvisioningState value. */ public AuthenticationProvisioningState authenticationProvisioningState() { @@ -52,7 +55,7 @@ public AuthenticationProvisioningState authenticationProvisioningState() { /** * Get the grantedPermissions property: The permissions detected in the cloud account. - * + * * @return the grantedPermissions value. */ public List grantedPermissions() { @@ -61,7 +64,7 @@ public List grantedPermissions() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationProvisioningState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationProvisioningState.java index e81b2a271af08..d0332051ff533 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationProvisioningState.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationProvisioningState.java @@ -8,23 +8,33 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** State of the multi-cloud connector. */ +/** + * State of the multi-cloud connector. + */ public final class AuthenticationProvisioningState extends ExpandableStringEnum { - /** Static value Valid for AuthenticationProvisioningState. */ + /** + * Static value Valid for AuthenticationProvisioningState. + */ public static final AuthenticationProvisioningState VALID = fromString("Valid"); - /** Static value Invalid for AuthenticationProvisioningState. */ + /** + * Static value Invalid for AuthenticationProvisioningState. + */ public static final AuthenticationProvisioningState INVALID = fromString("Invalid"); - /** Static value Expired for AuthenticationProvisioningState. */ + /** + * Static value Expired for AuthenticationProvisioningState. + */ public static final AuthenticationProvisioningState EXPIRED = fromString("Expired"); - /** Static value IncorrectPolicy for AuthenticationProvisioningState. */ + /** + * Static value IncorrectPolicy for AuthenticationProvisioningState. + */ public static final AuthenticationProvisioningState INCORRECT_POLICY = fromString("IncorrectPolicy"); /** * Creates a new instance of AuthenticationProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,7 +43,7 @@ public AuthenticationProvisioningState() { /** * Creates or finds a AuthenticationProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding AuthenticationProvisioningState. */ @@ -44,7 +54,7 @@ public static AuthenticationProvisioningState fromString(String name) { /** * Gets known AuthenticationProvisioningState values. - * + * * @return known AuthenticationProvisioningState values. */ public static Collection values() { 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 index 39089c8a4a996..0a61e277f217d 100644 --- 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 @@ -13,18 +13,24 @@ * account organization credentials. */ public final class AuthenticationType extends ExpandableStringEnum { - /** Static value awsCreds for AuthenticationType. */ + /** + * Static value awsCreds for AuthenticationType. + */ public static final AuthenticationType AWS_CREDS = fromString("awsCreds"); - /** Static value awsAssumeRole for AuthenticationType. */ + /** + * Static value awsAssumeRole for AuthenticationType. + */ public static final AuthenticationType AWS_ASSUME_ROLE = fromString("awsAssumeRole"); - /** Static value gcpCredentials for AuthenticationType. */ + /** + * Static value gcpCredentials for AuthenticationType. + */ public static final AuthenticationType GCP_CREDENTIALS = fromString("gcpCredentials"); /** * Creates a new instance of AuthenticationType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,7 +39,7 @@ public AuthenticationType() { /** * Creates or finds a AuthenticationType from its string representation. - * + * * @param name a name to look for. * @return the corresponding AuthenticationType. */ @@ -44,7 +50,7 @@ public static AuthenticationType fromString(String name) { /** * Gets known AuthenticationType values. - * + * * @return known AuthenticationType values. */ public static Collection values() { 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 new file mode 100644 index 0000000000000..489e98d2f97a3 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Authorization.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Authorization payload. + */ +@Fluent +public final class Authorization { + /* + * 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. + */ + @JsonProperty(value = "code") + 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() { + } +} 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 new file mode 100644 index 0000000000000..b10fbe6540f0d --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoDiscovery.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * AutoDiscovery states. + */ +public final class AutoDiscovery extends ExpandableStringEnum { + /** + * Static value Disabled for AutoDiscovery. + */ + public static final AutoDiscovery DISABLED = fromString("Disabled"); + + /** + * Static value Enabled for AutoDiscovery. + */ + public static final AutoDiscovery ENABLED = fromString("Enabled"); + + /** + * Static value NotApplicable for AutoDiscovery. + */ + 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. + */ + @JsonCreator + 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 index 0b365391e9a0b..c4f1323e11b60 100644 --- 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 @@ -8,17 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Describes what kind of security agent provisioning action to take. */ +/** + * Describes what kind of security agent provisioning action to take. + */ public final class AutoProvision extends ExpandableStringEnum { - /** Static value On for AutoProvision. */ + /** + * Static value On for AutoProvision. + */ public static final AutoProvision ON = fromString("On"); - /** Static value Off for AutoProvision. */ + /** + * Static value Off for AutoProvision. + */ public static final AutoProvision OFF = fromString("Off"); /** * Creates a new instance of AutoProvision value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +33,7 @@ public AutoProvision() { /** * Creates or finds a AutoProvision from its string representation. - * + * * @param name a name to look for. * @return the corresponding AutoProvision. */ @@ -38,7 +44,7 @@ public static AutoProvision fromString(String name) { /** * Gets known AutoProvision values. - * + * * @return known AutoProvision values. */ public static Collection values() { 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 index df4279031dd7a..9925a34a0a57d 100644 --- 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 @@ -7,51 +7,61 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.security.fluent.models.AutoProvisioningSettingInner; -/** An immutable client-side representation of AutoProvisioningSetting. */ +/** + * 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 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. */ + /** + * The entirety of the AutoProvisioningSetting definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { } - /** The AutoProvisioningSetting definition stages. */ + + /** + * The AutoProvisioningSetting definition stages. + */ interface DefinitionStages { - /** The first stage of the AutoProvisioningSetting definition. */ + /** + * 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. @@ -59,40 +69,44 @@ interface Blank extends WithCreate { 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. */ + + /** + * 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. */ diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSettingList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSettingList.java index de263eefa9dd6..f1fff0f0d7576 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSettingList.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSettingList.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of all the auto provisioning settings response. */ +/** + * List of all the auto provisioning settings response. + */ @Fluent public final class AutoProvisioningSettingList { /* @@ -24,13 +26,15 @@ public final class AutoProvisioningSettingList { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of AutoProvisioningSettingList class. */ + /** + * Creates an instance of AutoProvisioningSettingList class. + */ public AutoProvisioningSettingList() { } /** * Get the value property: List of all the auto provisioning settings. - * + * * @return the value value. */ public List value() { @@ -39,7 +43,7 @@ public List value() { /** * Set the value property: List of all the auto provisioning settings. - * + * * @param value the value value to set. * @return the AutoProvisioningSettingList object itself. */ @@ -50,7 +54,7 @@ public AutoProvisioningSettingList withValue(List /** * Get the nextLink property: The URI to fetch the next page. - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +63,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 2b050e6bc336e..772fb6f8a28b8 100644 --- 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 @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of AutoProvisioningSettings. */ +/** + * Resource collection API of AutoProvisioningSettings. + */ public interface AutoProvisioningSettings { /** * 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}. @@ -21,7 +23,7 @@ public interface AutoProvisioningSettings { /** * 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. @@ -32,7 +34,7 @@ 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. @@ -44,7 +46,7 @@ public interface AutoProvisioningSettings { /** * 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. @@ -55,7 +57,7 @@ public interface AutoProvisioningSettings { /** * 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. @@ -66,7 +68,7 @@ public interface AutoProvisioningSettings { /** * 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. @@ -78,7 +80,7 @@ public interface AutoProvisioningSettings { /** * Begins definition for a new AutoProvisioningSetting resource. - * + * * @param name resource name. * @return the first stage of the new AutoProvisioningSetting definition. */ 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 index b584f1a114a34..1e248cccbe54b 100644 --- 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 @@ -11,53 +11,55 @@ import java.util.List; import java.util.Map; -/** An immutable client-side representation of Automation. */ +/** + * 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 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 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(); @@ -66,7 +68,7 @@ public interface Automation { * 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(); @@ -74,7 +76,7 @@ public interface Automation { /** * 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(); @@ -82,56 +84,63 @@ public interface Automation { /** * 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.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithCreate { + /** + * The entirety of the Automation definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } - /** The Automation definition stages. */ + + /** + * The Automation definition stages. + */ interface DefinitionStages { - /** The first stage of the Automation definition. */ + /** + * The first stage of the Automation definition. + */ interface Blank extends WithLocation { } - /** The stage of the Automation definition allowing to specify location. */ + + /** + * 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. */ @@ -139,229 +148,266 @@ interface WithLocation { /** * 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 Automation definition allowing to specify parent resource. */ + + /** + * The stage of the Automation definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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.WithTags, - DefinitionStages.WithDescription, - DefinitionStages.WithIsEnabled, - DefinitionStages.WithScopes, - DefinitionStages.WithSources, - DefinitionStages.WithActions { + extends DefinitionStages.WithTags, 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 tags. */ + + /** + * 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 description. */ + + /** + * 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. */ + + /** + * 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. */ + + /** + * 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. + * 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. */ + + /** + * 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. + * rules. * @return the next definition stage. */ WithCreate withSources(List sources); } - /** The stage of the Automation definition allowing to specify actions. */ + + /** + * 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. + * 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 { + /** + * 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. */ + + /** + * The Automation update stages. + */ interface UpdateStages { - /** The stage of the Automation update allowing to specify tags. */ + /** + * The stage of the Automation update allowing to specify tags. + */ interface WithTags { /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. + * 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. */ + + /** + * 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. */ + + /** + * 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. */ + + /** + * 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. + * 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. */ + + /** + * 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. + * rules. * @return the next definition stage. */ Update withSources(List sources); } - /** The stage of the Automation update allowing to specify actions. */ + + /** + * 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. + * 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. */ @@ -370,7 +416,7 @@ interface WithActions { /** * 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. @@ -383,7 +429,7 @@ interface WithActions { /** * 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. 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 index 5aab572dca457..2932d91e58953 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** The action that should be triggered. */ +/** + * The action that should be triggered. + */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, @@ -19,17 +21,18 @@ @JsonSubTypes({ @JsonSubTypes.Type(name = "LogicApp", value = AutomationActionLogicApp.class), @JsonSubTypes.Type(name = "EventHub", value = AutomationActionEventHub.class), - @JsonSubTypes.Type(name = "Workspace", value = AutomationActionWorkspace.class) -}) + @JsonSubTypes.Type(name = "Workspace", value = AutomationActionWorkspace.class) }) @Immutable public class AutomationAction { - /** Creates an instance of AutomationAction class. */ + /** + * Creates an instance of AutomationAction class. + */ public AutomationAction() { } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 8d4a940480da5..f0f5d7def421d 100644 --- 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 @@ -35,13 +35,21 @@ public final class AutomationActionEventHub extends AutomationAction { @JsonProperty(value = "connectionString") private String connectionString; - /** Creates an instance of AutomationActionEventHub class. */ + /* + * Indicates whether the trusted service is enabled or not. + */ + @JsonProperty(value = "isTrustedServiceEnabled") + private Boolean isTrustedServiceEnabled; + + /** + * Creates an instance of AutomationActionEventHub class. + */ public AutomationActionEventHub() { } /** * Get the eventHubResourceId property: The target Event Hub Azure Resource ID. - * + * * @return the eventHubResourceId value. */ public String eventHubResourceId() { @@ -50,7 +58,7 @@ public String eventHubResourceId() { /** * Set the eventHubResourceId property: The target Event Hub Azure Resource ID. - * + * * @param eventHubResourceId the eventHubResourceId value to set. * @return the AutomationActionEventHub object itself. */ @@ -61,7 +69,7 @@ public AutomationActionEventHub withEventHubResourceId(String eventHubResourceId /** * Get the sasPolicyName property: The target Event Hub SAS policy name. - * + * * @return the sasPolicyName value. */ public String sasPolicyName() { @@ -71,7 +79,7 @@ public String 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() { @@ -81,7 +89,7 @@ public String 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. */ @@ -90,9 +98,29 @@ public AutomationActionEventHub withConnectionString(String 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 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 index 38fe7c5d0598e..18128148fbc71 100644 --- 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 @@ -10,8 +10,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; /** - * 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. + * 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. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "actionType") @JsonTypeName("LogicApp") @@ -30,14 +30,16 @@ public final class AutomationActionLogicApp extends AutomationAction { @JsonProperty(value = "uri") private String uri; - /** Creates an instance of AutomationActionLogicApp class. */ + /** + * Creates an instance of AutomationActionLogicApp class. + */ public AutomationActionLogicApp() { } /** * 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() { @@ -47,7 +49,7 @@ public String 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. */ @@ -58,7 +60,7 @@ public AutomationActionLogicApp withLogicAppResourceId(String logicAppResourceId /** * 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() { @@ -67,7 +69,7 @@ public String 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. */ @@ -78,7 +80,7 @@ public AutomationActionLogicApp withUri(String uri) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 9fd967924bdfe..ede8b7b09974a 100644 --- 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 @@ -10,11 +10,11 @@ import com.fasterxml.jackson.annotation.JsonTypeName; /** - * The Log Analytics Workspace to which event data will be exported. Security alerts data will reside in the + * 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. + * '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. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "actionType") @JsonTypeName("Workspace") @@ -26,13 +26,15 @@ public final class AutomationActionWorkspace extends AutomationAction { @JsonProperty(value = "workspaceResourceId") private String workspaceResourceId; - /** Creates an instance of AutomationActionWorkspace class. */ + /** + * Creates an instance of AutomationActionWorkspace class. + */ public AutomationActionWorkspace() { } /** * Get the workspaceResourceId property: The fully qualified Log Analytics Workspace Azure Resource ID. - * + * * @return the workspaceResourceId value. */ public String workspaceResourceId() { @@ -41,7 +43,7 @@ public String 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. */ @@ -52,7 +54,7 @@ public AutomationActionWorkspace withWorkspaceResourceId(String workspaceResourc /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationList.java index 4bc9fc3e432c4..d330a5ca764d5 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationList.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationList.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of security automations response. */ +/** + * List of security automations response. + */ @Fluent public final class AutomationList { /* @@ -25,13 +27,15 @@ public final class AutomationList { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of AutomationList class. */ + /** + * Creates an instance of AutomationList class. + */ public AutomationList() { } /** * Get the value property: The list of security automations under the given scope. - * + * * @return the value value. */ public List value() { @@ -40,7 +44,7 @@ public List value() { /** * Set the value property: The list of security automations under the given scope. - * + * * @param value the value value to set. * @return the AutomationList object itself. */ @@ -51,7 +55,7 @@ public AutomationList withValue(List value) { /** * Get the nextLink property: The URI to fetch the next page. - * + * * @return the nextLink value. */ public String nextLink() { @@ -60,14 +64,13 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model AutomationList")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model AutomationList")); } else { value().forEach(e -> e.validate()); } 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 index eb1a7a25fcd6d..71584c443469d 100644 --- 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 @@ -9,8 +9,8 @@ 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. + * 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 { @@ -20,13 +20,15 @@ public final class AutomationRuleSet { @JsonProperty(value = "rules") private List rules; - /** Creates an instance of AutomationRuleSet class. */ + /** + * Creates an instance of AutomationRuleSet class. + */ public AutomationRuleSet() { } /** * Get the rules property: The rules property. - * + * * @return the rules value. */ public List rules() { @@ -35,7 +37,7 @@ public List rules() { /** * Set the rules property: The rules property. - * + * * @param rules the rules value to set. * @return the AutomationRuleSet object itself. */ @@ -46,7 +48,7 @@ public AutomationRuleSet withRules(List rules) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index b6797a2853f0f..1f804b33d891c 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** A single automation scope. */ +/** + * A single automation scope. + */ @Fluent public final class AutomationScope { /* @@ -23,13 +25,15 @@ public final class AutomationScope { @JsonProperty(value = "scopePath") private String scopePath; - /** Creates an instance of AutomationScope class. */ + /** + * Creates an instance of AutomationScope class. + */ public AutomationScope() { } /** * Get the description property: The resources scope description. - * + * * @return the description value. */ public String description() { @@ -38,7 +42,7 @@ public String description() { /** * Set the description property: The resources scope description. - * + * * @param description the description value to set. * @return the AutomationScope object itself. */ @@ -50,7 +54,7 @@ public AutomationScope withDescription(String description) { /** * 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() { @@ -60,7 +64,7 @@ public String 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. */ @@ -71,7 +75,7 @@ public AutomationScope withScopePath(String scopePath) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 7488319504ca2..26aba46562a9e 100644 --- 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 @@ -28,13 +28,15 @@ public final class AutomationSource { @JsonProperty(value = "ruleSets") private List ruleSets; - /** Creates an instance of AutomationSource class. */ + /** + * Creates an instance of AutomationSource class. + */ public AutomationSource() { } /** * Get the eventSource property: A valid event source type. - * + * * @return the eventSource value. */ public EventSource eventSource() { @@ -43,7 +45,7 @@ public EventSource eventSource() { /** * Set the eventSource property: A valid event source type. - * + * * @param eventSource the eventSource value to set. * @return the AutomationSource object itself. */ @@ -55,7 +57,7 @@ public AutomationSource withEventSource(EventSource eventSource) { /** * 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() { @@ -65,7 +67,7 @@ public List 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. */ @@ -76,7 +78,7 @@ public AutomationSource withRuleSets(List ruleSets) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 662e8158cfe2f..a9e3792e819ca 100644 --- 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 @@ -37,13 +37,15 @@ public final class AutomationTriggeringRule { @JsonProperty(value = "operator") private Operator operator; - /** Creates an instance of AutomationTriggeringRule class. */ + /** + * 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() { @@ -52,7 +54,7 @@ public String 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. */ @@ -64,7 +66,7 @@ public AutomationTriggeringRule withPropertyJPath(String propertyJPath) { /** * 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() { @@ -74,7 +76,7 @@ public PropertyType 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. */ @@ -85,7 +87,7 @@ public AutomationTriggeringRule withPropertyType(PropertyType propertyType) { /** * Get the expectedValue property: The expected value. - * + * * @return the expectedValue value. */ public String expectedValue() { @@ -94,7 +96,7 @@ public String expectedValue() { /** * Set the expectedValue property: The expected value. - * + * * @param expectedValue the expectedValue value to set. * @return the AutomationTriggeringRule object itself. */ @@ -106,7 +108,7 @@ public AutomationTriggeringRule withExpectedValue(String expectedValue) { /** * 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() { @@ -116,7 +118,7 @@ public Operator 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. */ @@ -127,7 +129,7 @@ public AutomationTriggeringRule withOperator(Operator operator) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 new file mode 100644 index 0000000000000..7c58483c71e5c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationUpdateModel.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.security.fluent.models.AutomationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +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 + */ + @JsonProperty(value = "properties") + 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() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} 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 index 61079decd3e68..5aa5b623c85ca 100644 --- 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 @@ -6,25 +6,27 @@ import com.azure.resourcemanager.security.fluent.models.AutomationValidationStatusInner; -/** An immutable client-side representation of AutomationValidationStatus. */ +/** + * 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 index 73b46db3ba19f..6b9a1155a8282 100644 --- 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 @@ -9,12 +9,14 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.security.fluent.models.AutomationInner; -/** Resource collection API of Automations. */ +/** + * Resource collection API of Automations. + */ public interface Automations { /** * 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}. @@ -24,7 +26,7 @@ public interface Automations { /** * 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. @@ -36,9 +38,9 @@ public interface Automations { /** * 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -49,9 +51,9 @@ public interface Automations { /** * 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -62,9 +64,9 @@ public interface Automations { /** * Retrieves information about the model of a security automation. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param automationName The security automation name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -72,14 +74,14 @@ public interface Automations { * @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); + 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 within the user's subscription. The name is case - * insensitive. + * 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. @@ -90,9 +92,9 @@ Response getByResourceGroupWithResponse( /** * Deletes a security automation. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param automationName The security automation name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -104,9 +106,9 @@ Response getByResourceGroupWithResponse( /** * Deletes a security automation. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -117,9 +119,9 @@ Response getByResourceGroupWithResponse( /** * 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param automationName The security automation name. * @param automation The security automation resource. * @param context The context to associate with this operation. @@ -128,15 +130,15 @@ Response getByResourceGroupWithResponse( * @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); + 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 within the user's subscription. The name is case - * insensitive. + * insensitive. * @param automationName The security automation name. * @param automation The security automation resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -148,7 +150,7 @@ Response validateWithResponse( /** * 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. @@ -159,7 +161,7 @@ Response validateWithResponse( /** * 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. @@ -171,7 +173,7 @@ Response validateWithResponse( /** * 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. @@ -181,7 +183,7 @@ Response validateWithResponse( /** * 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. @@ -193,7 +195,7 @@ Response validateWithResponse( /** * Begins definition for a new Automation resource. - * + * * @param name resource name. * @return the first stage of the new Automation definition. */ diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwAssumeRoleAuthenticationDetailsProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwAssumeRoleAuthenticationDetailsProperties.java index 636cbdb29fbb6..970082f3ded18 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwAssumeRoleAuthenticationDetailsProperties.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwAssumeRoleAuthenticationDetailsProperties.java @@ -38,13 +38,15 @@ public final class AwAssumeRoleAuthenticationDetailsProperties extends Authentic @JsonProperty(value = "awsExternalId", required = true) private String awsExternalId; - /** Creates an instance of AwAssumeRoleAuthenticationDetailsProperties class. */ + /** + * Creates an instance of AwAssumeRoleAuthenticationDetailsProperties class. + */ public AwAssumeRoleAuthenticationDetailsProperties() { } /** * Get the accountId property: The ID of the cloud account. - * + * * @return the accountId value. */ public String accountId() { @@ -52,9 +54,9 @@ public String accountId() { } /** - * Get the awsAssumeRoleArn property: Assumed role ID is an identifier that you can use to create temporary security - * credentials. - * + * Get the awsAssumeRoleArn property: Assumed role ID is an identifier that you can use to create temporary + * security credentials. + * * @return the awsAssumeRoleArn value. */ public String awsAssumeRoleArn() { @@ -62,9 +64,9 @@ public String awsAssumeRoleArn() { } /** - * Set the awsAssumeRoleArn property: Assumed role ID is an identifier that you can use to create temporary security - * credentials. - * + * Set the awsAssumeRoleArn property: Assumed role ID is an identifier that you can use to create temporary + * security credentials. + * * @param awsAssumeRoleArn the awsAssumeRoleArn value to set. * @return the AwAssumeRoleAuthenticationDetailsProperties object itself. */ @@ -75,7 +77,7 @@ public AwAssumeRoleAuthenticationDetailsProperties withAwsAssumeRoleArn(String a /** * Get the awsExternalId property: A unique identifier that is required when you assume a role in another account. - * + * * @return the awsExternalId value. */ public String awsExternalId() { @@ -84,7 +86,7 @@ public String awsExternalId() { /** * Set the awsExternalId property: A unique identifier that is required when you assume a role in another account. - * + * * @param awsExternalId the awsExternalId value to set. * @return the AwAssumeRoleAuthenticationDetailsProperties object itself. */ @@ -95,25 +97,19 @@ public AwAssumeRoleAuthenticationDetailsProperties withAwsExternalId(String awsE /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (awsAssumeRoleArn() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property awsAssumeRoleArn in model" - + " AwAssumeRoleAuthenticationDetailsProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property awsAssumeRoleArn in model AwAssumeRoleAuthenticationDetailsProperties")); } if (awsExternalId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property awsExternalId in model" - + " AwAssumeRoleAuthenticationDetailsProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property awsExternalId in model AwAssumeRoleAuthenticationDetailsProperties")); } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsCredsAuthenticationDetailsProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsCredsAuthenticationDetailsProperties.java index 5cff776d8f7a0..d6fed89161aac 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsCredsAuthenticationDetailsProperties.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsCredsAuthenticationDetailsProperties.java @@ -37,13 +37,15 @@ public final class AwsCredsAuthenticationDetailsProperties extends Authenticatio @JsonProperty(value = "awsSecretAccessKey", required = true) private String awsSecretAccessKey; - /** Creates an instance of AwsCredsAuthenticationDetailsProperties class. */ + /** + * Creates an instance of AwsCredsAuthenticationDetailsProperties class. + */ public AwsCredsAuthenticationDetailsProperties() { } /** * Get the accountId property: The ID of the cloud account. - * + * * @return the accountId value. */ public String accountId() { @@ -52,7 +54,7 @@ public String accountId() { /** * Get the awsAccessKeyId property: Public key element of the AWS credential object (write only). - * + * * @return the awsAccessKeyId value. */ public String awsAccessKeyId() { @@ -61,7 +63,7 @@ public String awsAccessKeyId() { /** * Set the awsAccessKeyId property: Public key element of the AWS credential object (write only). - * + * * @param awsAccessKeyId the awsAccessKeyId value to set. * @return the AwsCredsAuthenticationDetailsProperties object itself. */ @@ -72,7 +74,7 @@ public AwsCredsAuthenticationDetailsProperties withAwsAccessKeyId(String awsAcce /** * Get the awsSecretAccessKey property: Secret key element of the AWS credential object (write only). - * + * * @return the awsSecretAccessKey value. */ public String awsSecretAccessKey() { @@ -81,7 +83,7 @@ public String awsSecretAccessKey() { /** * Set the awsSecretAccessKey property: Secret key element of the AWS credential object (write only). - * + * * @param awsSecretAccessKey the awsSecretAccessKey value to set. * @return the AwsCredsAuthenticationDetailsProperties object itself. */ @@ -92,24 +94,19 @@ public AwsCredsAuthenticationDetailsProperties withAwsSecretAccessKey(String aws /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (awsAccessKeyId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property awsAccessKeyId in model AwsCredsAuthenticationDetailsProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property awsAccessKeyId in model AwsCredsAuthenticationDetailsProperties")); } if (awsSecretAccessKey() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property awsSecretAccessKey in model" - + " AwsCredsAuthenticationDetailsProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property awsSecretAccessKey in model AwsCredsAuthenticationDetailsProperties")); } } 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 index bfcd9c358cfd0..4ede05827e7fa 100644 --- 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 @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; -/** The AWS connector environment data. */ +/** + * The AWS connector environment data. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "environmentType") @JsonTypeName("AwsAccount") @Fluent @@ -33,13 +35,21 @@ public final class AwsEnvironmentData extends EnvironmentData { @JsonProperty(value = "accountName", access = JsonProperty.Access.WRITE_ONLY) private String accountName; - /** Creates an instance of AwsEnvironmentData class. */ + /* + * Scan interval in hours (value should be between 1-hour to 24-hours) + */ + @JsonProperty(value = "scanInterval") + private Long scanInterval; + + /** + * Creates an instance of AwsEnvironmentData class. + */ public AwsEnvironmentData() { } /** * Get the organizationalData property: The AWS account's organizational data. - * + * * @return the organizationalData value. */ public AwsOrganizationalData organizationalData() { @@ -48,7 +58,7 @@ public AwsOrganizationalData organizationalData() { /** * Set the organizationalData property: The AWS account's organizational data. - * + * * @param organizationalData the organizationalData value to set. * @return the AwsEnvironmentData object itself. */ @@ -59,7 +69,7 @@ public AwsEnvironmentData withOrganizationalData(AwsOrganizationalData organizat /** * Get the regions property: list of regions to scan. - * + * * @return the regions value. */ public List regions() { @@ -68,7 +78,7 @@ public List regions() { /** * Set the regions property: list of regions to scan. - * + * * @param regions the regions value to set. * @return the AwsEnvironmentData object itself. */ @@ -79,16 +89,36 @@ public AwsEnvironmentData withRegions(List regions) { /** * 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 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 index 01da3de98d1fd..666b6aaaa67a0 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** The AWS organization data. */ +/** + * The AWS organization data. + */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, @@ -18,17 +20,18 @@ @JsonTypeName("AwsOrganizationalData") @JsonSubTypes({ @JsonSubTypes.Type(name = "Organization", value = AwsOrganizationalDataMaster.class), - @JsonSubTypes.Type(name = "Member", value = AwsOrganizationalDataMember.class) -}) + @JsonSubTypes.Type(name = "Member", value = AwsOrganizationalDataMember.class) }) @Immutable public class AwsOrganizationalData { - /** Creates an instance of AwsOrganizationalData class. */ + /** + * Creates an instance of AwsOrganizationalData class. + */ public AwsOrganizationalData() { } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index b7b8ffb22a08d..1b9e4b252ec0f 100644 --- 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 @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; -/** The AWS organization data for the master account. */ +/** + * The AWS organization data for the master account. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "organizationMembershipType") @JsonTypeName("Organization") @Fluent @@ -27,14 +29,16 @@ public final class AwsOrganizationalDataMaster extends AwsOrganizationalData { @JsonProperty(value = "excludedAccountIds") private List excludedAccountIds; - /** Creates an instance of AwsOrganizationalDataMaster class. */ + /** + * Creates an instance of AwsOrganizationalDataMaster class. + */ public AwsOrganizationalDataMaster() { } /** * 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() { @@ -44,7 +48,7 @@ public String 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. */ @@ -56,7 +60,7 @@ public AwsOrganizationalDataMaster withStacksetName(String stacksetName) { /** * 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() { @@ -66,7 +70,7 @@ public List 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. */ @@ -77,7 +81,7 @@ public AwsOrganizationalDataMaster withExcludedAccountIds(List excludedA /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 6951419d2b761..6ebbc86b97402 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** The AWS organization data for the member account. */ +/** + * The AWS organization data for the member account. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "organizationMembershipType") @JsonTypeName("Member") @Fluent @@ -20,14 +22,16 @@ public final class AwsOrganizationalDataMember extends AwsOrganizationalData { @JsonProperty(value = "parentHierarchyId") private String parentHierarchyId; - /** Creates an instance of AwsOrganizationalDataMember class. */ + /** + * Creates an instance of AwsOrganizationalDataMember class. + */ public AwsOrganizationalDataMember() { } /** * 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() { @@ -37,7 +41,7 @@ public String 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. */ @@ -48,7 +52,7 @@ public AwsOrganizationalDataMember withParentHierarchyId(String parentHierarchyI /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 new file mode 100644 index 0000000000000..efd6f400d3caf --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrg.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the properties property: Azure DevOps Organization properties. + * + * @return the properties value. + */ + AzureDevOpsOrgProperties properties(); + + /** + * 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 new file mode 100644 index 0000000000000..4c7dd6da52dab --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgListResponse.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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: Gets or sets list of resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: Gets or sets next link to scroll over the results. + * + * @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 new file mode 100644 index 0000000000000..6eb6fdc84e256 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgProperties.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * Azure DevOps Organization properties. + */ +@Fluent +public final class AzureDevOpsOrgProperties { + /* + * Gets or sets resource status message. + */ + @JsonProperty(value = "provisioningStatusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningStatusMessage; + + /* + * Gets or sets time when resource was last checked. + */ + @JsonProperty(value = "provisioningStatusUpdateTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "provisioningState") + 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. + */ + @JsonProperty(value = "onboardingState") + private OnboardingState onboardingState; + + /* + * Configuration payload for PR Annotations. + */ + @JsonProperty(value = "actionableRemediation") + private ActionableRemediation actionableRemediation; + + /** + * Creates an instance of AzureDevOpsOrgProperties class. + */ + public AzureDevOpsOrgProperties() { + } + + /** + * Get the provisioningStatusMessage property: Gets or sets resource status message. + * + * @return the provisioningStatusMessage value. + */ + public String provisioningStatusMessage() { + return this.provisioningStatusMessage; + } + + /** + * Get the provisioningStatusUpdateTimeUtc property: Gets or sets 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; + } + + /** + * Set 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. + * + * @param provisioningState the provisioningState value to set. + * @return the AzureDevOpsOrgProperties object itself. + */ + public AzureDevOpsOrgProperties withProvisioningState(DevOpsProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * 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(); + } + } +} 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 new file mode 100644 index 0000000000000..8da159b8e50e3 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgs.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 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 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 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 Azure DevOps organization 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 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 Azure DevOps organization 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 azure DevOps Organization resource. + */ + AzureDevOpsOrg get(String resourceGroupName, String securityConnectorName, String orgName); + + /** + * 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 new file mode 100644 index 0000000000000..c8b69c7bd2278 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProject.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the properties property: Azure DevOps Project properties. + * + * @return the properties value. + */ + AzureDevOpsProjectProperties properties(); + + /** + * 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 Azure DevOps organization name. + * @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/AzureDevOpsProjectListResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjectListResponse.java new file mode 100644 index 0000000000000..3918608a6f0c2 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjectListResponse.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.security.fluent.models.AzureDevOpsProjectInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * List of RP resources which supports pagination. + */ +@Fluent +public final class AzureDevOpsProjectListResponse { + /* + * Gets or sets list of resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets next link to scroll over the results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Creates an instance of AzureDevOpsProjectListResponse class. + */ + public AzureDevOpsProjectListResponse() { + } + + /** + * Get the value property: Gets or sets list of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets list of resources. + * + * @param value the value value to set. + * @return the AzureDevOpsProjectListResponse object itself. + */ + public AzureDevOpsProjectListResponse withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets next link to scroll over the results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets next link to scroll over the results. + * + * @param nextLink the nextLink value to set. + * @return the AzureDevOpsProjectListResponse object itself. + */ + public AzureDevOpsProjectListResponse withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} 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 new file mode 100644 index 0000000000000..0e9cb53d01c21 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjectProperties.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * Azure DevOps Project properties. + */ +@Fluent +public final class AzureDevOpsProjectProperties { + /* + * Gets or sets resource status message. + */ + @JsonProperty(value = "provisioningStatusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningStatusMessage; + + /* + * Gets or sets time when resource was last checked. + */ + @JsonProperty(value = "provisioningStatusUpdateTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "provisioningState") + private DevOpsProvisioningState provisioningState; + + /* + * Gets or sets parent Azure DevOps Organization name. + */ + @JsonProperty(value = "parentOrgName") + private String parentOrgName; + + /* + * Gets or sets Azure DevOps Project id. + */ + @JsonProperty(value = "projectId", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "onboardingState") + private OnboardingState onboardingState; + + /* + * Configuration payload for PR Annotations. + */ + @JsonProperty(value = "actionableRemediation") + private ActionableRemediation actionableRemediation; + + /** + * Creates an instance of AzureDevOpsProjectProperties class. + */ + public AzureDevOpsProjectProperties() { + } + + /** + * Get the provisioningStatusMessage property: Gets or sets resource status message. + * + * @return the provisioningStatusMessage value. + */ + public String provisioningStatusMessage() { + return this.provisioningStatusMessage; + } + + /** + * Get the provisioningStatusUpdateTimeUtc property: Gets or sets 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; + } + + /** + * Set 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. + * + * @param provisioningState the provisioningState value to set. + * @return the AzureDevOpsProjectProperties object itself. + */ + public AzureDevOpsProjectProperties withProvisioningState(DevOpsProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * 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(); + } + } +} 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 new file mode 100644 index 0000000000000..2b5f0629348a4 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjects.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 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 Azure DevOps organization 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, 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 Azure DevOps organization 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, String orgName, + 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 Azure DevOps organization name. + * @param projectName The project 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 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 Azure DevOps organization name. + * @param projectName The project 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 azure DevOps Project resource. + */ + AzureDevOpsProject get(String resourceGroupName, String securityConnectorName, String orgName, String projectName); + + /** + * 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 new file mode 100644 index 0000000000000..65f560c6266d6 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepos.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 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 Azure DevOps organization name. + * @param projectName The project 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, 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 Azure DevOps organization name. + * @param projectName The project 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, String orgName, + String projectName, 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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository 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 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 Azure DevOps organization name. + * @param projectName The project name. + * @param repoName The repository 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 azure DevOps Repository resource. + */ + AzureDevOpsRepository get(String resourceGroupName, String securityConnectorName, String orgName, + String projectName, String repoName); + + /** + * 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 new file mode 100644 index 0000000000000..7c3114d7c2724 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepository.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the properties property: Azure DevOps Repository properties. + * + * @return the properties value. + */ + AzureDevOpsRepositoryProperties properties(); + + /** + * 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 Azure DevOps organization name. + * @param projectName The project name. + * @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/AzureDevOpsRepositoryListResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepositoryListResponse.java new file mode 100644 index 0000000000000..96282da28947b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepositoryListResponse.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.security.fluent.models.AzureDevOpsRepositoryInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * List of RP resources which supports pagination. + */ +@Fluent +public final class AzureDevOpsRepositoryListResponse { + /* + * Gets or sets list of resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets next link to scroll over the results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Creates an instance of AzureDevOpsRepositoryListResponse class. + */ + public AzureDevOpsRepositoryListResponse() { + } + + /** + * Get the value property: Gets or sets list of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets list of resources. + * + * @param value the value value to set. + * @return the AzureDevOpsRepositoryListResponse object itself. + */ + public AzureDevOpsRepositoryListResponse withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets next link to scroll over the results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets next link to scroll over the results. + * + * @param nextLink the nextLink value to set. + * @return the AzureDevOpsRepositoryListResponse object itself. + */ + public AzureDevOpsRepositoryListResponse withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} 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 new file mode 100644 index 0000000000000..cdb7166152dfb --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepositoryProperties.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * Azure DevOps Repository properties. + */ +@Fluent +public final class AzureDevOpsRepositoryProperties { + /* + * Gets or sets resource status message. + */ + @JsonProperty(value = "provisioningStatusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningStatusMessage; + + /* + * Gets or sets time when resource was last checked. + */ + @JsonProperty(value = "provisioningStatusUpdateTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "provisioningState") + private DevOpsProvisioningState provisioningState; + + /* + * Gets or sets parent Azure DevOps Organization name. + */ + @JsonProperty(value = "parentOrgName") + private String parentOrgName; + + /* + * Gets or sets parent Azure DevOps Project name. + */ + @JsonProperty(value = "parentProjectName") + private String parentProjectName; + + /* + * Gets or sets Azure DevOps Repository id. + */ + @JsonProperty(value = "repoId", access = JsonProperty.Access.WRITE_ONLY) + private String repoId; + + /* + * Gets or sets Azure DevOps Repository url. + */ + @JsonProperty(value = "repoUrl", access = JsonProperty.Access.WRITE_ONLY) + private String repoUrl; + + /* + * Gets or sets Azure DevOps repository visibility, whether it is public or private etc. + */ + @JsonProperty(value = "visibility", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "onboardingState") + private OnboardingState onboardingState; + + /* + * Configuration payload for PR Annotations. + */ + @JsonProperty(value = "actionableRemediation") + private ActionableRemediation actionableRemediation; + + /** + * Creates an instance of AzureDevOpsRepositoryProperties class. + */ + public AzureDevOpsRepositoryProperties() { + } + + /** + * Get the provisioningStatusMessage property: Gets or sets resource status message. + * + * @return the provisioningStatusMessage value. + */ + public String provisioningStatusMessage() { + return this.provisioningStatusMessage; + } + + /** + * Get the provisioningStatusUpdateTimeUtc property: Gets or sets 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; + } + + /** + * Set 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. + * + * @param provisioningState the provisioningState value to set. + * @return the AzureDevOpsRepositoryProperties object itself. + */ + public AzureDevOpsRepositoryProperties withProvisioningState(DevOpsProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * 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(); + } + } +} 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 index 1f9e0d85d8461..2f07e93a253b9 100644 --- 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 @@ -8,18 +8,22 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** The AzureDevOps scope connector's environment data. */ +/** + * The AzureDevOps scope connector's environment data. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "environmentType") @JsonTypeName("AzureDevOpsScope") @Immutable public final class AzureDevOpsScopeEnvironmentData extends EnvironmentData { - /** Creates an instance of AzureDevOpsScopeEnvironmentData class. */ + /** + * Creates an instance of AzureDevOpsScopeEnvironmentData class. + */ public AzureDevOpsScopeEnvironmentData() { } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 93ae42309e0ef..dde973b91ebdd 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Details of the Azure resource that was assessed. */ +/** + * Details of the Azure resource that was assessed. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "source") @JsonTypeName("Azure") @Immutable @@ -20,13 +22,15 @@ public final class AzureResourceDetails extends ResourceDetails { @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; - /** Creates an instance of AzureResourceDetails class. */ + /** + * Creates an instance of AzureResourceDetails class. + */ public AzureResourceDetails() { } /** * Get the id property: Azure resource Id of the assessed resource. - * + * * @return the id value. */ public String id() { @@ -35,7 +39,7 @@ public String id() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 71269931e0706..52c4ac300968c 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Azure resource identifier. */ +/** + * Azure resource identifier. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") @JsonTypeName("AzureResource") @Immutable @@ -20,13 +22,15 @@ public final class AzureResourceIdentifier extends ResourceIdentifier { @JsonProperty(value = "azureResourceId", access = JsonProperty.Access.WRITE_ONLY) private String azureResourceId; - /** Creates an instance of AzureResourceIdentifier class. */ + /** + * Creates an instance of AzureResourceIdentifier class. + */ public AzureResourceIdentifier() { } /** * Get the azureResourceId property: ARM resource identifier for the cloud resource being alerted on. - * + * * @return the azureResourceId value. */ public String azureResourceId() { @@ -35,7 +39,7 @@ public String azureResourceId() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index fb5c7218394af..6daa6a30dff48 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** Describes an Azure resource with kind. */ +/** + * Describes an Azure resource with kind. + */ @Immutable public final class AzureResourceLink { /* @@ -16,13 +18,15 @@ public final class AzureResourceLink { @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; - /** Creates an instance of AzureResourceLink class. */ + /** + * Creates an instance of AzureResourceLink class. + */ public AzureResourceLink() { } /** * Get the id property: Azure resource Id. - * + * * @return the id value. */ public String id() { @@ -31,7 +35,7 @@ public String id() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 new file mode 100644 index 0000000000000..50d6ef79f6e22 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureServersSetting.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsAzureSettingProperties; +import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsSettingInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * A vulnerability assessments setting on Azure servers in the defined scope. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("AzureServersSetting") +@Fluent +public final class AzureServersSetting extends ServerVulnerabilityAssessmentsSettingInner { + /* + * The vulnerability assessments setting properties on Azure servers in the defined scope. + */ + @JsonProperty(value = "properties") + private ServerVulnerabilityAssessmentsAzureSettingProperties innerProperties; + + /** + * Creates an instance of AzureServersSetting class. + */ + public AzureServersSetting() { + } + + /** + * 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 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() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureTrackedResourceLocation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureTrackedResourceLocation.java index c48378441c4cc..bb5adbfb4f261 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureTrackedResourceLocation.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureTrackedResourceLocation.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Describes an Azure resource with location. */ +/** + * Describes an Azure resource with location. + */ @Fluent public class AzureTrackedResourceLocation { /* @@ -16,13 +18,15 @@ public class AzureTrackedResourceLocation { @JsonProperty(value = "location") private String location; - /** Creates an instance of AzureTrackedResourceLocation class. */ + /** + * Creates an instance of AzureTrackedResourceLocation class. + */ public AzureTrackedResourceLocation() { } /** * Get the location property: Location where the resource is stored. - * + * * @return the location value. */ public String location() { @@ -31,7 +35,7 @@ public String location() { /** * Set the location property: Location where the resource is stored. - * + * * @param location the location value to set. * @return the AzureTrackedResourceLocation object itself. */ @@ -42,7 +46,7 @@ public AzureTrackedResourceLocation withLocation(String location) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 99852d05bed64..a057ceaf1e39a 100644 --- 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 @@ -9,7 +9,9 @@ import java.time.OffsetDateTime; import java.util.List; -/** Baseline details. */ +/** + * Baseline details. + */ @Fluent public final class Baseline { /* @@ -24,13 +26,15 @@ public final class Baseline { @JsonProperty(value = "updatedTime") private OffsetDateTime updatedTime; - /** Creates an instance of Baseline class. */ + /** + * Creates an instance of Baseline class. + */ public Baseline() { } /** * Get the expectedResults property: Expected results. - * + * * @return the expectedResults value. */ public List> expectedResults() { @@ -39,7 +43,7 @@ public List> expectedResults() { /** * Set the expectedResults property: Expected results. - * + * * @param expectedResults the expectedResults value to set. * @return the Baseline object itself. */ @@ -50,7 +54,7 @@ public Baseline withExpectedResults(List> expectedResults) { /** * Get the updatedTime property: Baseline update time (UTC). - * + * * @return the updatedTime value. */ public OffsetDateTime updatedTime() { @@ -59,7 +63,7 @@ public OffsetDateTime updatedTime() { /** * Set the updatedTime property: Baseline update time (UTC). - * + * * @param updatedTime the updatedTime value to set. * @return the Baseline object itself. */ @@ -70,7 +74,7 @@ public Baseline withUpdatedTime(OffsetDateTime updatedTime) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index dfd5b9663173c..4bf91b01f9efd 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The rule result adjusted with baseline. */ +/** + * The rule result adjusted with baseline. + */ @Fluent public final class BaselineAdjustedResult { /* @@ -35,13 +37,15 @@ public final class BaselineAdjustedResult { @JsonProperty(value = "resultsOnlyInBaseline") private List> resultsOnlyInBaseline; - /** Creates an instance of BaselineAdjustedResult class. */ + /** + * Creates an instance of BaselineAdjustedResult class. + */ public BaselineAdjustedResult() { } /** * Get the baseline property: Baseline details. - * + * * @return the baseline value. */ public Baseline baseline() { @@ -50,7 +54,7 @@ public Baseline baseline() { /** * Set the baseline property: Baseline details. - * + * * @param baseline the baseline value to set. * @return the BaselineAdjustedResult object itself. */ @@ -61,7 +65,7 @@ public BaselineAdjustedResult withBaseline(Baseline baseline) { /** * Get the status property: The rule result status. - * + * * @return the status value. */ public RuleStatus status() { @@ -70,7 +74,7 @@ public RuleStatus status() { /** * Set the status property: The rule result status. - * + * * @param status the status value to set. * @return the BaselineAdjustedResult object itself. */ @@ -81,7 +85,7 @@ public BaselineAdjustedResult withStatus(RuleStatus status) { /** * Get the resultsNotInBaseline property: Results the are not in baseline. - * + * * @return the resultsNotInBaseline value. */ public List> resultsNotInBaseline() { @@ -90,7 +94,7 @@ public List> resultsNotInBaseline() { /** * Set the resultsNotInBaseline property: Results the are not in baseline. - * + * * @param resultsNotInBaseline the resultsNotInBaseline value to set. * @return the BaselineAdjustedResult object itself. */ @@ -101,7 +105,7 @@ public BaselineAdjustedResult withResultsNotInBaseline(List> result /** * Get the resultsOnlyInBaseline property: Results the are in baseline. - * + * * @return the resultsOnlyInBaseline value. */ public List> resultsOnlyInBaseline() { @@ -110,7 +114,7 @@ public List> resultsOnlyInBaseline() { /** * Set the resultsOnlyInBaseline property: Results the are in baseline. - * + * * @param resultsOnlyInBaseline the resultsOnlyInBaseline value to set. * @return the BaselineAdjustedResult object itself. */ @@ -121,7 +125,7 @@ public BaselineAdjustedResult withResultsOnlyInBaseline(List> resul /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 06dc061d3069e..86edae55926c7 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The benchmark references. */ +/** + * The benchmark references. + */ @Fluent public final class BenchmarkReference { /* @@ -22,13 +24,15 @@ public final class BenchmarkReference { @JsonProperty(value = "reference") private String reference; - /** Creates an instance of BenchmarkReference class. */ + /** + * Creates an instance of BenchmarkReference class. + */ public BenchmarkReference() { } /** * Get the benchmark property: The benchmark name. - * + * * @return the benchmark value. */ public String benchmark() { @@ -37,7 +41,7 @@ public String benchmark() { /** * Set the benchmark property: The benchmark name. - * + * * @param benchmark the benchmark value to set. * @return the BenchmarkReference object itself. */ @@ -48,7 +52,7 @@ public BenchmarkReference withBenchmark(String benchmark) { /** * Get the reference property: The benchmark reference. - * + * * @return the reference value. */ public String reference() { @@ -57,7 +61,7 @@ public String reference() { /** * Set the reference property: The benchmark reference. - * + * * @param reference the reference value to set. * @return the BenchmarkReference object itself. */ @@ -68,7 +72,7 @@ public BenchmarkReference withReference(String reference) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 new file mode 100644 index 0000000000000..f579d5a558ef9 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BuiltInInfoType.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** + * Pre-configured sensitive information type. + */ +@Fluent +public final class BuiltInInfoType { + /* + * Display name of the info type + */ + @JsonProperty(value = "name") + private String name; + + /* + * Id of the info type + */ + @JsonProperty(value = "id") + private UUID id; + + /* + * Category of the built-in info type + */ + @JsonProperty(value = "type") + private String type; + + /** + * Creates an instance of BuiltInInfoType class. + */ + public BuiltInInfoType() { + } + + /** + * Get the name property: Display name of the info type. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Display name of the info type. + * + * @param name the name value to set. + * @return the BuiltInInfoType object itself. + */ + public BuiltInInfoType withName(String name) { + this.name = name; + return this; + } + + /** + * Get the id property: Id of the info type. + * + * @return the id value. + */ + public UUID id() { + return this.id; + } + + /** + * Set the id property: Id of the info type. + * + * @param id the id value to set. + * @return the BuiltInInfoType object itself. + */ + public BuiltInInfoType withId(UUID id) { + this.id = id; + return this; + } + + /** + * Get the type property: Category of the built-in info type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Category of the built-in info type. + * + * @param type the type value to set. + * @return the BuiltInInfoType object itself. + */ + public BuiltInInfoType withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 index e16b0198c97e3..2c284f4c2bc28 100644 --- 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 @@ -8,38 +8,58 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Alert Simulator supported bundles. */ +/** + * Alert Simulator supported bundles. + */ public final class BundleType extends ExpandableStringEnum { - /** Static value AppServices for BundleType. */ + /** + * Static value AppServices for BundleType. + */ public static final BundleType APP_SERVICES = fromString("AppServices"); - /** Static value DNS for BundleType. */ + /** + * Static value DNS for BundleType. + */ public static final BundleType DNS = fromString("DNS"); - /** Static value KeyVaults for BundleType. */ + /** + * Static value KeyVaults for BundleType. + */ public static final BundleType KEY_VAULTS = fromString("KeyVaults"); - /** Static value KubernetesService for BundleType. */ + /** + * Static value KubernetesService for BundleType. + */ public static final BundleType KUBERNETES_SERVICE = fromString("KubernetesService"); - /** Static value ResourceManager for BundleType. */ + /** + * Static value ResourceManager for BundleType. + */ public static final BundleType RESOURCE_MANAGER = fromString("ResourceManager"); - /** Static value SqlServers for BundleType. */ + /** + * Static value SqlServers for BundleType. + */ public static final BundleType SQL_SERVERS = fromString("SqlServers"); - /** Static value StorageAccounts for BundleType. */ + /** + * Static value StorageAccounts for BundleType. + */ public static final BundleType STORAGE_ACCOUNTS = fromString("StorageAccounts"); - /** Static value VirtualMachines for BundleType. */ + /** + * Static value VirtualMachines for BundleType. + */ public static final BundleType VIRTUAL_MACHINES = fromString("VirtualMachines"); - /** Static value CosmosDbs for BundleType. */ + /** + * Static value CosmosDbs for BundleType. + */ public static final BundleType COSMOS_DBS = fromString("CosmosDbs"); /** * Creates a new instance of BundleType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -48,7 +68,7 @@ public BundleType() { /** * Creates or finds a BundleType from its string representation. - * + * * @param name a name to look for. * @return the corresponding BundleType. */ @@ -59,7 +79,7 @@ public static BundleType fromString(String name) { /** * Gets known BundleType values. - * + * * @return known BundleType values. */ public static Collection values() { 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 index deadc86057452..0f3ad301c78d3 100644 --- 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 @@ -8,26 +8,38 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The categories of resource that is at risk when the assessment is unhealthy. */ +/** + * The categories of resource that is at risk when the assessment is unhealthy. + */ public final class Categories extends ExpandableStringEnum { - /** Static value Compute for Categories. */ + /** + * Static value Compute for Categories. + */ public static final Categories COMPUTE = fromString("Compute"); - /** Static value Networking for Categories. */ + /** + * Static value Networking for Categories. + */ public static final Categories NETWORKING = fromString("Networking"); - /** Static value Data for Categories. */ + /** + * Static value Data for Categories. + */ public static final Categories DATA = fromString("Data"); - /** Static value IdentityAndAccess for Categories. */ + /** + * Static value IdentityAndAccess for Categories. + */ public static final Categories IDENTITY_AND_ACCESS = fromString("IdentityAndAccess"); - /** Static value IoT for Categories. */ + /** + * Static value IoT for Categories. + */ public static final Categories IOT = fromString("IoT"); /** * Creates a new instance of Categories value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -36,7 +48,7 @@ public Categories() { /** * Creates or finds a Categories from its string representation. - * + * * @param name a name to look for. * @return the corresponding Categories. */ @@ -47,7 +59,7 @@ public static Categories fromString(String name) { /** * Gets known Categories values. - * + * * @return known Categories values. */ public static Collection values() { 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 new file mode 100644 index 0000000000000..337cfc02f7ae8 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CategoryConfiguration.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Severity level per category configuration for PR Annotations. + */ +@Fluent +public final class CategoryConfiguration { + /* + * Gets or sets minimum severity level for a given category. + */ + @JsonProperty(value = "minimumSeverityLevel") + private String minimumSeverityLevel; + + /* + * Rule categories. + * Code - code scanning results. + * Artifact scanning results. + * Dependencies scanning results. + * IaC results. + * Secrets scanning results. + * Container scanning results. + */ + @JsonProperty(value = "category") + 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() { + } +} 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 index 7fd9efb1e94b8..4935e5233d231 100644 --- 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 @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents a security solution which sends CEF logs to an OMS workspace. */ +/** + * Represents a security solution which sends CEF logs to an OMS workspace. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("CEF") @Fluent @@ -21,13 +23,15 @@ public final class CefExternalSecuritySolution extends ExternalSecuritySolutionI @JsonProperty(value = "properties") private CefSolutionProperties properties; - /** Creates an instance of CefExternalSecuritySolution class. */ + /** + * Creates an instance of CefExternalSecuritySolution class. + */ public CefExternalSecuritySolution() { } /** * Get the properties property: The external security solution properties for CEF solutions. - * + * * @return the properties value. */ public CefSolutionProperties properties() { @@ -36,7 +40,7 @@ public CefSolutionProperties properties() { /** * Set the properties property: The external security solution properties for CEF solutions. - * + * * @param properties the properties value to set. * @return the CefExternalSecuritySolution object itself. */ @@ -47,7 +51,7 @@ public CefExternalSecuritySolution withProperties(CefSolutionProperties properti /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index aa7d3c3e7e1b2..bfb05b218fdf4 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The external security solution properties for CEF solutions. */ +/** + * The external security solution properties for CEF solutions. + */ @Fluent public final class CefSolutionProperties extends ExternalSecuritySolutionProperties { /* @@ -28,13 +30,15 @@ public final class CefSolutionProperties extends ExternalSecuritySolutionPropert @JsonProperty(value = "lastEventReceived") private String lastEventReceived; - /** Creates an instance of CefSolutionProperties class. */ + /** + * Creates an instance of CefSolutionProperties class. + */ public CefSolutionProperties() { } /** * Get the hostname property: The hostname property. - * + * * @return the hostname value. */ public String hostname() { @@ -43,7 +47,7 @@ public String hostname() { /** * Set the hostname property: The hostname property. - * + * * @param hostname the hostname value to set. * @return the CefSolutionProperties object itself. */ @@ -54,7 +58,7 @@ public CefSolutionProperties withHostname(String hostname) { /** * Get the agent property: The agent property. - * + * * @return the agent value. */ public String agent() { @@ -63,7 +67,7 @@ public String agent() { /** * Set the agent property: The agent property. - * + * * @param agent the agent value to set. * @return the CefSolutionProperties object itself. */ @@ -74,7 +78,7 @@ public CefSolutionProperties withAgent(String agent) { /** * Get the lastEventReceived property: The lastEventReceived property. - * + * * @return the lastEventReceived value. */ public String lastEventReceived() { @@ -83,7 +87,7 @@ public String lastEventReceived() { /** * Set the lastEventReceived property: The lastEventReceived property. - * + * * @param lastEventReceived the lastEventReceived value to set. * @return the CefSolutionProperties object itself. */ @@ -92,21 +96,27 @@ public CefSolutionProperties withLastEventReceived(String lastEventReceived) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CefSolutionProperties withDeviceVendor(String deviceVendor) { super.withDeviceVendor(deviceVendor); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CefSolutionProperties withDeviceType(String deviceType) { super.withDeviceType(deviceType); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CefSolutionProperties withWorkspace(ConnectedWorkspace workspace) { super.withWorkspace(workspace); @@ -115,7 +125,7 @@ public CefSolutionProperties withWorkspace(ConnectedWorkspace workspace) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 667eb58402de6..7ea279843cc95 100644 --- 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 @@ -8,29 +8,43 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The multi cloud resource's cloud name. */ +/** + * The multi cloud resource's cloud name. + */ public final class CloudName extends ExpandableStringEnum { - /** Static value Azure for CloudName. */ + /** + * Static value Azure for CloudName. + */ public static final CloudName AZURE = fromString("Azure"); - /** Static value AWS for CloudName. */ + /** + * Static value AWS for CloudName. + */ public static final CloudName AWS = fromString("AWS"); - /** Static value GCP for CloudName. */ + /** + * Static value GCP for CloudName. + */ public static final CloudName GCP = fromString("GCP"); - /** Static value Github for CloudName. */ + /** + * Static value Github for CloudName. + */ public static final CloudName GITHUB = fromString("Github"); - /** Static value AzureDevOps for CloudName. */ + /** + * Static value AzureDevOps for CloudName. + */ public static final CloudName AZURE_DEV_OPS = fromString("AzureDevOps"); - /** Static value GitLab for CloudName. */ + /** + * Static value GitLab for CloudName. + */ public static final CloudName GIT_LAB = fromString("GitLab"); /** * Creates a new instance of CloudName value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -39,7 +53,7 @@ public CloudName() { /** * Creates or finds a CloudName from its string representation. - * + * * @param name a name to look for. * @return the corresponding CloudName. */ @@ -50,7 +64,7 @@ public static CloudName fromString(String name) { /** * Gets known CloudName values. - * + * * @return known CloudName values. */ public static Collection values() { 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 index d1a7b48b8634d..c72e9254799af 100644 --- 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 @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** The security offering details. */ +/** + * The security offering details. + */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, @@ -34,8 +36,7 @@ @JsonSubTypes.Type(name = "DefenderForDevOpsGithub", value = DefenderForDevOpsGithubOffering.class), @JsonSubTypes.Type(name = "DefenderForDevOpsAzureDevOps", value = DefenderForDevOpsAzureDevOpsOffering.class), @JsonSubTypes.Type(name = "CspmMonitorGitLab", value = CspmMonitorGitLabOffering.class), - @JsonSubTypes.Type(name = "DefenderForDevOpsGitLab", value = DefenderForDevOpsGitLabOffering.class) -}) + @JsonSubTypes.Type(name = "DefenderForDevOpsGitLab", value = DefenderForDevOpsGitLabOffering.class) }) @Immutable public class CloudOffering { /* @@ -44,13 +45,15 @@ public class CloudOffering { @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; - /** Creates an instance of CloudOffering class. */ + /** + * Creates an instance of CloudOffering class. + */ public CloudOffering() { } /** * Get the description property: The offering description. - * + * * @return the description value. */ public String description() { @@ -59,7 +62,7 @@ public String description() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Code.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Code.java index 487d31012408d..03946dd3e0c9b 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Code.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Code.java @@ -8,17 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The operation status code. */ +/** + * The operation status code. + */ public final class Code extends ExpandableStringEnum { - /** Static value Succeeded for Code. */ + /** + * Static value Succeeded for Code. + */ public static final Code SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for Code. */ + /** + * Static value Failed for Code. + */ public static final Code FAILED = fromString("Failed"); /** * Creates a new instance of Code value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +33,7 @@ public Code() { /** * Creates or finds a Code from its string representation. - * + * * @param name a name to look for. * @return the corresponding Code. */ @@ -38,7 +44,7 @@ public static Code fromString(String name) { /** * Gets known Code values. - * + * * @return known Code values. */ public static Collection values() { 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 index 7d14f9285a725..01358544b4d42 100644 --- 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 @@ -8,32 +8,34 @@ import java.time.OffsetDateTime; import java.util.List; -/** An immutable client-side representation of Compliance. */ +/** + * 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 assessmentTimestampUtcDate property: The timestamp when the Compliance calculation was conducted. - * + * * @return the assessmentTimestampUtcDate value. */ OffsetDateTime assessmentTimestampUtcDate(); @@ -41,21 +43,21 @@ public interface Compliance { /** * 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/ComplianceList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceList.java index c325572625cc5..cdb5d3c4b33be 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceList.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceList.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of Compliance objects response. */ +/** + * List of Compliance objects response. + */ @Fluent public final class ComplianceList { /* @@ -24,13 +26,15 @@ public final class ComplianceList { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of ComplianceList class. */ + /** + * Creates an instance of ComplianceList class. + */ public ComplianceList() { } /** * Get the value property: List of Compliance objects. - * + * * @return the value value. */ public List value() { @@ -39,7 +43,7 @@ public List value() { /** * Set the value property: List of Compliance objects. - * + * * @param value the value value to set. * @return the ComplianceList object itself. */ @@ -50,7 +54,7 @@ public ComplianceList withValue(List value) { /** * Get the nextLink property: The URI to fetch the next page. - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +63,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index a762e476d2592..bfb4965af144f 100644 --- 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 @@ -6,39 +6,41 @@ import com.azure.resourcemanager.security.fluent.models.ComplianceResultInner; -/** An immutable client-side representation of ComplianceResult. */ +/** + * 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 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/ComplianceResultList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceResultList.java index 53df27fd84992..2e0a1a18bdecd 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceResultList.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceResultList.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of compliance results response. */ +/** + * List of compliance results response. + */ @Fluent public final class ComplianceResultList { /* @@ -25,13 +27,15 @@ public final class ComplianceResultList { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of ComplianceResultList class. */ + /** + * Creates an instance of ComplianceResultList class. + */ public ComplianceResultList() { } /** * Get the value property: List of compliance results. - * + * * @return the value value. */ public List value() { @@ -40,7 +44,7 @@ public List value() { /** * Set the value property: List of compliance results. - * + * * @param value the value value to set. * @return the ComplianceResultList object itself. */ @@ -51,7 +55,7 @@ public ComplianceResultList withValue(List value) { /** * Get the nextLink property: The URI to fetch the next page. - * + * * @return the nextLink value. */ public String nextLink() { @@ -60,14 +64,13 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model ComplianceResultList")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model ComplianceResultList")); } else { value().forEach(e -> e.validate()); } 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 index dfea3d0538114..5b32e6ad86328 100644 --- 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 @@ -8,13 +8,15 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of ComplianceResults. */ +/** + * Resource collection API of ComplianceResults. + */ public interface ComplianceResults { /** * Security compliance results in the subscription. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -24,9 +26,9 @@ public interface ComplianceResults { /** * Security compliance results in the subscription. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -37,7 +39,7 @@ public interface ComplianceResults { /** * Security Compliance Result. - * + * * @param resourceId The identifier of the resource. * @param complianceResultName name of the desired assessment compliance result. * @param context The context to associate with this operation. @@ -50,7 +52,7 @@ public interface ComplianceResults { /** * Security Compliance Result. - * + * * @param resourceId The identifier of the resource. * @param complianceResultName name of the desired assessment compliance result. * @throws IllegalArgumentException thrown if parameters fail the validation. 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 index 92424ee5d4b5e..8f4728c35f835 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** A segment of a compliance assessment. */ +/** + * A segment of a compliance assessment. + */ @Immutable public final class ComplianceSegment { /* @@ -22,13 +24,15 @@ public final class ComplianceSegment { @JsonProperty(value = "percentage", access = JsonProperty.Access.WRITE_ONLY) private Double percentage; - /** Creates an instance of ComplianceSegment class. */ + /** + * Creates an instance of ComplianceSegment class. + */ public 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() { @@ -37,7 +41,7 @@ public String segmentType() { /** * Get the percentage property: The size (%) of the segment. - * + * * @return the percentage value. */ public Double percentage() { @@ -46,7 +50,7 @@ public Double percentage() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 3aed2c4ad78b1..9bc6c3f347e12 100644 --- 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 @@ -8,13 +8,15 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Compliances. */ +/** + * Resource collection API of Compliances. + */ public interface Compliances { /** * The Compliance scores of the specific management group. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -24,9 +26,9 @@ public interface Compliances { /** * The Compliance scores of the specific management group. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -37,9 +39,9 @@ public interface Compliances { /** * Details of a specific Compliance. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @param complianceName name of the Compliance. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -51,9 +53,9 @@ public interface Compliances { /** * Details of a specific Compliance. - * + * * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). + * management group (/providers/Microsoft.Management/managementGroups/mgName). * @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. diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConfigurationStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConfigurationStatus.java index ca570c91256db..d5ef61efa78d1 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConfigurationStatus.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConfigurationStatus.java @@ -8,26 +8,38 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The configuration status of the machines group or machine or rule. */ +/** + * The configuration status of the machines group or machine or rule. + */ public final class ConfigurationStatus extends ExpandableStringEnum { - /** Static value Configured for ConfigurationStatus. */ + /** + * Static value Configured for ConfigurationStatus. + */ public static final ConfigurationStatus CONFIGURED = fromString("Configured"); - /** Static value NotConfigured for ConfigurationStatus. */ + /** + * Static value NotConfigured for ConfigurationStatus. + */ public static final ConfigurationStatus NOT_CONFIGURED = fromString("NotConfigured"); - /** Static value InProgress for ConfigurationStatus. */ + /** + * Static value InProgress for ConfigurationStatus. + */ public static final ConfigurationStatus IN_PROGRESS = fromString("InProgress"); - /** Static value Failed for ConfigurationStatus. */ + /** + * Static value Failed for ConfigurationStatus. + */ public static final ConfigurationStatus FAILED = fromString("Failed"); - /** Static value NoStatus for ConfigurationStatus. */ + /** + * Static value NoStatus for ConfigurationStatus. + */ public static final ConfigurationStatus NO_STATUS = fromString("NoStatus"); /** * Creates a new instance of ConfigurationStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -36,7 +48,7 @@ public ConfigurationStatus() { /** * Creates or finds a ConfigurationStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding ConfigurationStatus. */ @@ -47,7 +59,7 @@ public static ConfigurationStatus fromString(String name) { /** * Gets known ConfigurationStatus values. - * + * * @return known ConfigurationStatus values. */ public static Collection values() { 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 index 19acfd395a631..2c6fd74ee58e2 100644 --- 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 @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Describes the allowed inbound and outbound traffic of an Azure resource. */ +/** + * Describes the allowed inbound and outbound traffic of an Azure resource. + */ @Immutable public final class ConnectableResource { /* @@ -29,13 +31,15 @@ public final class ConnectableResource { @JsonProperty(value = "outboundConnectedResources", access = JsonProperty.Access.WRITE_ONLY) private List outboundConnectedResources; - /** Creates an instance of ConnectableResource class. */ + /** + * Creates an instance of ConnectableResource class. + */ public ConnectableResource() { } /** * Get the id property: The Azure resource id. - * + * * @return the id value. */ public String id() { @@ -45,7 +49,7 @@ public String 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() { @@ -55,7 +59,7 @@ public List 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() { @@ -64,7 +68,7 @@ public List outboundConnectedResources() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 222924164abd2..c2f50d81704c7 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** Describes properties of a connected resource. */ +/** + * Describes properties of a connected resource. + */ @Immutable public final class ConnectedResource { /* @@ -28,13 +30,15 @@ public final class ConnectedResource { @JsonProperty(value = "udpPorts", access = JsonProperty.Access.WRITE_ONLY) private String udpPorts; - /** Creates an instance of ConnectedResource class. */ + /** + * Creates an instance of ConnectedResource class. + */ public ConnectedResource() { } /** * Get the connectedResourceId property: The Azure resource id of the connected resource. - * + * * @return the connectedResourceId value. */ public String connectedResourceId() { @@ -43,7 +47,7 @@ public String connectedResourceId() { /** * Get the tcpPorts property: The allowed tcp ports. - * + * * @return the tcpPorts value. */ public String tcpPorts() { @@ -52,7 +56,7 @@ public String tcpPorts() { /** * Get the udpPorts property: The allowed udp ports. - * + * * @return the udpPorts value. */ public String udpPorts() { @@ -61,7 +65,7 @@ public String udpPorts() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 34a0ad3b5ccf9..22bb02e956c30 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Represents an OMS workspace to which the solution is connected. */ +/** + * Represents an OMS workspace to which the solution is connected. + */ @Fluent public final class ConnectedWorkspace { /* @@ -16,13 +18,15 @@ public final class ConnectedWorkspace { @JsonProperty(value = "id") private String id; - /** Creates an instance of ConnectedWorkspace class. */ + /** + * Creates an instance of ConnectedWorkspace class. + */ public ConnectedWorkspace() { } /** * Get the id property: Azure resource ID of the connected OMS workspace. - * + * * @return the id value. */ public String id() { @@ -31,7 +35,7 @@ public String id() { /** * Set the id property: Azure resource ID of the connected OMS workspace. - * + * * @param id the id value to set. * @return the ConnectedWorkspace object itself. */ @@ -42,7 +46,7 @@ public ConnectedWorkspace withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectionFromIpNotAllowed.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectionFromIpNotAllowed.java index 09db2166904f3..70e8dee8aea34 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectionFromIpNotAllowed.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectionFromIpNotAllowed.java @@ -9,23 +9,31 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; -/** Inbound connection from an ip that isn't allowed. Allow list consists of ipv4 or ipv6 range in CIDR notation. */ +/** + * Inbound connection from an ip that isn't allowed. Allow list consists of ipv4 or ipv6 range in CIDR notation. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") @JsonTypeName("ConnectionFromIpNotAllowed") @Fluent public final class ConnectionFromIpNotAllowed extends AllowlistCustomAlertRule { - /** Creates an instance of ConnectionFromIpNotAllowed class. */ + /** + * Creates an instance of ConnectionFromIpNotAllowed class. + */ public ConnectionFromIpNotAllowed() { } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ConnectionFromIpNotAllowed withAllowlistValues(List allowlistValues) { super.withAllowlistValues(allowlistValues); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ConnectionFromIpNotAllowed withIsEnabled(boolean isEnabled) { super.withIsEnabled(isEnabled); @@ -34,7 +42,7 @@ public ConnectionFromIpNotAllowed withIsEnabled(boolean isEnabled) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectionStrings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectionStrings.java deleted file mode 100644 index c5da6b30ddaf0..0000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectionStrings.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.ConnectionStringsInner; -import java.util.List; - -/** An immutable client-side representation of ConnectionStrings. */ -public interface ConnectionStrings { - /** - * Gets the value property: Connection strings. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.ConnectionStringsInner object. - * - * @return the inner object. - */ - ConnectionStringsInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectionToIpNotAllowed.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectionToIpNotAllowed.java index 59841c97d2d05..44efda923dae0 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectionToIpNotAllowed.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectionToIpNotAllowed.java @@ -9,23 +9,31 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; -/** Outbound connection to an ip that isn't allowed. Allow list consists of ipv4 or ipv6 range in CIDR notation. */ +/** + * Outbound connection to an ip that isn't allowed. Allow list consists of ipv4 or ipv6 range in CIDR notation. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") @JsonTypeName("ConnectionToIpNotAllowed") @Fluent public final class ConnectionToIpNotAllowed extends AllowlistCustomAlertRule { - /** Creates an instance of ConnectionToIpNotAllowed class. */ + /** + * Creates an instance of ConnectionToIpNotAllowed class. + */ public ConnectionToIpNotAllowed() { } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ConnectionToIpNotAllowed withAllowlistValues(List allowlistValues) { super.withAllowlistValues(allowlistValues); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ConnectionToIpNotAllowed withIsEnabled(boolean isEnabled) { super.withIsEnabled(isEnabled); @@ -34,7 +42,7 @@ public ConnectionToIpNotAllowed withIsEnabled(boolean isEnabled) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index f26f0c83f24b5..5277fab3b3035 100644 --- 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 @@ -8,17 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ConnectionType. */ +/** + * Defines values for ConnectionType. + */ public final class ConnectionType extends ExpandableStringEnum { - /** Static value Internal for ConnectionType. */ + /** + * Static value Internal for ConnectionType. + */ public static final ConnectionType INTERNAL = fromString("Internal"); - /** Static value External for ConnectionType. */ + /** + * Static value External for ConnectionType. + */ public static final ConnectionType EXTERNAL = fromString("External"); /** * Creates a new instance of ConnectionType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +33,7 @@ public ConnectionType() { /** * Creates or finds a ConnectionType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ConnectionType. */ @@ -38,7 +44,7 @@ public static ConnectionType fromString(String name) { /** * Gets known ConnectionType values. - * + * * @return known ConnectionType values. */ public static Collection values() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectorSetting.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectorSetting.java index 5a13750d1686c..0542d4b9ef658 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectorSetting.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectorSetting.java @@ -7,25 +7,27 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.security.fluent.models.ConnectorSettingInner; -/** An immutable client-side representation of ConnectorSetting. */ +/** + * An immutable client-side representation of ConnectorSetting. + */ public interface ConnectorSetting { /** * 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(); @@ -33,7 +35,7 @@ public interface ConnectorSetting { /** * Gets the hybridComputeSettings property: Settings for hybrid compute management. These settings are relevant only * for Arc autoProvision (Hybrid Compute). - * + * * @return the hybridComputeSettings value. */ HybridComputeSettingsProperties hybridComputeSettings(); @@ -41,26 +43,34 @@ public interface ConnectorSetting { /** * Gets the authenticationDetails property: Settings for authentication management, these settings are relevant only * for the cloud connector. - * + * * @return the authenticationDetails value. */ AuthenticationDetailsProperties authenticationDetails(); /** * Gets the inner com.azure.resourcemanager.security.fluent.models.ConnectorSettingInner object. - * + * * @return the inner object. */ ConnectorSettingInner innerModel(); - /** The entirety of the ConnectorSetting definition. */ + /** + * The entirety of the ConnectorSetting definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { } - /** The ConnectorSetting definition stages. */ + + /** + * The ConnectorSetting definition stages. + */ interface DefinitionStages { - /** The first stage of the ConnectorSetting definition. */ + /** + * The first stage of the ConnectorSetting definition. + */ interface Blank extends WithCreate { } + /** * The stage of the ConnectorSetting 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. @@ -69,105 +79,123 @@ interface WithCreate extends DefinitionStages.WithHybridComputeSettings, DefinitionStages.WithAuthenticationDetails { /** * Executes the create request. - * + * * @return the created resource. */ ConnectorSetting create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ ConnectorSetting create(Context context); } - /** The stage of the ConnectorSetting definition allowing to specify hybridComputeSettings. */ + + /** + * The stage of the ConnectorSetting definition allowing to specify hybridComputeSettings. + */ interface WithHybridComputeSettings { /** * Specifies the hybridComputeSettings property: Settings for hybrid compute management. These settings are * relevant only for Arc autoProvision (Hybrid Compute).. - * + * * @param hybridComputeSettings Settings for hybrid compute management. These settings are relevant only for - * Arc autoProvision (Hybrid Compute). + * Arc autoProvision (Hybrid Compute). * @return the next definition stage. */ WithCreate withHybridComputeSettings(HybridComputeSettingsProperties hybridComputeSettings); } - /** The stage of the ConnectorSetting definition allowing to specify authenticationDetails. */ + + /** + * The stage of the ConnectorSetting definition allowing to specify authenticationDetails. + */ interface WithAuthenticationDetails { /** * Specifies the authenticationDetails property: Settings for authentication management, these settings are * relevant only for the cloud connector.. - * + * * @param authenticationDetails Settings for authentication management, these settings are relevant only for - * the cloud connector. + * the cloud connector. * @return the next definition stage. */ WithCreate withAuthenticationDetails(AuthenticationDetailsProperties authenticationDetails); } } + /** * Begins update for the ConnectorSetting resource. - * + * * @return the stage of resource update. */ ConnectorSetting.Update update(); - /** The template for ConnectorSetting update. */ + /** + * The template for ConnectorSetting update. + */ interface Update extends UpdateStages.WithHybridComputeSettings, UpdateStages.WithAuthenticationDetails { /** * Executes the update request. - * + * * @return the updated resource. */ ConnectorSetting apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ ConnectorSetting apply(Context context); } - /** The ConnectorSetting update stages. */ + + /** + * The ConnectorSetting update stages. + */ interface UpdateStages { - /** The stage of the ConnectorSetting update allowing to specify hybridComputeSettings. */ + /** + * The stage of the ConnectorSetting update allowing to specify hybridComputeSettings. + */ interface WithHybridComputeSettings { /** * Specifies the hybridComputeSettings property: Settings for hybrid compute management. These settings are * relevant only for Arc autoProvision (Hybrid Compute).. - * + * * @param hybridComputeSettings Settings for hybrid compute management. These settings are relevant only for - * Arc autoProvision (Hybrid Compute). + * Arc autoProvision (Hybrid Compute). * @return the next definition stage. */ Update withHybridComputeSettings(HybridComputeSettingsProperties hybridComputeSettings); } - /** The stage of the ConnectorSetting update allowing to specify authenticationDetails. */ + + /** + * The stage of the ConnectorSetting update allowing to specify authenticationDetails. + */ interface WithAuthenticationDetails { /** * Specifies the authenticationDetails property: Settings for authentication management, these settings are * relevant only for the cloud connector.. - * + * * @param authenticationDetails Settings for authentication management, these settings are relevant only for - * the cloud connector. + * the cloud connector. * @return the next definition stage. */ Update withAuthenticationDetails(AuthenticationDetailsProperties authenticationDetails); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ ConnectorSetting refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectorSettingList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectorSettingList.java index f593b57393806..cb7207bf37d95 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectorSettingList.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectorSettingList.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** For a subscription, list of all cloud account connectors and their settings. */ +/** + * For a subscription, list of all cloud account connectors and their settings. + */ @Fluent public final class ConnectorSettingList { /* @@ -24,13 +26,15 @@ public final class ConnectorSettingList { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of ConnectorSettingList class. */ + /** + * Creates an instance of ConnectorSettingList class. + */ public ConnectorSettingList() { } /** * Get the value property: List of all the cloud account connector settings. - * + * * @return the value value. */ public List value() { @@ -39,7 +43,7 @@ public List value() { /** * Set the value property: List of all the cloud account connector settings. - * + * * @param value the value value to set. * @return the ConnectorSettingList object itself. */ @@ -50,7 +54,7 @@ public ConnectorSettingList withValue(List value) { /** * Get the nextLink property: The URI to fetch the next page. - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +63,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Connectors.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Connectors.java index 0fbe5c0e8ca4b..1d72270a40bd6 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Connectors.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Connectors.java @@ -8,33 +8,35 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Connectors. */ +/** + * Resource collection API of Connectors. + */ public interface Connectors { /** * Cloud accounts connectors 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 for a subscription, list of all cloud account connectors and their settings as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ PagedIterable list(); /** * Cloud accounts connectors 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 for a subscription, list of all cloud account connectors and their settings as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ PagedIterable list(Context context); /** * Details of a specific cloud account connector. - * + * * @param connectorName Name of the cloud account connector. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -46,7 +48,7 @@ public interface Connectors { /** * Details of a specific cloud account connector. - * + * * @param connectorName Name of the cloud account connector. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -57,7 +59,7 @@ public interface Connectors { /** * Delete a cloud account connector from a subscription. - * + * * @param connectorName Name of the cloud account connector. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -69,7 +71,7 @@ public interface Connectors { /** * Delete a cloud account connector from a subscription. - * + * * @param connectorName Name of the cloud account connector. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -79,7 +81,7 @@ public interface Connectors { /** * Details of a specific cloud account connector. - * + * * @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. @@ -90,7 +92,7 @@ public interface Connectors { /** * Details of a specific cloud account connector. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -102,7 +104,7 @@ public interface Connectors { /** * Delete a cloud account connector from a 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. @@ -112,7 +114,7 @@ public interface Connectors { /** * Delete a cloud account connector from a subscription. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -124,7 +126,7 @@ public interface Connectors { /** * Begins definition for a new ConnectorSetting resource. - * + * * @param name resource name. * @return the first stage of the new ConnectorSetting definition. */ 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 index 490b6e85e689a..bf2651b150956 100644 --- 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 @@ -13,7 +13,9 @@ import java.util.List; import java.util.Map; -/** Additional context fields for container registry Vulnerability assessment. */ +/** + * Additional context fields for container registry Vulnerability assessment. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "assessedResourceType") @JsonTypeName("ContainerRegistryVulnerability") @Immutable @@ -67,14 +69,16 @@ public final class ContainerRegistryVulnerabilityProperties extends AdditionalDa @JsonProperty(value = "imageDigest", access = JsonProperty.Access.WRITE_ONLY) private String imageDigest; - /** Creates an instance of ContainerRegistryVulnerabilityProperties class. */ + /** + * Creates an instance of ContainerRegistryVulnerabilityProperties class. + */ public ContainerRegistryVulnerabilityProperties() { } /** * Get the type property: Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered, * Vulnerability. - * + * * @return the type value. */ public String type() { @@ -83,7 +87,7 @@ public String type() { /** * Get the cvss property: Dictionary from cvss version to cvss details object. - * + * * @return the cvss value. */ public Map cvss() { @@ -92,7 +96,7 @@ public Map cvss() { /** * Get the patchable property: Indicates whether a patch is available or not. - * + * * @return the patchable value. */ public Boolean patchable() { @@ -101,7 +105,7 @@ public Boolean patchable() { /** * Get the cve property: List of CVEs. - * + * * @return the cve value. */ public List cve() { @@ -110,7 +114,7 @@ public List cve() { /** * Get the publishedTime property: Published time. - * + * * @return the publishedTime value. */ public OffsetDateTime publishedTime() { @@ -119,7 +123,7 @@ public OffsetDateTime publishedTime() { /** * Get the vendorReferences property: The vendorReferences property. - * + * * @return the vendorReferences value. */ public List vendorReferences() { @@ -128,7 +132,7 @@ public List vendorReferences() { /** * Get the repositoryName property: Name of the repository which the vulnerable image belongs to. - * + * * @return the repositoryName value. */ public String repositoryName() { @@ -137,7 +141,7 @@ public String repositoryName() { /** * Get the imageDigest property: Digest of the vulnerable image. - * + * * @return the imageDigest value. */ public String imageDigest() { @@ -146,21 +150,18 @@ public String imageDigest() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (cvss() != null) { - cvss() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); + cvss().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); } if (cve() != null) { cve().forEach(e -> e.validate()); 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 index b2502b132198f..db3d2ac06d2a5 100644 --- 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 @@ -8,17 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The type of security control (for example, BuiltIn). */ +/** + * The type of security control (for example, BuiltIn). + */ public final class ControlType extends ExpandableStringEnum { - /** Static value BuiltIn for ControlType. */ + /** + * Static value BuiltIn for ControlType. + */ public static final ControlType BUILT_IN = fromString("BuiltIn"); - /** Static value Custom for ControlType. */ + /** + * Static value Custom for ControlType. + */ public static final ControlType CUSTOM = fromString("Custom"); /** * Creates a new instance of ControlType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +33,7 @@ public ControlType() { /** * Creates or finds a ControlType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ControlType. */ @@ -38,7 +44,7 @@ public static ControlType fromString(String name) { /** * Gets known ControlType values. - * + * * @return known ControlType values. */ public static Collection values() { 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 index 3ead5e6e1dca6..bcb1d32469a18 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** The CSPM monitoring for AWS offering. */ +/** + * The CSPM monitoring for AWS offering. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") @JsonTypeName("CspmMonitorAws") @Fluent @@ -20,13 +22,15 @@ public final class CspmMonitorAwsOffering extends CloudOffering { @JsonProperty(value = "nativeCloudConnection") private CspmMonitorAwsOfferingNativeCloudConnection nativeCloudConnection; - /** Creates an instance of CspmMonitorAwsOffering class. */ + /** + * Creates an instance of CspmMonitorAwsOffering class. + */ public CspmMonitorAwsOffering() { } /** * Get the nativeCloudConnection property: The native cloud connection configuration. - * + * * @return the nativeCloudConnection value. */ public CspmMonitorAwsOfferingNativeCloudConnection nativeCloudConnection() { @@ -35,19 +39,19 @@ public CspmMonitorAwsOfferingNativeCloudConnection 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) { + public CspmMonitorAwsOffering + withNativeCloudConnection(CspmMonitorAwsOfferingNativeCloudConnection nativeCloudConnection) { this.nativeCloudConnection = nativeCloudConnection; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 0c58266fdcb86..53368e794c002 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The native cloud connection configuration. */ +/** + * The native cloud connection configuration. + */ @Fluent public final class CspmMonitorAwsOfferingNativeCloudConnection { /* @@ -16,13 +18,15 @@ public final class CspmMonitorAwsOfferingNativeCloudConnection { @JsonProperty(value = "cloudRoleArn") private String cloudRoleArn; - /** Creates an instance of CspmMonitorAwsOfferingNativeCloudConnection class. */ + /** + * 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() { @@ -31,7 +35,7 @@ public String 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. */ @@ -42,7 +46,7 @@ public CspmMonitorAwsOfferingNativeCloudConnection withCloudRoleArn(String cloud /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 37effcc24def8..97dc15f77abe9 100644 --- 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 @@ -8,18 +8,22 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** The CSPM monitoring for AzureDevOps offering. */ +/** + * The CSPM monitoring for AzureDevOps offering. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") @JsonTypeName("CspmMonitorAzureDevOps") @Immutable public final class CspmMonitorAzureDevOpsOffering extends CloudOffering { - /** Creates an instance of CspmMonitorAzureDevOpsOffering class. */ + /** + * Creates an instance of CspmMonitorAzureDevOpsOffering class. + */ public CspmMonitorAzureDevOpsOffering() { } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 48f5c5f63a00b..eda75d55d126b 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** The CSPM monitoring for GCP offering. */ +/** + * The CSPM monitoring for GCP offering. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") @JsonTypeName("CspmMonitorGcp") @Fluent @@ -20,13 +22,15 @@ public final class CspmMonitorGcpOffering extends CloudOffering { @JsonProperty(value = "nativeCloudConnection") private CspmMonitorGcpOfferingNativeCloudConnection nativeCloudConnection; - /** Creates an instance of CspmMonitorGcpOffering class. */ + /** + * Creates an instance of CspmMonitorGcpOffering class. + */ public CspmMonitorGcpOffering() { } /** * Get the nativeCloudConnection property: The native cloud connection configuration. - * + * * @return the nativeCloudConnection value. */ public CspmMonitorGcpOfferingNativeCloudConnection nativeCloudConnection() { @@ -35,19 +39,19 @@ public CspmMonitorGcpOfferingNativeCloudConnection 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) { + public CspmMonitorGcpOffering + withNativeCloudConnection(CspmMonitorGcpOfferingNativeCloudConnection nativeCloudConnection) { this.nativeCloudConnection = nativeCloudConnection; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 3b653d78726c7..7b461f5889502 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The native cloud connection configuration. */ +/** + * The native cloud connection configuration. + */ @Fluent public final class CspmMonitorGcpOfferingNativeCloudConnection { /* @@ -22,13 +24,15 @@ public final class CspmMonitorGcpOfferingNativeCloudConnection { @JsonProperty(value = "serviceAccountEmailAddress") private String serviceAccountEmailAddress; - /** Creates an instance of CspmMonitorGcpOfferingNativeCloudConnection class. */ + /** + * 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() { @@ -37,19 +41,19 @@ public String 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) { + 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() { @@ -58,19 +62,19 @@ public String 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) { + 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() { 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 index c4968ba49cf13..be0f785b499eb 100644 --- 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 @@ -8,18 +8,22 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** The CSPM (Cloud security posture management) monitoring for gitlab offering. */ +/** + * The CSPM (Cloud security posture management) monitoring for gitlab offering. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") @JsonTypeName("CspmMonitorGitLab") @Immutable public final class CspmMonitorGitLabOffering extends CloudOffering { - /** Creates an instance of CspmMonitorGitLabOffering class. */ + /** + * Creates an instance of CspmMonitorGitLabOffering class. + */ public CspmMonitorGitLabOffering() { } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 1039d0c712fdc..5612245c734ee 100644 --- 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 @@ -8,18 +8,22 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** The CSPM monitoring for github offering. */ +/** + * The CSPM monitoring for github offering. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") @JsonTypeName("CspmMonitorGithub") @Immutable public final class CspmMonitorGithubOffering extends CloudOffering { - /** Creates an instance of CspmMonitorGithubOffering class. */ + /** + * Creates an instance of CspmMonitorGithubOffering class. + */ public CspmMonitorGithubOffering() { } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 6b17e8b182ee6..e65668c0394d7 100644 --- 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 @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** A custom alert rule. */ +/** + * A custom alert rule. + */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, @@ -19,8 +21,7 @@ @JsonTypeName("CustomAlertRule") @JsonSubTypes({ @JsonSubTypes.Type(name = "ThresholdCustomAlertRule", value = ThresholdCustomAlertRule.class), - @JsonSubTypes.Type(name = "ListCustomAlertRule", value = ListCustomAlertRule.class) -}) + @JsonSubTypes.Type(name = "ListCustomAlertRule", value = ListCustomAlertRule.class) }) @Fluent public class CustomAlertRule { /* @@ -41,13 +42,15 @@ public class CustomAlertRule { @JsonProperty(value = "isEnabled", required = true) private boolean isEnabled; - /** Creates an instance of CustomAlertRule class. */ + /** + * Creates an instance of CustomAlertRule class. + */ public CustomAlertRule() { } /** * Get the displayName property: The display name of the custom alert. - * + * * @return the displayName value. */ public String displayName() { @@ -56,7 +59,7 @@ public String displayName() { /** * Get the description property: The description of the custom alert. - * + * * @return the description value. */ public String description() { @@ -65,7 +68,7 @@ public String description() { /** * Get the isEnabled property: Status of the custom alert. - * + * * @return the isEnabled value. */ public boolean isEnabled() { @@ -74,7 +77,7 @@ public boolean isEnabled() { /** * Set the isEnabled property: Status of the custom alert. - * + * * @param isEnabled the isEnabled value to set. * @return the CustomAlertRule object itself. */ @@ -85,7 +88,7 @@ public CustomAlertRule withIsEnabled(boolean isEnabled) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomation.java index 59ff105ba2b42..31e7cbdf895b2 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomation.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomation.java @@ -8,32 +8,34 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.security.fluent.models.CustomAssessmentAutomationInner; -/** An immutable client-side representation of CustomAssessmentAutomation. */ +/** + * An immutable client-side representation of CustomAssessmentAutomation. + */ public interface CustomAssessmentAutomation { /** * 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(); @@ -41,28 +43,28 @@ public interface CustomAssessmentAutomation { /** * Gets the compressedQuery property: GZip encoded KQL query representing the assessment automation results * required. - * + * * @return the compressedQuery value. */ String compressedQuery(); /** * Gets the supportedCloud property: Relevant cloud for the custom assessment automation. - * + * * @return the supportedCloud value. */ SupportedCloudEnum supportedCloud(); /** * Gets the severity property: The severity to relate to the assessments generated by this assessment automation. - * + * * @return the severity value. */ SeverityEnum severity(); /** * Gets the displayName property: The display name of the assessments generated by this assessment automation. - * + * * @return the displayName value. */ String displayName(); @@ -70,7 +72,7 @@ public interface CustomAssessmentAutomation { /** * Gets the description property: The description to relate to the assessments generated by this assessment * automation. - * + * * @return the description value. */ String description(); @@ -78,7 +80,7 @@ public interface CustomAssessmentAutomation { /** * Gets the remediationDescription property: The remediation description to relate to the assessments generated by * this assessment automation. - * + * * @return the remediationDescription value. */ String remediationDescription(); @@ -86,141 +88,167 @@ public interface CustomAssessmentAutomation { /** * Gets the assessmentKey property: The assessment metadata key used when an assessment is generated for this * assessment automation. - * + * * @return the assessmentKey value. */ String assessmentKey(); /** * Gets the inner com.azure.resourcemanager.security.fluent.models.CustomAssessmentAutomationInner object. - * + * * @return the inner object. */ CustomAssessmentAutomationInner innerModel(); - /** The entirety of the CustomAssessmentAutomation definition. */ + /** + * The entirety of the CustomAssessmentAutomation definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } - /** The CustomAssessmentAutomation definition stages. */ + + /** + * The CustomAssessmentAutomation definition stages. + */ interface DefinitionStages { - /** The first stage of the CustomAssessmentAutomation definition. */ + /** + * The first stage of the CustomAssessmentAutomation definition. + */ interface Blank extends WithResourceGroup { } - /** The stage of the CustomAssessmentAutomation definition allowing to specify parent resource. */ + + /** + * The stage of the CustomAssessmentAutomation definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @return the next definition stage. */ WithCreate withExistingResourceGroup(String resourceGroupName); } + /** * The stage of the CustomAssessmentAutomation 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.WithCompressedQuery, - DefinitionStages.WithSupportedCloud, - DefinitionStages.WithSeverity, - DefinitionStages.WithDisplayName, - DefinitionStages.WithDescription, - DefinitionStages.WithRemediationDescription { + interface WithCreate extends DefinitionStages.WithCompressedQuery, DefinitionStages.WithSupportedCloud, + DefinitionStages.WithSeverity, DefinitionStages.WithDisplayName, DefinitionStages.WithDescription, + DefinitionStages.WithRemediationDescription { /** * Executes the create request. - * + * * @return the created resource. */ CustomAssessmentAutomation create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ CustomAssessmentAutomation create(Context context); } - /** The stage of the CustomAssessmentAutomation definition allowing to specify compressedQuery. */ + + /** + * The stage of the CustomAssessmentAutomation definition allowing to specify compressedQuery. + */ interface WithCompressedQuery { /** * Specifies the compressedQuery property: Base 64 encoded KQL query representing the assessment automation * results required.. - * + * * @param compressedQuery Base 64 encoded KQL query representing the assessment automation results required. * @return the next definition stage. */ WithCreate withCompressedQuery(String compressedQuery); } - /** The stage of the CustomAssessmentAutomation definition allowing to specify supportedCloud. */ + + /** + * The stage of the CustomAssessmentAutomation definition allowing to specify supportedCloud. + */ interface WithSupportedCloud { /** * Specifies the supportedCloud property: Relevant cloud for the custom assessment automation.. - * + * * @param supportedCloud Relevant cloud for the custom assessment automation. * @return the next definition stage. */ WithCreate withSupportedCloud(SupportedCloudEnum supportedCloud); } - /** The stage of the CustomAssessmentAutomation definition allowing to specify severity. */ + + /** + * The stage of the CustomAssessmentAutomation definition allowing to specify severity. + */ interface WithSeverity { /** * Specifies the severity property: The severity to relate to the assessments generated by this assessment * automation.. - * + * * @param severity The severity to relate to the assessments generated by this assessment automation. * @return the next definition stage. */ WithCreate withSeverity(SeverityEnum severity); } - /** The stage of the CustomAssessmentAutomation definition allowing to specify displayName. */ + + /** + * The stage of the CustomAssessmentAutomation definition allowing to specify displayName. + */ interface WithDisplayName { /** * Specifies the displayName property: The display name of the assessments generated by this assessment * automation.. - * + * * @param displayName The display name of the assessments generated by this assessment automation. * @return the next definition stage. */ WithCreate withDisplayName(String displayName); } - /** The stage of the CustomAssessmentAutomation definition allowing to specify description. */ + + /** + * The stage of the CustomAssessmentAutomation definition allowing to specify description. + */ interface WithDescription { /** * Specifies the description property: The description to relate to the assessments generated by this * assessment automation.. - * + * * @param description The description to relate to the assessments generated by this assessment automation. * @return the next definition stage. */ WithCreate withDescription(String description); } - /** The stage of the CustomAssessmentAutomation definition allowing to specify remediationDescription. */ + + /** + * The stage of the CustomAssessmentAutomation definition allowing to specify remediationDescription. + */ interface WithRemediationDescription { /** * Specifies the remediationDescription property: The remediation description to relate to the assessments * generated by this assessment automation.. - * + * * @param remediationDescription The remediation description to relate to the assessments generated by this - * assessment automation. + * assessment automation. * @return the next definition stage. */ WithCreate withRemediationDescription(String remediationDescription); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ CustomAssessmentAutomation refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomationRequest.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomationRequest.java index 0c48f14f9c28b..a8eac3b820950 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomationRequest.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomationRequest.java @@ -9,7 +9,9 @@ import com.azure.resourcemanager.security.fluent.models.CustomAssessmentAutomationRequestProperties; import com.fasterxml.jackson.annotation.JsonProperty; -/** Custom Assessment Automation request. */ +/** + * Custom Assessment Automation request. + */ @Fluent public final class CustomAssessmentAutomationRequest extends ProxyResource { /* @@ -18,13 +20,15 @@ public final class CustomAssessmentAutomationRequest extends ProxyResource { @JsonProperty(value = "properties") private CustomAssessmentAutomationRequestProperties innerProperties; - /** Creates an instance of CustomAssessmentAutomationRequest class. */ + /** + * Creates an instance of CustomAssessmentAutomationRequest class. + */ public CustomAssessmentAutomationRequest() { } /** * Get the innerProperties property: describes Custom Assessment Automation request properties. - * + * * @return the innerProperties value. */ private CustomAssessmentAutomationRequestProperties innerProperties() { @@ -34,7 +38,7 @@ private CustomAssessmentAutomationRequestProperties innerProperties() { /** * Get the compressedQuery property: Base 64 encoded KQL query representing the assessment automation results * required. - * + * * @return the compressedQuery value. */ public String compressedQuery() { @@ -44,7 +48,7 @@ public String compressedQuery() { /** * Set the compressedQuery property: Base 64 encoded KQL query representing the assessment automation results * required. - * + * * @param compressedQuery the compressedQuery value to set. * @return the CustomAssessmentAutomationRequest object itself. */ @@ -58,7 +62,7 @@ public CustomAssessmentAutomationRequest withCompressedQuery(String compressedQu /** * Get the supportedCloud property: Relevant cloud for the custom assessment automation. - * + * * @return the supportedCloud value. */ public SupportedCloudEnum supportedCloud() { @@ -67,7 +71,7 @@ public SupportedCloudEnum supportedCloud() { /** * Set the supportedCloud property: Relevant cloud for the custom assessment automation. - * + * * @param supportedCloud the supportedCloud value to set. * @return the CustomAssessmentAutomationRequest object itself. */ @@ -81,7 +85,7 @@ public CustomAssessmentAutomationRequest withSupportedCloud(SupportedCloudEnum s /** * Get the severity property: The severity to relate to the assessments generated by this assessment automation. - * + * * @return the severity value. */ public SeverityEnum severity() { @@ -90,7 +94,7 @@ public SeverityEnum severity() { /** * Set the severity property: The severity to relate to the assessments generated by this assessment automation. - * + * * @param severity the severity value to set. * @return the CustomAssessmentAutomationRequest object itself. */ @@ -104,7 +108,7 @@ public CustomAssessmentAutomationRequest withSeverity(SeverityEnum severity) { /** * Get the displayName property: The display name of the assessments generated by this assessment automation. - * + * * @return the displayName value. */ public String displayName() { @@ -113,7 +117,7 @@ public String displayName() { /** * Set the displayName property: The display name of the assessments generated by this assessment automation. - * + * * @param displayName the displayName value to set. * @return the CustomAssessmentAutomationRequest object itself. */ @@ -128,7 +132,7 @@ public CustomAssessmentAutomationRequest withDisplayName(String displayName) { /** * Get the description property: The description to relate to the assessments generated by this assessment * automation. - * + * * @return the description value. */ public String description() { @@ -138,7 +142,7 @@ public String description() { /** * Set the description property: The description to relate to the assessments generated by this assessment * automation. - * + * * @param description the description value to set. * @return the CustomAssessmentAutomationRequest object itself. */ @@ -153,7 +157,7 @@ public CustomAssessmentAutomationRequest withDescription(String description) { /** * Get the remediationDescription property: The remediation description to relate to the assessments generated by * this assessment automation. - * + * * @return the remediationDescription value. */ public String remediationDescription() { @@ -163,7 +167,7 @@ public String remediationDescription() { /** * Set the remediationDescription property: The remediation description to relate to the assessments generated by * this assessment automation. - * + * * @param remediationDescription the remediationDescription value to set. * @return the CustomAssessmentAutomationRequest object itself. */ @@ -177,7 +181,7 @@ public CustomAssessmentAutomationRequest withRemediationDescription(String remed /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomations.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomations.java index 5a3c288c946fd..664d26aeac330 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomations.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomations.java @@ -8,33 +8,35 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of CustomAssessmentAutomations. */ +/** + * Resource collection API of CustomAssessmentAutomations. + */ public interface CustomAssessmentAutomations { /** * Gets a custom assessment automation - * - *

Gets a single custom assessment automation by name for the provided subscription and resource group. - * + * + * Gets a single custom assessment automation by name for the provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customAssessmentAutomationName Name of the Custom Assessment Automation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a single custom assessment automation by name for the provided subscription and resource group along with - * {@link Response}. + * {@link Response}. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String customAssessmentAutomationName, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, + String customAssessmentAutomationName, Context context); /** * Gets a custom assessment automation - * - *

Gets a single custom assessment automation by name for the provided subscription and resource group. - * + * + * Gets a single custom assessment automation by name for the provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customAssessmentAutomationName Name of the Custom Assessment Automation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -45,11 +47,11 @@ Response getByResourceGroupWithResponse( /** * Deletes a custom assessment automation - * - *

Deletes a custom assessment automation by name for a provided subscription. - * + * + * Deletes a custom assessment automation by name for a provided subscription. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customAssessmentAutomationName Name of the Custom Assessment Automation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -57,16 +59,16 @@ Response getByResourceGroupWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response deleteByResourceGroupWithResponse( - String resourceGroupName, String customAssessmentAutomationName, Context context); + Response deleteByResourceGroupWithResponse(String resourceGroupName, String customAssessmentAutomationName, + Context context); /** * Deletes a custom assessment automation - * - *

Deletes a custom assessment automation by name for a provided subscription. - * + * + * Deletes a custom assessment automation by name for a provided subscription. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customAssessmentAutomationName Name of the Custom Assessment Automation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -76,11 +78,11 @@ Response deleteByResourceGroupWithResponse( /** * List custom assessment automations in a subscription and a resource group - * - *

List custom assessment automations by provided subscription and resource group. - * + * + * List custom assessment automations by provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -90,11 +92,11 @@ Response deleteByResourceGroupWithResponse( /** * List custom assessment automations in a subscription and a resource group - * - *

List custom assessment automations by provided subscription and resource group. - * + * + * List custom assessment automations by provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -105,9 +107,9 @@ Response deleteByResourceGroupWithResponse( /** * List custom assessment automations in a subscription - * - *

List custom assessment automations by provided subscription. - * + * + * List custom assessment automations by provided 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 Custom Assessment Automations as paginated response with {@link PagedIterable}. @@ -116,9 +118,9 @@ Response deleteByResourceGroupWithResponse( /** * List custom assessment automations in a subscription - * - *

List custom assessment automations by provided subscription. - * + * + * List custom assessment automations by provided 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. @@ -129,38 +131,38 @@ Response deleteByResourceGroupWithResponse( /** * Gets a custom assessment automation - * - *

Gets a single custom assessment automation by name for the provided subscription and resource group. - * + * + * Gets a single custom assessment automation by name for the provided subscription and 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. * @return a single custom assessment automation by name for the provided subscription and resource group along with - * {@link Response}. + * {@link Response}. */ CustomAssessmentAutomation getById(String id); /** * Gets a custom assessment automation - * - *

Gets a single custom assessment automation by name for the provided subscription and resource group. - * + * + * Gets a single custom assessment automation by name for the provided subscription and 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. * @return a single custom assessment automation by name for the provided subscription and resource group along with - * {@link Response}. + * {@link Response}. */ Response getByIdWithResponse(String id, Context context); /** * Deletes a custom assessment automation - * - *

Deletes a custom assessment automation by name for a provided subscription. - * + * + * Deletes a custom assessment automation by name for a provided 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. @@ -170,9 +172,9 @@ Response deleteByResourceGroupWithResponse( /** * Deletes a custom assessment automation - * - *

Deletes a custom assessment automation by name for a provided subscription. - * + * + * Deletes a custom assessment automation by name for a provided subscription. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -184,7 +186,7 @@ Response deleteByResourceGroupWithResponse( /** * Begins definition for a new CustomAssessmentAutomation resource. - * + * * @param name resource name. * @return the first stage of the new CustomAssessmentAutomation definition. */ diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomationsListResult.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomationsListResult.java index 12e9233976c19..f2817eb84c43e 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomationsListResult.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomationsListResult.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** A list of Custom Assessment Automations. */ +/** + * A list of Custom Assessment Automations. + */ @Fluent public final class CustomAssessmentAutomationsListResult { /* @@ -24,13 +26,15 @@ public final class CustomAssessmentAutomationsListResult { @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of CustomAssessmentAutomationsListResult class. */ + /** + * Creates an instance of CustomAssessmentAutomationsListResult class. + */ public CustomAssessmentAutomationsListResult() { } /** * Get the value property: Collection of Custom Assessment Automations. - * + * * @return the value value. */ public List value() { @@ -39,7 +43,7 @@ public List value() { /** * Get the nextLink property: The link used to get the next page of operations. - * + * * @return the nextLink value. */ public String nextLink() { @@ -48,7 +52,7 @@ public String nextLink() { /** * Set the nextLink property: The link used to get the next page of operations. - * + * * @param nextLink the nextLink value to set. * @return the CustomAssessmentAutomationsListResult object itself. */ @@ -59,7 +63,7 @@ public CustomAssessmentAutomationsListResult withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignment.java index fcdf9e4547fec..0ddee9631222c 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignment.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignment.java @@ -8,32 +8,34 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentInner; -/** An immutable client-side representation of CustomEntityStoreAssignment. */ +/** + * An immutable client-side representation of CustomEntityStoreAssignment. + */ public interface CustomEntityStoreAssignment { /** * 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(); @@ -41,45 +43,56 @@ public interface CustomEntityStoreAssignment { /** * Gets the principal property: The principal assigned with entity store. Format of principal is: [AAD * type]=[PrincipalObjectId];[TenantId]. - * + * * @return the principal value. */ String principal(); /** * Gets the entityStoreDatabaseLink property: The link to entity store database. - * + * * @return the entityStoreDatabaseLink value. */ String entityStoreDatabaseLink(); /** * Gets the inner com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentInner object. - * + * * @return the inner object. */ CustomEntityStoreAssignmentInner innerModel(); - /** The entirety of the CustomEntityStoreAssignment definition. */ + /** + * The entirety of the CustomEntityStoreAssignment definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } - /** The CustomEntityStoreAssignment definition stages. */ + + /** + * The CustomEntityStoreAssignment definition stages. + */ interface DefinitionStages { - /** The first stage of the CustomEntityStoreAssignment definition. */ + /** + * The first stage of the CustomEntityStoreAssignment definition. + */ interface Blank extends WithResourceGroup { } - /** The stage of the CustomEntityStoreAssignment definition allowing to specify parent resource. */ + + /** + * The stage of the CustomEntityStoreAssignment definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @return the next definition stage. */ WithCreate withExistingResourceGroup(String resourceGroupName); } + /** * The stage of the CustomEntityStoreAssignment 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. @@ -87,42 +100,46 @@ interface WithResourceGroup { interface WithCreate extends DefinitionStages.WithPrincipal { /** * Executes the create request. - * + * * @return the created resource. */ CustomEntityStoreAssignment create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ CustomEntityStoreAssignment create(Context context); } - /** The stage of the CustomEntityStoreAssignment definition allowing to specify principal. */ + + /** + * The stage of the CustomEntityStoreAssignment definition allowing to specify principal. + */ interface WithPrincipal { /** * Specifies the principal property: The principal assigned with entity store. If not provided, will use * caller principal. Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]. - * + * * @param principal The principal assigned with entity store. If not provided, will use caller principal. - * Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]. + * Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]. * @return the next definition stage. */ WithCreate withPrincipal(String principal); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ CustomEntityStoreAssignment refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignmentRequest.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignmentRequest.java index 915238a0ec4a3..29b7242af9899 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignmentRequest.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignmentRequest.java @@ -8,7 +8,9 @@ import com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentRequestProperties; import com.fasterxml.jackson.annotation.JsonProperty; -/** describes the custom entity store assignment request. */ +/** + * describes the custom entity store assignment request. + */ @Fluent public final class CustomEntityStoreAssignmentRequest { /* @@ -17,13 +19,15 @@ public final class CustomEntityStoreAssignmentRequest { @JsonProperty(value = "properties") private CustomEntityStoreAssignmentRequestProperties innerProperties; - /** Creates an instance of CustomEntityStoreAssignmentRequest class. */ + /** + * Creates an instance of CustomEntityStoreAssignmentRequest class. + */ public CustomEntityStoreAssignmentRequest() { } /** * Get the innerProperties property: describes properties of custom entity store assignment request. - * + * * @return the innerProperties value. */ private CustomEntityStoreAssignmentRequestProperties innerProperties() { @@ -31,9 +35,9 @@ private CustomEntityStoreAssignmentRequestProperties innerProperties() { } /** - * Get the principal property: The principal assigned with entity store. If not provided, will use caller principal. - * Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]. - * + * Get the principal property: The principal assigned with entity store. If not provided, will use caller + * principal. Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]. + * * @return the principal value. */ public String principal() { @@ -41,9 +45,9 @@ public String principal() { } /** - * Set the principal property: The principal assigned with entity store. If not provided, will use caller principal. - * Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]. - * + * Set the principal property: The principal assigned with entity store. If not provided, will use caller + * principal. Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]. + * * @param principal the principal value to set. * @return the CustomEntityStoreAssignmentRequest object itself. */ @@ -57,7 +61,7 @@ public CustomEntityStoreAssignmentRequest withPrincipal(String principal) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignments.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignments.java index 6267ac669e8e0..5293562f0ddad 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignments.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignments.java @@ -8,33 +8,35 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of CustomEntityStoreAssignments. */ +/** + * Resource collection API of CustomEntityStoreAssignments. + */ public interface CustomEntityStoreAssignments { /** * Gets a custom entity store assignment - * - *

Gets a single custom entity store assignment by name for the provided subscription and resource group. - * + * + * Gets a single custom entity store assignment by name for the provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is 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 single custom entity store assignment by name for the provided subscription and resource group along - * with {@link Response}. + * with {@link Response}. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String customEntityStoreAssignmentName, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, + String customEntityStoreAssignmentName, Context context); /** * Gets a custom entity store assignment - * - *

Gets a single custom entity store assignment by name for the provided subscription and resource group. - * + * + * Gets a single custom entity store assignment by name for the provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -45,11 +47,11 @@ Response getByResourceGroupWithResponse( /** * Deleted a custom entity store assignment - * - *

Delete a custom entity store assignment by name for a provided subscription. - * + * + * Delete a custom entity store assignment by name for a provided subscription. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -57,16 +59,16 @@ Response getByResourceGroupWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ - Response deleteByResourceGroupWithResponse( - String resourceGroupName, String customEntityStoreAssignmentName, Context context); + Response deleteByResourceGroupWithResponse(String resourceGroupName, String customEntityStoreAssignmentName, + Context context); /** * Deleted a custom entity store assignment - * - *

Delete a custom entity store assignment by name for a provided subscription. - * + * + * Delete a custom entity store assignment by name for a provided subscription. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -76,11 +78,11 @@ Response deleteByResourceGroupWithResponse( /** * List custom entity store assignments in a subscription and a resource group - * - *

List custom entity store assignments by a provided subscription and resource group. - * + * + * List custom entity store assignments by a provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -90,11 +92,11 @@ Response deleteByResourceGroupWithResponse( /** * List custom entity store assignments in a subscription and a resource group - * - *

List custom entity store assignments by a provided subscription and resource group. - * + * + * List custom entity store assignments by a provided subscription and resource group. + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * 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. @@ -105,9 +107,9 @@ Response deleteByResourceGroupWithResponse( /** * List custom entity store assignments in a subscription - * - *

List custom entity store assignments by provided subscription. - * + * + * List custom entity store assignments by provided 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 custom entity store assignments as paginated response with {@link PagedIterable}. @@ -116,9 +118,9 @@ Response deleteByResourceGroupWithResponse( /** * List custom entity store assignments in a subscription - * - *

List custom entity store assignments by provided subscription. - * + * + * List custom entity store assignments by provided 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. @@ -129,38 +131,38 @@ Response deleteByResourceGroupWithResponse( /** * Gets a custom entity store assignment - * - *

Gets a single custom entity store assignment by name for the provided subscription and resource group. - * + * + * Gets a single custom entity store assignment by name for the provided subscription and 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. * @return a single custom entity store assignment by name for the provided subscription and resource group along - * with {@link Response}. + * with {@link Response}. */ CustomEntityStoreAssignment getById(String id); /** * Gets a custom entity store assignment - * - *

Gets a single custom entity store assignment by name for the provided subscription and resource group. - * + * + * Gets a single custom entity store assignment by name for the provided subscription and 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. * @return a single custom entity store assignment by name for the provided subscription and resource group along - * with {@link Response}. + * with {@link Response}. */ Response getByIdWithResponse(String id, Context context); /** * Deleted a custom entity store assignment - * - *

Delete a custom entity store assignment by name for a provided subscription. - * + * + * Delete a custom entity store assignment by name for a provided 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. @@ -170,9 +172,9 @@ Response deleteByResourceGroupWithResponse( /** * Deleted a custom entity store assignment - * - *

Delete a custom entity store assignment by name for a provided subscription. - * + * + * Delete a custom entity store assignment by name for a provided subscription. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -184,7 +186,7 @@ Response deleteByResourceGroupWithResponse( /** * Begins definition for a new CustomEntityStoreAssignment resource. - * + * * @param name resource name. * @return the first stage of the new CustomEntityStoreAssignment definition. */ diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignmentsListResult.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignmentsListResult.java index 72fd9d924f5f2..6f78441d7b681 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignmentsListResult.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignmentsListResult.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** A list of custom entity store assignments. */ +/** + * A list of custom entity store assignments. + */ @Fluent public final class CustomEntityStoreAssignmentsListResult { /* @@ -24,13 +26,15 @@ public final class CustomEntityStoreAssignmentsListResult { @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of CustomEntityStoreAssignmentsListResult class. */ + /** + * Creates an instance of CustomEntityStoreAssignmentsListResult class. + */ public CustomEntityStoreAssignmentsListResult() { } /** * Get the value property: Collection of custom entity store assignments. - * + * * @return the value value. */ public List value() { @@ -39,7 +43,7 @@ public List value() { /** * Get the nextLink property: The link used to get the next page of operations. - * + * * @return the nextLink value. */ public String nextLink() { @@ -48,7 +52,7 @@ public String nextLink() { /** * Set the nextLink property: The link used to get the next page of operations. - * + * * @param nextLink the nextLink value to set. * @return the CustomEntityStoreAssignmentsListResult object itself. */ @@ -59,7 +63,7 @@ public CustomEntityStoreAssignmentsListResult withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index d7ce9a9681b1f..b3b119b353b81 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** CVE details. */ +/** + * CVE details. + */ @Immutable public final class Cve { /* @@ -22,13 +24,15 @@ public final class Cve { @JsonProperty(value = "link", access = JsonProperty.Access.WRITE_ONLY) private String link; - /** Creates an instance of Cve class. */ + /** + * Creates an instance of Cve class. + */ public Cve() { } /** * Get the title property: CVE title. - * + * * @return the title value. */ public String title() { @@ -37,7 +41,7 @@ public String title() { /** * Get the link property: Link url. - * + * * @return the link value. */ public String link() { @@ -46,7 +50,7 @@ public String link() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 2e1f3a22d5347..585b172d61a7b 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** CVSS details. */ +/** + * CVSS details. + */ @Immutable public final class Cvss { /* @@ -16,13 +18,15 @@ public final class Cvss { @JsonProperty(value = "base", access = JsonProperty.Access.WRITE_ONLY) private Float base; - /** Creates an instance of Cvss class. */ + /** + * Creates an instance of Cvss class. + */ public Cvss() { } /** * Get the base property: CVSS base. - * + * * @return the base value. */ public Float base() { @@ -31,7 +35,7 @@ public Float base() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DataExportSettings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DataExportSettings.java index ed4306d488793..45e905b3f2367 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DataExportSettings.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DataExportSettings.java @@ -11,7 +11,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Represents a data export setting. */ +/** + * Represents a data export setting. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("DataExportSettings") @Fluent @@ -22,13 +24,15 @@ public final class DataExportSettings extends SettingInner { @JsonProperty(value = "properties") private DataExportSettingProperties innerProperties; - /** Creates an instance of DataExportSettings class. */ + /** + * Creates an instance of DataExportSettings class. + */ public DataExportSettings() { } /** * Get the innerProperties property: Data export setting data. - * + * * @return the innerProperties value. */ private DataExportSettingProperties innerProperties() { @@ -37,7 +41,7 @@ private DataExportSettingProperties innerProperties() { /** * Get the enabled property: Is the data export setting enabled. - * + * * @return the enabled value. */ public Boolean enabled() { @@ -46,7 +50,7 @@ public Boolean enabled() { /** * Set the enabled property: Is the data export setting enabled. - * + * * @param enabled the enabled value to set. * @return the DataExportSettings object itself. */ @@ -60,7 +64,7 @@ public DataExportSettings withEnabled(Boolean enabled) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 8327adbc4f490..bb31fb4acbcba 100644 --- 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 @@ -8,14 +8,18 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for DataSource. */ +/** + * Defines values for DataSource. + */ public final class DataSource extends ExpandableStringEnum { - /** Static value TwinData for DataSource. */ + /** + * Static value TwinData for DataSource. + */ public static final DataSource TWIN_DATA = fromString("TwinData"); /** * Creates a new instance of DataSource value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -24,7 +28,7 @@ public DataSource() { /** * Creates or finds a DataSource from its string representation. - * + * * @param name a name to look for. * @return the corresponding DataSource. */ @@ -35,7 +39,7 @@ public static DataSource fromString(String name) { /** * Gets known DataSource values. - * + * * @return known DataSource values. */ public static Collection values() { 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 index 0d4bb91cd0c71..431d129663d9e 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** The CSPM P1 for AWS offering. */ +/** + * The CSPM P1 for AWS offering. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") @JsonTypeName("DefenderCspmAws") @Fluent @@ -32,13 +34,33 @@ public final class DefenderCspmAwsOffering extends CloudOffering { @JsonProperty(value = "databasesDspm") private DefenderCspmAwsOfferingDatabasesDspm databasesDspm; - /** Creates an instance of DefenderCspmAwsOffering class. */ + /* + * Defenders CSPM Cloud infrastructure entitlement management (CIEM) offering configurations + */ + @JsonProperty(value = "ciem") + private DefenderCspmAwsOfferingCiem ciem; + + /* + * The Microsoft Defender container image assessment configuration + */ + @JsonProperty(value = "mdcContainersImageAssessment") + private DefenderCspmAwsOfferingMdcContainersImageAssessment mdcContainersImageAssessment; + + /* + * The Microsoft Defender container agentless discovery K8s configuration + */ + @JsonProperty(value = "mdcContainersAgentlessDiscoveryK8s") + private DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S; + + /** + * Creates an instance of DefenderCspmAwsOffering class. + */ public DefenderCspmAwsOffering() { } /** * Get the vmScanners property: The Microsoft Defender for Server VM scanning configuration. - * + * * @return the vmScanners value. */ public DefenderCspmAwsOfferingVmScanners vmScanners() { @@ -47,7 +69,7 @@ public DefenderCspmAwsOfferingVmScanners vmScanners() { /** * Set the vmScanners property: The Microsoft Defender for Server VM scanning configuration. - * + * * @param vmScanners the vmScanners value to set. * @return the DefenderCspmAwsOffering object itself. */ @@ -58,7 +80,7 @@ public DefenderCspmAwsOffering withVmScanners(DefenderCspmAwsOfferingVmScanners /** * Get the dataSensitivityDiscovery property: The Microsoft Defender Data Sensitivity discovery configuration. - * + * * @return the dataSensitivityDiscovery value. */ public DefenderCspmAwsOfferingDataSensitivityDiscovery dataSensitivityDiscovery() { @@ -67,19 +89,19 @@ public DefenderCspmAwsOfferingDataSensitivityDiscovery 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) { + 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() { @@ -88,7 +110,7 @@ public DefenderCspmAwsOfferingDatabasesDspm databasesDspm() { /** * Set the databasesDspm property: The databases DSPM configuration. - * + * * @param databasesDspm the databasesDspm value to set. * @return the DefenderCspmAwsOffering object itself. */ @@ -97,9 +119,75 @@ public DefenderCspmAwsOffering withDatabasesDspm(DefenderCspmAwsOfferingDatabase return this; } + /** + * Get the ciem property: Defenders CSPM Cloud infrastructure entitlement management (CIEM) offering + * configurations. + * + * @return the ciem value. + */ + public DefenderCspmAwsOfferingCiem ciem() { + return this.ciem; + } + + /** + * Set the ciem property: Defenders CSPM Cloud infrastructure entitlement management (CIEM) 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 @@ -114,5 +202,14 @@ public void validate() { if (databasesDspm() != null) { databasesDspm().validate(); } + if (ciem() != null) { + ciem().validate(); + } + if (mdcContainersImageAssessment() != null) { + mdcContainersImageAssessment().validate(); + } + if (mdcContainersAgentlessDiscoveryK8S() != null) { + mdcContainersAgentlessDiscoveryK8S().validate(); + } } } 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 new file mode 100644 index 0000000000000..faad3cf060499 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiem.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defenders CSPM Cloud infrastructure entitlement management (CIEM) offering configurations. + */ +@Fluent +public final class DefenderCspmAwsOfferingCiem { + /* + * Defender CSPM CIEM discovery configuration + */ + @JsonProperty(value = "ciemDiscovery") + private DefenderCspmAwsOfferingCiemDiscovery ciemDiscovery; + + /* + * Defender CSPM CIEM AWS OIDC (open id connect) configuration + */ + @JsonProperty(value = "ciemOidc") + private DefenderCspmAwsOfferingCiemOidc ciemOidc; + + /** + * Creates an instance of DefenderCspmAwsOfferingCiem class. + */ + public DefenderCspmAwsOfferingCiem() { + } + + /** + * Get the ciemDiscovery property: Defender CSPM CIEM discovery configuration. + * + * @return the ciemDiscovery value. + */ + public DefenderCspmAwsOfferingCiemDiscovery ciemDiscovery() { + return this.ciemDiscovery; + } + + /** + * Set the ciemDiscovery property: Defender CSPM CIEM 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: Defender CSPM CIEM AWS OIDC (open id connect) configuration. + * + * @return the ciemOidc value. + */ + public DefenderCspmAwsOfferingCiemOidc ciemOidc() { + return this.ciemOidc; + } + + /** + * Set the ciemOidc property: Defender CSPM CIEM AWS OIDC (open id connect) configuration. + * + * @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(); + } + } +} 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 new file mode 100644 index 0000000000000..f7a6f2eee5cbd --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiemDiscovery.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defender CSPM CIEM discovery configuration. + */ +@Fluent +public final class DefenderCspmAwsOfferingCiemDiscovery { + /* + * The cloud role ARN in AWS for CIEM discovery + */ + @JsonProperty(value = "cloudRoleArn") + private String cloudRoleArn; + + /** + * Creates an instance of DefenderCspmAwsOfferingCiemDiscovery class. + */ + public DefenderCspmAwsOfferingCiemDiscovery() { + } + + /** + * Get the cloudRoleArn property: The cloud role ARN in AWS for CIEM discovery. + * + * @return the cloudRoleArn value. + */ + public String cloudRoleArn() { + return this.cloudRoleArn; + } + + /** + * Set the cloudRoleArn property: The cloud role ARN in AWS for CIEM 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() { + } +} 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 new file mode 100644 index 0000000000000..7d4577dbbb03e --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiemOidc.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defender CSPM CIEM AWS OIDC (open id connect) configuration. + */ +@Fluent +public final class DefenderCspmAwsOfferingCiemOidc { + /* + * The cloud role ARN in AWS for CIEM oidc connection + */ + @JsonProperty(value = "cloudRoleArn") + private String cloudRoleArn; + + /* + * the azure active directory app name used of authenticating against AWS + */ + @JsonProperty(value = "azureActiveDirectoryAppName") + private String azureActiveDirectoryAppName; + + /** + * Creates an instance of DefenderCspmAwsOfferingCiemOidc class. + */ + public DefenderCspmAwsOfferingCiemOidc() { + } + + /** + * Get the cloudRoleArn property: The cloud role ARN in AWS for CIEM oidc connection. + * + * @return the cloudRoleArn value. + */ + public String cloudRoleArn() { + return this.cloudRoleArn; + } + + /** + * Set the cloudRoleArn property: The cloud role ARN in AWS for CIEM 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() { + } +} 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 index 4db399753ec84..45b882cdb39cf 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The Microsoft Defender Data Sensitivity discovery configuration. */ +/** + * The Microsoft Defender Data Sensitivity discovery configuration. + */ @Fluent public final class DefenderCspmAwsOfferingDataSensitivityDiscovery { /* @@ -22,13 +24,15 @@ public final class DefenderCspmAwsOfferingDataSensitivityDiscovery { @JsonProperty(value = "cloudRoleArn") private String cloudRoleArn; - /** Creates an instance of DefenderCspmAwsOfferingDataSensitivityDiscovery class. */ + /** + * 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() { @@ -37,7 +41,7 @@ public Boolean enabled() { /** * Set the enabled property: Is Microsoft Defender Data Sensitivity discovery enabled. - * + * * @param enabled the enabled value to set. * @return the DefenderCspmAwsOfferingDataSensitivityDiscovery object itself. */ @@ -48,7 +52,7 @@ public DefenderCspmAwsOfferingDataSensitivityDiscovery withEnabled(Boolean enabl /** * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * + * * @return the cloudRoleArn value. */ public String cloudRoleArn() { @@ -57,7 +61,7 @@ public String 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. */ @@ -68,7 +72,7 @@ public DefenderCspmAwsOfferingDataSensitivityDiscovery withCloudRoleArn(String c /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 15821e5d425b7..c202ed2c0d92d 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The databases DSPM configuration. */ +/** + * The databases DSPM configuration. + */ @Fluent public final class DefenderCspmAwsOfferingDatabasesDspm { /* @@ -22,13 +24,15 @@ public final class DefenderCspmAwsOfferingDatabasesDspm { @JsonProperty(value = "cloudRoleArn") private String cloudRoleArn; - /** Creates an instance of DefenderCspmAwsOfferingDatabasesDspm class. */ + /** + * Creates an instance of DefenderCspmAwsOfferingDatabasesDspm class. + */ public DefenderCspmAwsOfferingDatabasesDspm() { } /** * Get the enabled property: Is databases DSPM protection enabled. - * + * * @return the enabled value. */ public Boolean enabled() { @@ -37,7 +41,7 @@ public Boolean enabled() { /** * Set the enabled property: Is databases DSPM protection enabled. - * + * * @param enabled the enabled value to set. * @return the DefenderCspmAwsOfferingDatabasesDspm object itself. */ @@ -48,7 +52,7 @@ public DefenderCspmAwsOfferingDatabasesDspm withEnabled(Boolean enabled) { /** * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * + * * @return the cloudRoleArn value. */ public String cloudRoleArn() { @@ -57,7 +61,7 @@ public String 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. */ @@ -68,7 +72,7 @@ public DefenderCspmAwsOfferingDatabasesDspm withCloudRoleArn(String cloudRoleArn /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 new file mode 100644 index 0000000000000..52fc063bf334f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Microsoft Defender container agentless discovery K8s configuration. + */ +@Fluent +public final class DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S { + /* + * Is Microsoft Defender container agentless discovery K8s enabled + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The cloud role ARN in AWS for this feature + */ + @JsonProperty(value = "cloudRoleArn") + 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() { + } +} 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 new file mode 100644 index 0000000000000..cfa11595913f8 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingMdcContainersImageAssessment.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Microsoft Defender container image assessment configuration. + */ +@Fluent +public final class DefenderCspmAwsOfferingMdcContainersImageAssessment { + /* + * Is Microsoft Defender container image assessment enabled + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The cloud role ARN in AWS for this feature + */ + @JsonProperty(value = "cloudRoleArn") + 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() { + } +} 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 index 8854c0967acf4..d0b1864ad5ee4 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The Microsoft Defender for Server VM scanning configuration. */ +/** + * The Microsoft Defender for Server VM scanning configuration. + */ @Fluent public final class DefenderCspmAwsOfferingVmScanners { /* @@ -22,13 +24,15 @@ public final class DefenderCspmAwsOfferingVmScanners { @JsonProperty(value = "configuration") private DefenderCspmAwsOfferingVmScannersConfiguration configuration; - /** Creates an instance of DefenderCspmAwsOfferingVmScanners class. */ + /** + * Creates an instance of DefenderCspmAwsOfferingVmScanners class. + */ public DefenderCspmAwsOfferingVmScanners() { } /** * Get the enabled property: Is Microsoft Defender for Server VM scanning enabled. - * + * * @return the enabled value. */ public Boolean enabled() { @@ -37,7 +41,7 @@ public Boolean enabled() { /** * Set the enabled property: Is Microsoft Defender for Server VM scanning enabled. - * + * * @param enabled the enabled value to set. * @return the DefenderCspmAwsOfferingVmScanners object itself. */ @@ -48,7 +52,7 @@ public DefenderCspmAwsOfferingVmScanners withEnabled(Boolean enabled) { /** * Get the configuration property: configuration for Microsoft Defender for Server VM scanning. - * + * * @return the configuration value. */ public DefenderCspmAwsOfferingVmScannersConfiguration configuration() { @@ -57,19 +61,19 @@ public DefenderCspmAwsOfferingVmScannersConfiguration configuration() { /** * Set the configuration property: configuration for Microsoft Defender for Server VM scanning. - * + * * @param configuration the configuration value to set. * @return the DefenderCspmAwsOfferingVmScanners object itself. */ - public DefenderCspmAwsOfferingVmScanners withConfiguration( - DefenderCspmAwsOfferingVmScannersConfiguration configuration) { + public DefenderCspmAwsOfferingVmScanners + withConfiguration(DefenderCspmAwsOfferingVmScannersConfiguration configuration) { this.configuration = configuration; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingVmScannersConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingVmScannersConfiguration.java index e70b7f13e8c28..181e39d30344b 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingVmScannersConfiguration.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingVmScannersConfiguration.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** configuration for Microsoft Defender for Server VM scanning. */ +/** + * configuration for Microsoft Defender for Server VM scanning. + */ @Fluent public final class DefenderCspmAwsOfferingVmScannersConfiguration { /* @@ -31,13 +33,15 @@ public final class DefenderCspmAwsOfferingVmScannersConfiguration { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map exclusionTags; - /** Creates an instance of DefenderCspmAwsOfferingVmScannersConfiguration class. */ + /** + * Creates an instance of DefenderCspmAwsOfferingVmScannersConfiguration class. + */ public DefenderCspmAwsOfferingVmScannersConfiguration() { } /** * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * + * * @return the cloudRoleArn value. */ public String cloudRoleArn() { @@ -46,7 +50,7 @@ public String cloudRoleArn() { /** * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * + * * @param cloudRoleArn the cloudRoleArn value to set. * @return the DefenderCspmAwsOfferingVmScannersConfiguration object itself. */ @@ -57,7 +61,7 @@ public DefenderCspmAwsOfferingVmScannersConfiguration withCloudRoleArn(String cl /** * Get the scanningMode property: The scanning mode for the VM scan. - * + * * @return the scanningMode value. */ public ScanningMode scanningMode() { @@ -66,7 +70,7 @@ public ScanningMode scanningMode() { /** * Set the scanningMode property: The scanning mode for the VM scan. - * + * * @param scanningMode the scanningMode value to set. * @return the DefenderCspmAwsOfferingVmScannersConfiguration object itself. */ @@ -77,7 +81,7 @@ public DefenderCspmAwsOfferingVmScannersConfiguration withScanningMode(ScanningM /** * Get the exclusionTags property: VM tags that indicates that VM should not be scanned. - * + * * @return the exclusionTags value. */ public Map exclusionTags() { @@ -86,7 +90,7 @@ public Map exclusionTags() { /** * Set the exclusionTags property: VM tags that indicates that VM should not be scanned. - * + * * @param exclusionTags the exclusionTags value to set. * @return the DefenderCspmAwsOfferingVmScannersConfiguration object itself. */ @@ -97,7 +101,7 @@ public DefenderCspmAwsOfferingVmScannersConfiguration withExclusionTags(Map exclusionTags; + + /** + * Creates an instance of DefenderCspmGcpOfferingVmScannersConfiguration class. + */ + public DefenderCspmGcpOfferingVmScannersConfiguration() { + } + + /** + * Get the scanningMode property: The scanning mode for the VM scan. + * + * @return the scanningMode value. + */ + public ScanningMode scanningMode() { + return this.scanningMode; + } + + /** + * Set the scanningMode property: The scanning mode for the VM scan. + * + * @param scanningMode the scanningMode value to set. + * @return the DefenderCspmGcpOfferingVmScannersConfiguration object itself. + */ + public DefenderCspmGcpOfferingVmScannersConfiguration withScanningMode(ScanningMode scanningMode) { + this.scanningMode = scanningMode; + return this; + } + + /** + * Get the exclusionTags property: VM tags that indicates that VM should not be scanned. + * + * @return the exclusionTags value. + */ + public Map exclusionTags() { + return this.exclusionTags; + } + + /** + * Set the exclusionTags property: VM tags that indicates that VM should not be scanned. + * + * @param exclusionTags the exclusionTags value to set. + * @return the DefenderCspmGcpOfferingVmScannersConfiguration object itself. + */ + public DefenderCspmGcpOfferingVmScannersConfiguration withExclusionTags(Map exclusionTags) { + this.exclusionTags = exclusionTags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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 index d95d5ca67fb67..d17ff6a867bab 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** The Defender for Databases AWS offering. */ +/** + * The Defender for Databases AWS offering. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") @JsonTypeName("DefenderForDatabasesAws") @Fluent @@ -32,13 +34,15 @@ public final class DefenderFoDatabasesAwsOffering extends CloudOffering { @JsonProperty(value = "databasesDspm") private DefenderFoDatabasesAwsOfferingDatabasesDspm databasesDspm; - /** Creates an instance of DefenderFoDatabasesAwsOffering class. */ + /** + * Creates an instance of DefenderFoDatabasesAwsOffering class. + */ public DefenderFoDatabasesAwsOffering() { } /** * Get the arcAutoProvisioning property: The ARC autoprovisioning configuration. - * + * * @return the arcAutoProvisioning value. */ public DefenderFoDatabasesAwsOfferingArcAutoProvisioning arcAutoProvisioning() { @@ -47,19 +51,19 @@ public DefenderFoDatabasesAwsOfferingArcAutoProvisioning 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) { + public DefenderFoDatabasesAwsOffering + withArcAutoProvisioning(DefenderFoDatabasesAwsOfferingArcAutoProvisioning arcAutoProvisioning) { this.arcAutoProvisioning = arcAutoProvisioning; return this; } /** * Get the rds property: The RDS configuration. - * + * * @return the rds value. */ public DefenderFoDatabasesAwsOfferingRds rds() { @@ -68,7 +72,7 @@ public DefenderFoDatabasesAwsOfferingRds rds() { /** * Set the rds property: The RDS configuration. - * + * * @param rds the rds value to set. * @return the DefenderFoDatabasesAwsOffering object itself. */ @@ -79,7 +83,7 @@ public DefenderFoDatabasesAwsOffering withRds(DefenderFoDatabasesAwsOfferingRds /** * Get the databasesDspm property: The databases data security posture management (DSPM) configuration. - * + * * @return the databasesDspm value. */ public DefenderFoDatabasesAwsOfferingDatabasesDspm databasesDspm() { @@ -88,7 +92,7 @@ public DefenderFoDatabasesAwsOfferingDatabasesDspm 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. */ @@ -99,7 +103,7 @@ public DefenderFoDatabasesAwsOffering withDatabasesDspm(DefenderFoDatabasesAwsOf /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index b08183d5e9f38..be528f28a6e6b 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The ARC autoprovisioning configuration. */ +/** + * The ARC autoprovisioning configuration. + */ @Fluent public final class DefenderFoDatabasesAwsOfferingArcAutoProvisioning { /* @@ -28,13 +30,15 @@ public final class DefenderFoDatabasesAwsOfferingArcAutoProvisioning { @JsonProperty(value = "configuration") private DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration configuration; - /** Creates an instance of DefenderFoDatabasesAwsOfferingArcAutoProvisioning class. */ + /** + * Creates an instance of DefenderFoDatabasesAwsOfferingArcAutoProvisioning class. + */ public DefenderFoDatabasesAwsOfferingArcAutoProvisioning() { } /** * Get the enabled property: Is arc auto provisioning enabled. - * + * * @return the enabled value. */ public Boolean enabled() { @@ -43,7 +47,7 @@ public Boolean enabled() { /** * Set the enabled property: Is arc auto provisioning enabled. - * + * * @param enabled the enabled value to set. * @return the DefenderFoDatabasesAwsOfferingArcAutoProvisioning object itself. */ @@ -54,7 +58,7 @@ public DefenderFoDatabasesAwsOfferingArcAutoProvisioning withEnabled(Boolean ena /** * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * + * * @return the cloudRoleArn value. */ public String cloudRoleArn() { @@ -63,7 +67,7 @@ public String cloudRoleArn() { /** * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * + * * @param cloudRoleArn the cloudRoleArn value to set. * @return the DefenderFoDatabasesAwsOfferingArcAutoProvisioning object itself. */ @@ -74,7 +78,7 @@ public DefenderFoDatabasesAwsOfferingArcAutoProvisioning withCloudRoleArn(String /** * Get the configuration property: Configuration for servers Arc auto provisioning. - * + * * @return the configuration value. */ public DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration configuration() { @@ -83,19 +87,19 @@ public DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration configurat /** * Set the configuration property: Configuration for servers Arc auto provisioning. - * + * * @param configuration the configuration value to set. * @return the DefenderFoDatabasesAwsOfferingArcAutoProvisioning object itself. */ - public DefenderFoDatabasesAwsOfferingArcAutoProvisioning withConfiguration( - DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration configuration) { + public DefenderFoDatabasesAwsOfferingArcAutoProvisioning + withConfiguration(DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration configuration) { this.configuration = configuration; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration.java index a4796bf24775d..6e7ca9c54548e 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Configuration for servers Arc auto provisioning. */ +/** + * Configuration for servers Arc auto provisioning. + */ @Fluent public final class DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration { /* @@ -22,13 +24,15 @@ public final class DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguratio @JsonProperty(value = "privateLinkScope") private String privateLinkScope; - /** Creates an instance of DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration class. */ + /** + * Creates an instance of DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration class. + */ public DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration() { } /** * Get the proxy property: Optional http proxy endpoint to use for the Arc agent. - * + * * @return the proxy value. */ public String proxy() { @@ -37,7 +41,7 @@ public String proxy() { /** * Set the proxy property: Optional http proxy endpoint to use for the Arc agent. - * + * * @param proxy the proxy value to set. * @return the DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration object itself. */ @@ -48,7 +52,7 @@ public DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration withProxy( /** * Get the privateLinkScope property: Optional Arc private link scope resource id to link the Arc agent. - * + * * @return the privateLinkScope value. */ public String privateLinkScope() { @@ -57,19 +61,19 @@ public String 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 DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration object itself. */ - public DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration withPrivateLinkScope( - String privateLinkScope) { + public DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration + withPrivateLinkScope(String privateLinkScope) { this.privateLinkScope = privateLinkScope; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index f4e4b88c87353..e6fe9024911ed 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The databases data security posture management (DSPM) configuration. */ +/** + * The databases data security posture management (DSPM) configuration. + */ @Fluent public final class DefenderFoDatabasesAwsOfferingDatabasesDspm { /* @@ -22,13 +24,15 @@ public final class DefenderFoDatabasesAwsOfferingDatabasesDspm { @JsonProperty(value = "cloudRoleArn") private String cloudRoleArn; - /** Creates an instance of DefenderFoDatabasesAwsOfferingDatabasesDspm class. */ + /** + * 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() { @@ -37,7 +41,7 @@ public Boolean 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. */ @@ -48,7 +52,7 @@ public DefenderFoDatabasesAwsOfferingDatabasesDspm withEnabled(Boolean enabled) /** * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * + * * @return the cloudRoleArn value. */ public String cloudRoleArn() { @@ -57,7 +61,7 @@ public String 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. */ @@ -68,7 +72,7 @@ public DefenderFoDatabasesAwsOfferingDatabasesDspm withCloudRoleArn(String cloud /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 73c9f6277ef59..ac0c430af8240 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The RDS configuration. */ +/** + * The RDS configuration. + */ @Fluent public final class DefenderFoDatabasesAwsOfferingRds { /* @@ -22,13 +24,15 @@ public final class DefenderFoDatabasesAwsOfferingRds { @JsonProperty(value = "cloudRoleArn") private String cloudRoleArn; - /** Creates an instance of DefenderFoDatabasesAwsOfferingRds class. */ + /** + * Creates an instance of DefenderFoDatabasesAwsOfferingRds class. + */ public DefenderFoDatabasesAwsOfferingRds() { } /** * Get the enabled property: Is RDS protection enabled. - * + * * @return the enabled value. */ public Boolean enabled() { @@ -37,7 +41,7 @@ public Boolean enabled() { /** * Set the enabled property: Is RDS protection enabled. - * + * * @param enabled the enabled value to set. * @return the DefenderFoDatabasesAwsOfferingRds object itself. */ @@ -48,7 +52,7 @@ public DefenderFoDatabasesAwsOfferingRds withEnabled(Boolean enabled) { /** * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * + * * @return the cloudRoleArn value. */ public String cloudRoleArn() { @@ -57,7 +61,7 @@ public String 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. */ @@ -68,7 +72,7 @@ public DefenderFoDatabasesAwsOfferingRds withCloudRoleArn(String cloudRoleArn) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 9877dfd1b9384..e94faaf094a5e 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** The Defender for Containers AWS offering. */ +/** + * The Defender for Containers AWS offering. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") @JsonTypeName("DefenderForContainersAws") @Fluent @@ -74,13 +76,27 @@ public final class DefenderForContainersAwsOffering extends CloudOffering { @JsonProperty(value = "scubaExternalId") private String scubaExternalId; - /** Creates an instance of DefenderForContainersAwsOffering class. */ + /* + * The Microsoft Defender container image assessment configuration + */ + @JsonProperty(value = "mdcContainersImageAssessment") + private DefenderForContainersAwsOfferingMdcContainersImageAssessment mdcContainersImageAssessment; + + /* + * The Microsoft Defender container agentless discovery K8s configuration + */ + @JsonProperty(value = "mdcContainersAgentlessDiscoveryK8s") + private DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S; + + /** + * Creates an instance of DefenderForContainersAwsOffering class. + */ public DefenderForContainersAwsOffering() { } /** * Get the kubernetesService property: The kubernetes service connection configuration. - * + * * @return the kubernetesService value. */ public DefenderForContainersAwsOfferingKubernetesService kubernetesService() { @@ -89,19 +105,19 @@ public DefenderForContainersAwsOfferingKubernetesService 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) { + public DefenderForContainersAwsOffering + withKubernetesService(DefenderForContainersAwsOfferingKubernetesService kubernetesService) { this.kubernetesService = kubernetesService; return this; } /** * Get the kubernetesScubaReader property: The kubernetes to scuba connection configuration. - * + * * @return the kubernetesScubaReader value. */ public DefenderForContainersAwsOfferingKubernetesScubaReader kubernetesScubaReader() { @@ -110,19 +126,19 @@ public DefenderForContainersAwsOfferingKubernetesScubaReader kubernetesScubaRead /** * Set the kubernetesScubaReader property: The kubernetes to scuba connection configuration. - * + * * @param kubernetesScubaReader the kubernetesScubaReader value to set. * @return the DefenderForContainersAwsOffering object itself. */ - public DefenderForContainersAwsOffering withKubernetesScubaReader( - DefenderForContainersAwsOfferingKubernetesScubaReader kubernetesScubaReader) { + public DefenderForContainersAwsOffering + withKubernetesScubaReader(DefenderForContainersAwsOfferingKubernetesScubaReader kubernetesScubaReader) { this.kubernetesScubaReader = kubernetesScubaReader; return this; } /** * Get the cloudWatchToKinesis property: The cloudwatch to kinesis connection configuration. - * + * * @return the cloudWatchToKinesis value. */ public DefenderForContainersAwsOfferingCloudWatchToKinesis cloudWatchToKinesis() { @@ -131,19 +147,19 @@ public DefenderForContainersAwsOfferingCloudWatchToKinesis 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) { + 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() { @@ -152,7 +168,7 @@ public DefenderForContainersAwsOfferingKinesisToS3 kinesisToS3() { /** * Set the kinesisToS3 property: The kinesis to s3 connection configuration. - * + * * @param kinesisToS3 the kinesisToS3 value to set. * @return the DefenderForContainersAwsOffering object itself. */ @@ -163,7 +179,7 @@ public DefenderForContainersAwsOffering withKinesisToS3(DefenderForContainersAws /** * Get the containerVulnerabilityAssessment property: The container vulnerability assessment configuration. - * + * * @return the containerVulnerabilityAssessment value. */ public DefenderForContainersAwsOfferingContainerVulnerabilityAssessment containerVulnerabilityAssessment() { @@ -172,7 +188,7 @@ public DefenderForContainersAwsOfferingContainerVulnerabilityAssessment containe /** * Set the containerVulnerabilityAssessment property: The container vulnerability assessment configuration. - * + * * @param containerVulnerabilityAssessment the containerVulnerabilityAssessment value to set. * @return the DefenderForContainersAwsOffering object itself. */ @@ -183,8 +199,9 @@ public DefenderForContainersAwsOffering withContainerVulnerabilityAssessment( } /** - * Get the containerVulnerabilityAssessmentTask property: The container vulnerability assessment task configuration. - * + * Get the containerVulnerabilityAssessmentTask property: The container vulnerability assessment task + * configuration. + * * @return the containerVulnerabilityAssessmentTask value. */ public DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask containerVulnerabilityAssessmentTask() { @@ -192,8 +209,9 @@ public DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask cont } /** - * Set the containerVulnerabilityAssessmentTask property: The container vulnerability assessment task configuration. - * + * Set the containerVulnerabilityAssessmentTask property: The container vulnerability assessment task + * configuration. + * * @param containerVulnerabilityAssessmentTask the containerVulnerabilityAssessmentTask value to set. * @return the DefenderForContainersAwsOffering object itself. */ @@ -205,7 +223,7 @@ public DefenderForContainersAwsOffering withContainerVulnerabilityAssessmentTask /** * Get the enableContainerVulnerabilityAssessment property: Enable container vulnerability assessment feature. - * + * * @return the enableContainerVulnerabilityAssessment value. */ public Boolean enableContainerVulnerabilityAssessment() { @@ -214,19 +232,19 @@ public Boolean enableContainerVulnerabilityAssessment() { /** * Set the enableContainerVulnerabilityAssessment property: Enable container vulnerability assessment feature. - * + * * @param enableContainerVulnerabilityAssessment the enableContainerVulnerabilityAssessment value to set. * @return the DefenderForContainersAwsOffering object itself. */ - public DefenderForContainersAwsOffering withEnableContainerVulnerabilityAssessment( - Boolean enableContainerVulnerabilityAssessment) { + public DefenderForContainersAwsOffering + withEnableContainerVulnerabilityAssessment(Boolean enableContainerVulnerabilityAssessment) { this.enableContainerVulnerabilityAssessment = enableContainerVulnerabilityAssessment; return this; } /** * Get the autoProvisioning property: Is audit logs pipeline auto provisioning enabled. - * + * * @return the autoProvisioning value. */ public Boolean autoProvisioning() { @@ -235,7 +253,7 @@ public Boolean autoProvisioning() { /** * Set the autoProvisioning property: Is audit logs pipeline auto provisioning enabled. - * + * * @param autoProvisioning the autoProvisioning value to set. * @return the DefenderForContainersAwsOffering object itself. */ @@ -247,7 +265,7 @@ public DefenderForContainersAwsOffering withAutoProvisioning(Boolean autoProvisi /** * 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() { @@ -257,7 +275,7 @@ public Long 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. */ @@ -268,7 +286,7 @@ public DefenderForContainersAwsOffering withKubeAuditRetentionTime(Long kubeAudi /** * Get the scubaExternalId property: The externalId used by the data reader to prevent the confused deputy attack. - * + * * @return the scubaExternalId value. */ public String scubaExternalId() { @@ -277,7 +295,7 @@ public String scubaExternalId() { /** * Set the scubaExternalId property: The externalId used by the data reader to prevent the confused deputy attack. - * + * * @param scubaExternalId the scubaExternalId value to set. * @return the DefenderForContainersAwsOffering object itself. */ @@ -286,9 +304,53 @@ public DefenderForContainersAwsOffering withScubaExternalId(String scubaExternal 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; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -312,5 +374,11 @@ public void validate() { if (containerVulnerabilityAssessmentTask() != null) { containerVulnerabilityAssessmentTask().validate(); } + if (mdcContainersImageAssessment() != null) { + mdcContainersImageAssessment().validate(); + } + if (mdcContainersAgentlessDiscoveryK8S() != null) { + mdcContainersAgentlessDiscoveryK8S().validate(); + } } } 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 index d27c5a0afc7bd..59df0dad19dc3 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The cloudwatch to kinesis connection configuration. */ +/** + * The cloudwatch to kinesis connection configuration. + */ @Fluent public final class DefenderForContainersAwsOfferingCloudWatchToKinesis { /* @@ -16,13 +18,15 @@ public final class DefenderForContainersAwsOfferingCloudWatchToKinesis { @JsonProperty(value = "cloudRoleArn") private String cloudRoleArn; - /** Creates an instance of DefenderForContainersAwsOfferingCloudWatchToKinesis class. */ + /** + * 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() { @@ -31,7 +35,7 @@ public String 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. */ @@ -42,7 +46,7 @@ public DefenderForContainersAwsOfferingCloudWatchToKinesis withCloudRoleArn(Stri /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingContainerVulnerabilityAssessment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingContainerVulnerabilityAssessment.java index a1348cee8522e..4ec0d73678dd3 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingContainerVulnerabilityAssessment.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingContainerVulnerabilityAssessment.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The container vulnerability assessment configuration. */ +/** + * The container vulnerability assessment configuration. + */ @Fluent public final class DefenderForContainersAwsOfferingContainerVulnerabilityAssessment { /* @@ -16,13 +18,15 @@ public final class DefenderForContainersAwsOfferingContainerVulnerabilityAssessm @JsonProperty(value = "cloudRoleArn") private String cloudRoleArn; - /** Creates an instance of DefenderForContainersAwsOfferingContainerVulnerabilityAssessment class. */ + /** + * Creates an instance of DefenderForContainersAwsOfferingContainerVulnerabilityAssessment class. + */ public DefenderForContainersAwsOfferingContainerVulnerabilityAssessment() { } /** * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * + * * @return the cloudRoleArn value. */ public String cloudRoleArn() { @@ -31,7 +35,7 @@ public String cloudRoleArn() { /** * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * + * * @param cloudRoleArn the cloudRoleArn value to set. * @return the DefenderForContainersAwsOfferingContainerVulnerabilityAssessment object itself. */ @@ -42,7 +46,7 @@ public DefenderForContainersAwsOfferingContainerVulnerabilityAssessment withClou /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask.java index 711d36db19c0a..b1750e8084e00 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The container vulnerability assessment task configuration. */ +/** + * The container vulnerability assessment task configuration. + */ @Fluent public final class DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask { /* @@ -16,13 +18,15 @@ public final class DefenderForContainersAwsOfferingContainerVulnerabilityAssessm @JsonProperty(value = "cloudRoleArn") private String cloudRoleArn; - /** Creates an instance of DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask class. */ + /** + * Creates an instance of DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask class. + */ public DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask() { } /** * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * + * * @return the cloudRoleArn value. */ public String cloudRoleArn() { @@ -31,7 +35,7 @@ public String cloudRoleArn() { /** * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * + * * @param cloudRoleArn the cloudRoleArn value to set. * @return the DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask object itself. */ @@ -42,7 +46,7 @@ public DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask with /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 1dc228f61ddf5..23ab2b9a459d6 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The kinesis to s3 connection configuration. */ +/** + * The kinesis to s3 connection configuration. + */ @Fluent public final class DefenderForContainersAwsOfferingKinesisToS3 { /* @@ -16,13 +18,15 @@ public final class DefenderForContainersAwsOfferingKinesisToS3 { @JsonProperty(value = "cloudRoleArn") private String cloudRoleArn; - /** Creates an instance of DefenderForContainersAwsOfferingKinesisToS3 class. */ + /** + * 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() { @@ -31,7 +35,7 @@ public String 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. */ @@ -42,7 +46,7 @@ public DefenderForContainersAwsOfferingKinesisToS3 withCloudRoleArn(String cloud /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKubernetesScubaReader.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKubernetesScubaReader.java index 13533efccb8ff..669a805c78411 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKubernetesScubaReader.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKubernetesScubaReader.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The kubernetes to scuba connection configuration. */ +/** + * The kubernetes to scuba connection configuration. + */ @Fluent public final class DefenderForContainersAwsOfferingKubernetesScubaReader { /* @@ -16,13 +18,15 @@ public final class DefenderForContainersAwsOfferingKubernetesScubaReader { @JsonProperty(value = "cloudRoleArn") private String cloudRoleArn; - /** Creates an instance of DefenderForContainersAwsOfferingKubernetesScubaReader class. */ + /** + * Creates an instance of DefenderForContainersAwsOfferingKubernetesScubaReader class. + */ public DefenderForContainersAwsOfferingKubernetesScubaReader() { } /** * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature used for reading data. - * + * * @return the cloudRoleArn value. */ public String cloudRoleArn() { @@ -31,7 +35,7 @@ public String 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 DefenderForContainersAwsOfferingKubernetesScubaReader object itself. */ @@ -42,7 +46,7 @@ public DefenderForContainersAwsOfferingKubernetesScubaReader withCloudRoleArn(St /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 391c18cb98e0e..3639cd51c2631 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The kubernetes service connection configuration. */ +/** + * The kubernetes service connection configuration. + */ @Fluent public final class DefenderForContainersAwsOfferingKubernetesService { /* @@ -16,13 +18,15 @@ public final class DefenderForContainersAwsOfferingKubernetesService { @JsonProperty(value = "cloudRoleArn") private String cloudRoleArn; - /** Creates an instance of DefenderForContainersAwsOfferingKubernetesService class. */ + /** + * 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() { @@ -31,7 +35,7 @@ public String 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. */ @@ -42,7 +46,7 @@ public DefenderForContainersAwsOfferingKubernetesService withCloudRoleArn(String /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 new file mode 100644 index 0000000000000..e442242e6ea0c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Microsoft Defender container agentless discovery K8s configuration. + */ +@Fluent +public final class DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S { + /* + * Is Microsoft Defender container agentless discovery K8s enabled + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The cloud role ARN in AWS for this feature + */ + @JsonProperty(value = "cloudRoleArn") + 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() { + } +} 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 new file mode 100644 index 0000000000000..f1206de4ecf18 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingMdcContainersImageAssessment.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Microsoft Defender container image assessment configuration. + */ +@Fluent +public final class DefenderForContainersAwsOfferingMdcContainersImageAssessment { + /* + * Is Microsoft Defender container image assessment enabled + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The cloud role ARN in AWS for this feature + */ + @JsonProperty(value = "cloudRoleArn") + 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() { + } +} 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 index 4f6379839b469..efe381e51a0ff 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** The containers GCP offering. */ +/** + * The containers GCP offering. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") @JsonTypeName("DefenderForContainersGcp") @Fluent @@ -44,13 +46,27 @@ public final class DefenderForContainersGcpOffering extends CloudOffering { @JsonProperty(value = "policyAgentAutoProvisioningFlag") private Boolean policyAgentAutoProvisioningFlag; - /** Creates an instance of DefenderForContainersGcpOffering class. */ + /* + * The Microsoft Defender Container image assessment configuration + */ + @JsonProperty(value = "mdcContainersImageAssessment") + private DefenderForContainersGcpOfferingMdcContainersImageAssessment mdcContainersImageAssessment; + + /* + * The Microsoft Defender Container agentless discovery configuration + */ + @JsonProperty(value = "mdcContainersAgentlessDiscoveryK8s") + private DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S; + + /** + * Creates an instance of DefenderForContainersGcpOffering class. + */ public DefenderForContainersGcpOffering() { } /** * Get the nativeCloudConnection property: The native cloud connection configuration. - * + * * @return the nativeCloudConnection value. */ public DefenderForContainersGcpOfferingNativeCloudConnection nativeCloudConnection() { @@ -59,19 +75,19 @@ public DefenderForContainersGcpOfferingNativeCloudConnection nativeCloudConnecti /** * 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) { + 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() { @@ -80,7 +96,7 @@ public DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection dataPip /** * Set the dataPipelineNativeCloudConnection property: The native cloud connection configuration. - * + * * @param dataPipelineNativeCloudConnection the dataPipelineNativeCloudConnection value to set. * @return the DefenderForContainersGcpOffering object itself. */ @@ -92,7 +108,7 @@ public DefenderForContainersGcpOffering withDataPipelineNativeCloudConnection( /** * Get the auditLogsAutoProvisioningFlag property: Is audit logs data collection enabled. - * + * * @return the auditLogsAutoProvisioningFlag value. */ public Boolean auditLogsAutoProvisioningFlag() { @@ -101,7 +117,7 @@ public Boolean auditLogsAutoProvisioningFlag() { /** * Set the auditLogsAutoProvisioningFlag property: Is audit logs data collection enabled. - * + * * @param auditLogsAutoProvisioningFlag the auditLogsAutoProvisioningFlag value to set. * @return the DefenderForContainersGcpOffering object itself. */ @@ -113,7 +129,7 @@ public DefenderForContainersGcpOffering withAuditLogsAutoProvisioningFlag(Boolea /** * Get the defenderAgentAutoProvisioningFlag property: Is Microsoft Defender for Cloud Kubernetes agent auto * provisioning enabled. - * + * * @return the defenderAgentAutoProvisioningFlag value. */ public Boolean defenderAgentAutoProvisioningFlag() { @@ -123,19 +139,19 @@ public Boolean defenderAgentAutoProvisioningFlag() { /** * Set the defenderAgentAutoProvisioningFlag property: Is Microsoft Defender for Cloud Kubernetes agent auto * provisioning enabled. - * + * * @param defenderAgentAutoProvisioningFlag the defenderAgentAutoProvisioningFlag value to set. * @return the DefenderForContainersGcpOffering object itself. */ - public DefenderForContainersGcpOffering withDefenderAgentAutoProvisioningFlag( - Boolean defenderAgentAutoProvisioningFlag) { + public DefenderForContainersGcpOffering + withDefenderAgentAutoProvisioningFlag(Boolean defenderAgentAutoProvisioningFlag) { this.defenderAgentAutoProvisioningFlag = defenderAgentAutoProvisioningFlag; return this; } /** * Get the policyAgentAutoProvisioningFlag property: Is Policy Kubernetes agent auto provisioning enabled. - * + * * @return the policyAgentAutoProvisioningFlag value. */ public Boolean policyAgentAutoProvisioningFlag() { @@ -144,19 +160,63 @@ public Boolean policyAgentAutoProvisioningFlag() { /** * Set the policyAgentAutoProvisioningFlag property: Is Policy Kubernetes agent auto provisioning enabled. - * + * * @param policyAgentAutoProvisioningFlag the policyAgentAutoProvisioningFlag value to set. * @return the DefenderForContainersGcpOffering object itself. */ - public DefenderForContainersGcpOffering withPolicyAgentAutoProvisioningFlag( - Boolean policyAgentAutoProvisioningFlag) { + public DefenderForContainersGcpOffering + withPolicyAgentAutoProvisioningFlag(Boolean policyAgentAutoProvisioningFlag) { this.policyAgentAutoProvisioningFlag = policyAgentAutoProvisioningFlag; 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; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -168,5 +228,11 @@ public void validate() { if (dataPipelineNativeCloudConnection() != null) { dataPipelineNativeCloudConnection().validate(); } + if (mdcContainersImageAssessment() != null) { + mdcContainersImageAssessment().validate(); + } + if (mdcContainersAgentlessDiscoveryK8S() != null) { + mdcContainersAgentlessDiscoveryK8S().validate(); + } } } 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 index 263ea9aa2cc4a..be2aadb8c4e32 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The native cloud connection configuration. */ +/** + * The native cloud connection configuration. + */ @Fluent public final class DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection { /* @@ -22,14 +24,16 @@ public final class DefenderForContainersGcpOfferingDataPipelineNativeCloudConnec @JsonProperty(value = "workloadIdentityProviderId") private String workloadIdentityProviderId; - /** Creates an instance of DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection class. */ + /** + * 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() { @@ -39,12 +43,12 @@ public String 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) { + public DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection + withServiceAccountEmailAddress(String serviceAccountEmailAddress) { this.serviceAccountEmailAddress = serviceAccountEmailAddress; return this; } @@ -52,7 +56,7 @@ public DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection withSer /** * Get the workloadIdentityProviderId property: The data collection GCP workload identity provider id for this * offering. - * + * * @return the workloadIdentityProviderId value. */ public String workloadIdentityProviderId() { @@ -62,19 +66,19 @@ public String 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) { + 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() { 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 new file mode 100644 index 0000000000000..826addd4b26e4 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Microsoft Defender Container agentless discovery configuration. + */ +@Fluent +public final class DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S { + /* + * Is Microsoft Defender container agentless discovery enabled + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The workload identity provider id in GCP for this feature + */ + @JsonProperty(value = "workloadIdentityProviderId") + private String workloadIdentityProviderId; + + /* + * The service account email address in GCP for this feature + */ + @JsonProperty(value = "serviceAccountEmailAddress") + 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() { + } +} 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 new file mode 100644 index 0000000000000..7d4321448beab --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingMdcContainersImageAssessment.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Microsoft Defender Container image assessment configuration. + */ +@Fluent +public final class DefenderForContainersGcpOfferingMdcContainersImageAssessment { + /* + * Is Microsoft Defender container image assessment enabled + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The workload identity provider id in GCP for this feature + */ + @JsonProperty(value = "workloadIdentityProviderId") + private String workloadIdentityProviderId; + + /* + * The service account email address in GCP for this feature + */ + @JsonProperty(value = "serviceAccountEmailAddress") + 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() { + } +} 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 index bc0088a59a9d4..6cdcebcf95b73 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The native cloud connection configuration. */ +/** + * The native cloud connection configuration. + */ @Fluent public final class DefenderForContainersGcpOfferingNativeCloudConnection { /* @@ -22,13 +24,15 @@ public final class DefenderForContainersGcpOfferingNativeCloudConnection { @JsonProperty(value = "workloadIdentityProviderId") private String workloadIdentityProviderId; - /** Creates an instance of DefenderForContainersGcpOfferingNativeCloudConnection class. */ + /** + * 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() { @@ -37,19 +41,19 @@ public String 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) { + 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() { @@ -58,19 +62,19 @@ public String 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) { + 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() { 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 index 0dc9a2ad7509e..516ba4e4b86e3 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** The Defender for Databases GCP offering configurations. */ +/** + * The Defender for Databases GCP offering configurations. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") @JsonTypeName("DefenderForDatabasesGcp") @Fluent @@ -24,16 +26,17 @@ public final class DefenderForDatabasesGcpOffering extends CloudOffering { * The native cloud connection configuration */ @JsonProperty(value = "defenderForDatabasesArcAutoProvisioning") - private DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning - defenderForDatabasesArcAutoProvisioning; + private DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning defenderForDatabasesArcAutoProvisioning; - /** Creates an instance of DefenderForDatabasesGcpOffering class. */ + /** + * Creates an instance of DefenderForDatabasesGcpOffering class. + */ public DefenderForDatabasesGcpOffering() { } /** * Get the arcAutoProvisioning property: The ARC autoprovisioning configuration. - * + * * @return the arcAutoProvisioning value. */ public DefenderForDatabasesGcpOfferingArcAutoProvisioning arcAutoProvisioning() { @@ -42,19 +45,19 @@ public DefenderForDatabasesGcpOfferingArcAutoProvisioning 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) { + 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 @@ -64,20 +67,19 @@ public DefenderForDatabasesGcpOffering withArcAutoProvisioning( /** * 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) { + DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning defenderForDatabasesArcAutoProvisioning) { this.defenderForDatabasesArcAutoProvisioning = defenderForDatabasesArcAutoProvisioning; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index a1af1380b1b12..a530e306c0443 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The ARC autoprovisioning configuration. */ +/** + * The ARC autoprovisioning configuration. + */ @Fluent public final class DefenderForDatabasesGcpOfferingArcAutoProvisioning { /* @@ -22,13 +24,15 @@ public final class DefenderForDatabasesGcpOfferingArcAutoProvisioning { @JsonProperty(value = "configuration") private DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration configuration; - /** Creates an instance of DefenderForDatabasesGcpOfferingArcAutoProvisioning class. */ + /** + * Creates an instance of DefenderForDatabasesGcpOfferingArcAutoProvisioning class. + */ public DefenderForDatabasesGcpOfferingArcAutoProvisioning() { } /** * Get the enabled property: Is arc auto provisioning enabled. - * + * * @return the enabled value. */ public Boolean enabled() { @@ -37,7 +41,7 @@ public Boolean enabled() { /** * Set the enabled property: Is arc auto provisioning enabled. - * + * * @param enabled the enabled value to set. * @return the DefenderForDatabasesGcpOfferingArcAutoProvisioning object itself. */ @@ -48,7 +52,7 @@ public DefenderForDatabasesGcpOfferingArcAutoProvisioning withEnabled(Boolean en /** * Get the configuration property: Configuration for servers Arc auto provisioning. - * + * * @return the configuration value. */ public DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration configuration() { @@ -57,19 +61,19 @@ public DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration configura /** * Set the configuration property: Configuration for servers Arc auto provisioning. - * + * * @param configuration the configuration value to set. * @return the DefenderForDatabasesGcpOfferingArcAutoProvisioning object itself. */ - public DefenderForDatabasesGcpOfferingArcAutoProvisioning withConfiguration( - DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration configuration) { + public DefenderForDatabasesGcpOfferingArcAutoProvisioning + withConfiguration(DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration configuration) { this.configuration = configuration; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration.java index e44b9dc662fec..b9ab82a01006c 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Configuration for servers Arc auto provisioning. */ +/** + * Configuration for servers Arc auto provisioning. + */ @Fluent public final class DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration { /* @@ -22,13 +24,15 @@ public final class DefenderForDatabasesGcpOfferingArcAutoProvisioningConfigurati @JsonProperty(value = "privateLinkScope") private String privateLinkScope; - /** Creates an instance of DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration class. */ + /** + * Creates an instance of DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration class. + */ public DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration() { } /** * Get the proxy property: Optional http proxy endpoint to use for the Arc agent. - * + * * @return the proxy value. */ public String proxy() { @@ -37,7 +41,7 @@ public String proxy() { /** * Set the proxy property: Optional http proxy endpoint to use for the Arc agent. - * + * * @param proxy the proxy value to set. * @return the DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration object itself. */ @@ -48,7 +52,7 @@ public DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration withProxy /** * Get the privateLinkScope property: Optional Arc private link scope resource id to link the Arc agent. - * + * * @return the privateLinkScope value. */ public String privateLinkScope() { @@ -57,19 +61,19 @@ public String 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 DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration object itself. */ - public DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration withPrivateLinkScope( - String privateLinkScope) { + public DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration + withPrivateLinkScope(String privateLinkScope) { this.privateLinkScope = privateLinkScope; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 552d3f4dd765a..c5b55c56eb266 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The native cloud connection configuration. */ +/** + * The native cloud connection configuration. + */ @Fluent public final class DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning { /* @@ -22,13 +24,15 @@ public final class DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoPro @JsonProperty(value = "workloadIdentityProviderId") private String workloadIdentityProviderId; - /** Creates an instance of DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning class. */ + /** + * 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() { @@ -37,19 +41,19 @@ public String 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) { + 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() { @@ -58,19 +62,19 @@ public String 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) { + 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() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDevOpsAzureDevOpsOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDevOpsAzureDevOpsOffering.java index 841f547633802..baa72bbb62623 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDevOpsAzureDevOpsOffering.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDevOpsAzureDevOpsOffering.java @@ -8,18 +8,22 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** The Defender for DevOps for Azure DevOps offering. */ +/** + * The Defender for DevOps for Azure DevOps offering. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") @JsonTypeName("DefenderForDevOpsAzureDevOps") @Immutable public final class DefenderForDevOpsAzureDevOpsOffering extends CloudOffering { - /** Creates an instance of DefenderForDevOpsAzureDevOpsOffering class. */ + /** + * Creates an instance of DefenderForDevOpsAzureDevOpsOffering class. + */ public DefenderForDevOpsAzureDevOpsOffering() { } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDevOpsGitLabOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDevOpsGitLabOffering.java index e194b6df990bf..a513bd44073e9 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDevOpsGitLabOffering.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDevOpsGitLabOffering.java @@ -8,18 +8,22 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** The Defender for DevOps for Gitlab offering. */ +/** + * The Defender for DevOps for Gitlab offering. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") @JsonTypeName("DefenderForDevOpsGitLab") @Immutable public final class DefenderForDevOpsGitLabOffering extends CloudOffering { - /** Creates an instance of DefenderForDevOpsGitLabOffering class. */ + /** + * Creates an instance of DefenderForDevOpsGitLabOffering class. + */ public DefenderForDevOpsGitLabOffering() { } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDevOpsGithubOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDevOpsGithubOffering.java index 22df7340c130b..5c3790fd9d915 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDevOpsGithubOffering.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDevOpsGithubOffering.java @@ -8,18 +8,22 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** The Defender for DevOps for Github offering. */ +/** + * The Defender for DevOps for Github offering. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") @JsonTypeName("DefenderForDevOpsGithub") @Immutable public final class DefenderForDevOpsGithubOffering extends CloudOffering { - /** Creates an instance of DefenderForDevOpsGithubOffering class. */ + /** + * Creates an instance of DefenderForDevOpsGithubOffering class. + */ public DefenderForDevOpsGithubOffering() { } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index e261069b5d20c..5006235df374a 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** The Defender for Servers AWS offering. */ +/** + * The Defender for Servers AWS offering. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") @JsonTypeName("DefenderForServersAws") @Fluent @@ -50,13 +52,15 @@ public final class DefenderForServersAwsOffering extends CloudOffering { @JsonProperty(value = "vmScanners") private DefenderForServersAwsOfferingVmScanners vmScanners; - /** Creates an instance of DefenderForServersAwsOffering class. */ + /** + * Creates an instance of DefenderForServersAwsOffering class. + */ public DefenderForServersAwsOffering() { } /** * Get the defenderForServers property: The Defender for servers connection configuration. - * + * * @return the defenderForServers value. */ public DefenderForServersAwsOfferingDefenderForServers defenderForServers() { @@ -65,19 +69,19 @@ public DefenderForServersAwsOfferingDefenderForServers 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) { + 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() { @@ -86,19 +90,19 @@ public DefenderForServersAwsOfferingArcAutoProvisioning 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) { + 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() { @@ -107,19 +111,19 @@ public DefenderForServersAwsOfferingVaAutoProvisioning 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) { + 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() { @@ -128,19 +132,19 @@ public DefenderForServersAwsOfferingMdeAutoProvisioning 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) { + 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() { @@ -149,7 +153,7 @@ public DefenderForServersAwsOfferingSubPlan subPlan() { /** * Set the subPlan property: configuration for the servers offering subPlan. - * + * * @param subPlan the subPlan value to set. * @return the DefenderForServersAwsOffering object itself. */ @@ -160,7 +164,7 @@ public DefenderForServersAwsOffering withSubPlan(DefenderForServersAwsOfferingSu /** * Get the vmScanners property: The Microsoft Defender for Server VM scanning configuration. - * + * * @return the vmScanners value. */ public DefenderForServersAwsOfferingVmScanners vmScanners() { @@ -169,7 +173,7 @@ public DefenderForServersAwsOfferingVmScanners 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. */ @@ -180,7 +184,7 @@ public DefenderForServersAwsOffering withVmScanners(DefenderForServersAwsOfferin /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 0d1ff8f1543e5..b05c9ab0d3866 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The ARC autoprovisioning configuration. */ +/** + * The ARC autoprovisioning configuration. + */ @Fluent public final class DefenderForServersAwsOfferingArcAutoProvisioning { /* @@ -28,13 +30,15 @@ public final class DefenderForServersAwsOfferingArcAutoProvisioning { @JsonProperty(value = "configuration") private DefenderForServersAwsOfferingArcAutoProvisioningConfiguration configuration; - /** Creates an instance of DefenderForServersAwsOfferingArcAutoProvisioning class. */ + /** + * Creates an instance of DefenderForServersAwsOfferingArcAutoProvisioning class. + */ public DefenderForServersAwsOfferingArcAutoProvisioning() { } /** * Get the enabled property: Is arc auto provisioning enabled. - * + * * @return the enabled value. */ public Boolean enabled() { @@ -43,7 +47,7 @@ public Boolean enabled() { /** * Set the enabled property: Is arc auto provisioning enabled. - * + * * @param enabled the enabled value to set. * @return the DefenderForServersAwsOfferingArcAutoProvisioning object itself. */ @@ -54,7 +58,7 @@ public DefenderForServersAwsOfferingArcAutoProvisioning withEnabled(Boolean enab /** * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * + * * @return the cloudRoleArn value. */ public String cloudRoleArn() { @@ -63,7 +67,7 @@ public String cloudRoleArn() { /** * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * + * * @param cloudRoleArn the cloudRoleArn value to set. * @return the DefenderForServersAwsOfferingArcAutoProvisioning object itself. */ @@ -74,7 +78,7 @@ public DefenderForServersAwsOfferingArcAutoProvisioning withCloudRoleArn(String /** * Get the configuration property: Configuration for servers Arc auto provisioning. - * + * * @return the configuration value. */ public DefenderForServersAwsOfferingArcAutoProvisioningConfiguration configuration() { @@ -83,19 +87,19 @@ public DefenderForServersAwsOfferingArcAutoProvisioningConfiguration configurati /** * Set the configuration property: Configuration for servers Arc auto provisioning. - * + * * @param configuration the configuration value to set. * @return the DefenderForServersAwsOfferingArcAutoProvisioning object itself. */ - public DefenderForServersAwsOfferingArcAutoProvisioning withConfiguration( - DefenderForServersAwsOfferingArcAutoProvisioningConfiguration configuration) { + public DefenderForServersAwsOfferingArcAutoProvisioning + withConfiguration(DefenderForServersAwsOfferingArcAutoProvisioningConfiguration configuration) { this.configuration = configuration; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingArcAutoProvisioningConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingArcAutoProvisioningConfiguration.java index 327bf081344c5..6f7d1336ac192 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingArcAutoProvisioningConfiguration.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingArcAutoProvisioningConfiguration.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Configuration for servers Arc auto provisioning. */ +/** + * Configuration for servers Arc auto provisioning. + */ @Fluent public final class DefenderForServersAwsOfferingArcAutoProvisioningConfiguration { /* @@ -22,13 +24,15 @@ public final class DefenderForServersAwsOfferingArcAutoProvisioningConfiguration @JsonProperty(value = "privateLinkScope") private String privateLinkScope; - /** Creates an instance of DefenderForServersAwsOfferingArcAutoProvisioningConfiguration class. */ + /** + * Creates an instance of DefenderForServersAwsOfferingArcAutoProvisioningConfiguration class. + */ public DefenderForServersAwsOfferingArcAutoProvisioningConfiguration() { } /** * Get the proxy property: Optional HTTP proxy endpoint to use for the Arc agent. - * + * * @return the proxy value. */ public String proxy() { @@ -37,7 +41,7 @@ public String proxy() { /** * Set the proxy property: Optional HTTP proxy endpoint to use for the Arc agent. - * + * * @param proxy the proxy value to set. * @return the DefenderForServersAwsOfferingArcAutoProvisioningConfiguration object itself. */ @@ -48,7 +52,7 @@ public DefenderForServersAwsOfferingArcAutoProvisioningConfiguration withProxy(S /** * Get the privateLinkScope property: Optional Arc private link scope resource id to link the Arc agent. - * + * * @return the privateLinkScope value. */ public String privateLinkScope() { @@ -57,7 +61,7 @@ public String 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 DefenderForServersAwsOfferingArcAutoProvisioningConfiguration object itself. */ @@ -68,7 +72,7 @@ public DefenderForServersAwsOfferingArcAutoProvisioningConfiguration withPrivate /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index aa05784fa66b1..98df7fa47fe8b 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The Defender for servers connection configuration. */ +/** + * The Defender for servers connection configuration. + */ @Fluent public final class DefenderForServersAwsOfferingDefenderForServers { /* @@ -16,13 +18,15 @@ public final class DefenderForServersAwsOfferingDefenderForServers { @JsonProperty(value = "cloudRoleArn") private String cloudRoleArn; - /** Creates an instance of DefenderForServersAwsOfferingDefenderForServers class. */ + /** + * 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() { @@ -31,7 +35,7 @@ public String 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. */ @@ -42,7 +46,7 @@ public DefenderForServersAwsOfferingDefenderForServers withCloudRoleArn(String c /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 0bef82c51ccb0..44d32a6f8ef55 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The Microsoft Defender for Endpoint autoprovisioning configuration. */ +/** + * The Microsoft Defender for Endpoint autoprovisioning configuration. + */ @Fluent public final class DefenderForServersAwsOfferingMdeAutoProvisioning { /* @@ -22,13 +24,15 @@ public final class DefenderForServersAwsOfferingMdeAutoProvisioning { @JsonProperty(value = "configuration") private Object configuration; - /** Creates an instance of DefenderForServersAwsOfferingMdeAutoProvisioning class. */ + /** + * 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() { @@ -37,7 +41,7 @@ public Boolean 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. */ @@ -48,7 +52,7 @@ public DefenderForServersAwsOfferingMdeAutoProvisioning withEnabled(Boolean enab /** * Get the configuration property: configuration for Microsoft Defender for Endpoint autoprovisioning. - * + * * @return the configuration value. */ public Object configuration() { @@ -57,7 +61,7 @@ public Object configuration() { /** * Set the configuration property: configuration for Microsoft Defender for Endpoint autoprovisioning. - * + * * @param configuration the configuration value to set. * @return the DefenderForServersAwsOfferingMdeAutoProvisioning object itself. */ @@ -68,7 +72,7 @@ public DefenderForServersAwsOfferingMdeAutoProvisioning withConfiguration(Object /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index b9f80ce25dca0..0c4a52d242267 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** configuration for the servers offering subPlan. */ +/** + * configuration for the servers offering subPlan. + */ @Fluent public final class DefenderForServersAwsOfferingSubPlan { /* @@ -16,13 +18,15 @@ public final class DefenderForServersAwsOfferingSubPlan { @JsonProperty(value = "type") private SubPlan type; - /** Creates an instance of DefenderForServersAwsOfferingSubPlan class. */ + /** + * Creates an instance of DefenderForServersAwsOfferingSubPlan class. + */ public DefenderForServersAwsOfferingSubPlan() { } /** * Get the type property: The available sub plans. - * + * * @return the type value. */ public SubPlan type() { @@ -31,7 +35,7 @@ public SubPlan type() { /** * Set the type property: The available sub plans. - * + * * @param type the type value to set. * @return the DefenderForServersAwsOfferingSubPlan object itself. */ @@ -42,7 +46,7 @@ public DefenderForServersAwsOfferingSubPlan withType(SubPlan type) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index ec83a52f46eba..f0e803a21b440 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The Vulnerability Assessment autoprovisioning configuration. */ +/** + * The Vulnerability Assessment autoprovisioning configuration. + */ @Fluent public final class DefenderForServersAwsOfferingVaAutoProvisioning { /* @@ -22,13 +24,15 @@ public final class DefenderForServersAwsOfferingVaAutoProvisioning { @JsonProperty(value = "configuration") private DefenderForServersAwsOfferingVaAutoProvisioningConfiguration configuration; - /** Creates an instance of DefenderForServersAwsOfferingVaAutoProvisioning class. */ + /** + * 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() { @@ -37,7 +41,7 @@ public Boolean enabled() { /** * Set the enabled property: Is Vulnerability Assessment auto provisioning enabled. - * + * * @param enabled the enabled value to set. * @return the DefenderForServersAwsOfferingVaAutoProvisioning object itself. */ @@ -48,7 +52,7 @@ public DefenderForServersAwsOfferingVaAutoProvisioning withEnabled(Boolean enabl /** * Get the configuration property: configuration for Vulnerability Assessment autoprovisioning. - * + * * @return the configuration value. */ public DefenderForServersAwsOfferingVaAutoProvisioningConfiguration configuration() { @@ -57,19 +61,19 @@ public DefenderForServersAwsOfferingVaAutoProvisioningConfiguration configuratio /** * 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) { + 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() { 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 index 1afa0a454e4cd..4f2d54b3101db 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** configuration for Vulnerability Assessment autoprovisioning. */ +/** + * configuration for Vulnerability Assessment autoprovisioning. + */ @Fluent public final class DefenderForServersAwsOfferingVaAutoProvisioningConfiguration { /* @@ -16,13 +18,15 @@ public final class DefenderForServersAwsOfferingVaAutoProvisioningConfiguration @JsonProperty(value = "type") private Type type; - /** Creates an instance of DefenderForServersAwsOfferingVaAutoProvisioningConfiguration class. */ + /** + * 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() { @@ -31,7 +35,7 @@ public Type 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. */ @@ -42,7 +46,7 @@ public DefenderForServersAwsOfferingVaAutoProvisioningConfiguration withType(Typ /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index bc3612691f4e9..29c7e1e4184d7 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The Microsoft Defender for Server VM scanning configuration. */ +/** + * The Microsoft Defender for Server VM scanning configuration. + */ @Fluent public final class DefenderForServersAwsOfferingVmScanners { /* @@ -22,13 +24,15 @@ public final class DefenderForServersAwsOfferingVmScanners { @JsonProperty(value = "configuration") private DefenderForServersAwsOfferingVmScannersConfiguration configuration; - /** Creates an instance of DefenderForServersAwsOfferingVmScanners class. */ + /** + * Creates an instance of DefenderForServersAwsOfferingVmScanners class. + */ public DefenderForServersAwsOfferingVmScanners() { } /** * Get the enabled property: Is Microsoft Defender for Server VM scanning enabled. - * + * * @return the enabled value. */ public Boolean enabled() { @@ -37,7 +41,7 @@ public Boolean enabled() { /** * Set the enabled property: Is Microsoft Defender for Server VM scanning enabled. - * + * * @param enabled the enabled value to set. * @return the DefenderForServersAwsOfferingVmScanners object itself. */ @@ -48,7 +52,7 @@ public DefenderForServersAwsOfferingVmScanners withEnabled(Boolean enabled) { /** * Get the configuration property: configuration for Microsoft Defender for Server VM scanning. - * + * * @return the configuration value. */ public DefenderForServersAwsOfferingVmScannersConfiguration configuration() { @@ -57,19 +61,19 @@ public DefenderForServersAwsOfferingVmScannersConfiguration configuration() { /** * Set the configuration property: configuration for Microsoft Defender for Server VM scanning. - * + * * @param configuration the configuration value to set. * @return the DefenderForServersAwsOfferingVmScanners object itself. */ - public DefenderForServersAwsOfferingVmScanners withConfiguration( - DefenderForServersAwsOfferingVmScannersConfiguration configuration) { + public DefenderForServersAwsOfferingVmScanners + withConfiguration(DefenderForServersAwsOfferingVmScannersConfiguration configuration) { this.configuration = configuration; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVmScannersConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVmScannersConfiguration.java index 0d8b78178250b..aded5d5c2c083 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVmScannersConfiguration.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVmScannersConfiguration.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** configuration for Microsoft Defender for Server VM scanning. */ +/** + * configuration for Microsoft Defender for Server VM scanning. + */ @Fluent public final class DefenderForServersAwsOfferingVmScannersConfiguration { /* @@ -31,13 +33,15 @@ public final class DefenderForServersAwsOfferingVmScannersConfiguration { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map exclusionTags; - /** Creates an instance of DefenderForServersAwsOfferingVmScannersConfiguration class. */ + /** + * Creates an instance of DefenderForServersAwsOfferingVmScannersConfiguration class. + */ public DefenderForServersAwsOfferingVmScannersConfiguration() { } /** * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * + * * @return the cloudRoleArn value. */ public String cloudRoleArn() { @@ -46,7 +50,7 @@ public String cloudRoleArn() { /** * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * + * * @param cloudRoleArn the cloudRoleArn value to set. * @return the DefenderForServersAwsOfferingVmScannersConfiguration object itself. */ @@ -57,7 +61,7 @@ public DefenderForServersAwsOfferingVmScannersConfiguration withCloudRoleArn(Str /** * Get the scanningMode property: The scanning mode for the VM scan. - * + * * @return the scanningMode value. */ public ScanningMode scanningMode() { @@ -66,7 +70,7 @@ public ScanningMode scanningMode() { /** * Set the scanningMode property: The scanning mode for the VM scan. - * + * * @param scanningMode the scanningMode value to set. * @return the DefenderForServersAwsOfferingVmScannersConfiguration object itself. */ @@ -77,7 +81,7 @@ public DefenderForServersAwsOfferingVmScannersConfiguration withScanningMode(Sca /** * Get the exclusionTags property: VM tags that indicates that VM should not be scanned. - * + * * @return the exclusionTags value. */ public Map exclusionTags() { @@ -86,7 +90,7 @@ public Map exclusionTags() { /** * Set the exclusionTags property: VM tags that indicates that VM should not be scanned. - * + * * @param exclusionTags the exclusionTags value to set. * @return the DefenderForServersAwsOfferingVmScannersConfiguration object itself. */ @@ -97,7 +101,7 @@ public DefenderForServersAwsOfferingVmScannersConfiguration withExclusionTags(Ma /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 336fa465a9c99..1c02333bbcde9 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** The Defender for Servers GCP offering configurations. */ +/** + * The Defender for Servers GCP offering configurations. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") @JsonTypeName("DefenderForServersGcp") @Fluent @@ -50,13 +52,15 @@ public final class DefenderForServersGcpOffering extends CloudOffering { @JsonProperty(value = "vmScanners") private DefenderForServersGcpOfferingVmScanners vmScanners; - /** Creates an instance of DefenderForServersGcpOffering class. */ + /** + * Creates an instance of DefenderForServersGcpOffering class. + */ public DefenderForServersGcpOffering() { } /** * Get the defenderForServers property: The Defender for servers connection configuration. - * + * * @return the defenderForServers value. */ public DefenderForServersGcpOfferingDefenderForServers defenderForServers() { @@ -65,19 +69,19 @@ public DefenderForServersGcpOfferingDefenderForServers 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) { + 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() { @@ -86,19 +90,19 @@ public DefenderForServersGcpOfferingArcAutoProvisioning 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) { + 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() { @@ -107,19 +111,19 @@ public DefenderForServersGcpOfferingVaAutoProvisioning 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) { + 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() { @@ -128,19 +132,19 @@ public DefenderForServersGcpOfferingMdeAutoProvisioning 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) { + 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() { @@ -149,7 +153,7 @@ public DefenderForServersGcpOfferingSubPlan subPlan() { /** * Set the subPlan property: configuration for the servers offering subPlan. - * + * * @param subPlan the subPlan value to set. * @return the DefenderForServersGcpOffering object itself. */ @@ -160,7 +164,7 @@ public DefenderForServersGcpOffering withSubPlan(DefenderForServersGcpOfferingSu /** * Get the vmScanners property: The Microsoft Defender for Server VM scanning configuration. - * + * * @return the vmScanners value. */ public DefenderForServersGcpOfferingVmScanners vmScanners() { @@ -169,7 +173,7 @@ public DefenderForServersGcpOfferingVmScanners 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. */ @@ -180,7 +184,7 @@ public DefenderForServersGcpOffering withVmScanners(DefenderForServersGcpOfferin /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index 62a8766f49c51..0063ee864c6c8 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The ARC autoprovisioning configuration. */ +/** + * The ARC autoprovisioning configuration. + */ @Fluent public final class DefenderForServersGcpOfferingArcAutoProvisioning { /* @@ -22,13 +24,15 @@ public final class DefenderForServersGcpOfferingArcAutoProvisioning { @JsonProperty(value = "configuration") private DefenderForServersGcpOfferingArcAutoProvisioningConfiguration configuration; - /** Creates an instance of DefenderForServersGcpOfferingArcAutoProvisioning class. */ + /** + * Creates an instance of DefenderForServersGcpOfferingArcAutoProvisioning class. + */ public DefenderForServersGcpOfferingArcAutoProvisioning() { } /** * Get the enabled property: Is arc auto provisioning enabled. - * + * * @return the enabled value. */ public Boolean enabled() { @@ -37,7 +41,7 @@ public Boolean enabled() { /** * Set the enabled property: Is arc auto provisioning enabled. - * + * * @param enabled the enabled value to set. * @return the DefenderForServersGcpOfferingArcAutoProvisioning object itself. */ @@ -48,7 +52,7 @@ public DefenderForServersGcpOfferingArcAutoProvisioning withEnabled(Boolean enab /** * Get the configuration property: Configuration for servers Arc auto provisioning. - * + * * @return the configuration value. */ public DefenderForServersGcpOfferingArcAutoProvisioningConfiguration configuration() { @@ -57,19 +61,19 @@ public DefenderForServersGcpOfferingArcAutoProvisioningConfiguration configurati /** * Set the configuration property: Configuration for servers Arc auto provisioning. - * + * * @param configuration the configuration value to set. * @return the DefenderForServersGcpOfferingArcAutoProvisioning object itself. */ - public DefenderForServersGcpOfferingArcAutoProvisioning withConfiguration( - DefenderForServersGcpOfferingArcAutoProvisioningConfiguration configuration) { + public DefenderForServersGcpOfferingArcAutoProvisioning + withConfiguration(DefenderForServersGcpOfferingArcAutoProvisioningConfiguration configuration) { this.configuration = configuration; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingArcAutoProvisioningConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingArcAutoProvisioningConfiguration.java index ff5655dfab0a0..bff15ad5ccf7b 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingArcAutoProvisioningConfiguration.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingArcAutoProvisioningConfiguration.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Configuration for servers Arc auto provisioning. */ +/** + * Configuration for servers Arc auto provisioning. + */ @Fluent public final class DefenderForServersGcpOfferingArcAutoProvisioningConfiguration { /* @@ -22,13 +24,15 @@ public final class DefenderForServersGcpOfferingArcAutoProvisioningConfiguration @JsonProperty(value = "privateLinkScope") private String privateLinkScope; - /** Creates an instance of DefenderForServersGcpOfferingArcAutoProvisioningConfiguration class. */ + /** + * Creates an instance of DefenderForServersGcpOfferingArcAutoProvisioningConfiguration class. + */ public DefenderForServersGcpOfferingArcAutoProvisioningConfiguration() { } /** * Get the proxy property: Optional HTTP proxy endpoint to use for the Arc agent. - * + * * @return the proxy value. */ public String proxy() { @@ -37,7 +41,7 @@ public String proxy() { /** * Set the proxy property: Optional HTTP proxy endpoint to use for the Arc agent. - * + * * @param proxy the proxy value to set. * @return the DefenderForServersGcpOfferingArcAutoProvisioningConfiguration object itself. */ @@ -48,7 +52,7 @@ public DefenderForServersGcpOfferingArcAutoProvisioningConfiguration withProxy(S /** * Get the privateLinkScope property: Optional Arc private link scope resource id to link the Arc agent. - * + * * @return the privateLinkScope value. */ public String privateLinkScope() { @@ -57,7 +61,7 @@ public String 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 DefenderForServersGcpOfferingArcAutoProvisioningConfiguration object itself. */ @@ -68,7 +72,7 @@ public DefenderForServersGcpOfferingArcAutoProvisioningConfiguration withPrivate /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 1533e9171d673..64fd7880fb158 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The Defender for servers connection configuration. */ +/** + * The Defender for servers connection configuration. + */ @Fluent public final class DefenderForServersGcpOfferingDefenderForServers { /* @@ -22,13 +24,15 @@ public final class DefenderForServersGcpOfferingDefenderForServers { @JsonProperty(value = "serviceAccountEmailAddress") private String serviceAccountEmailAddress; - /** Creates an instance of DefenderForServersGcpOfferingDefenderForServers class. */ + /** + * 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() { @@ -37,19 +41,19 @@ public String 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) { + 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() { @@ -58,19 +62,19 @@ public String 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) { + 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() { 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 index 51bb244074163..f99c83dc070ce 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The Microsoft Defender for Endpoint autoprovisioning configuration. */ +/** + * The Microsoft Defender for Endpoint autoprovisioning configuration. + */ @Fluent public final class DefenderForServersGcpOfferingMdeAutoProvisioning { /* @@ -22,13 +24,15 @@ public final class DefenderForServersGcpOfferingMdeAutoProvisioning { @JsonProperty(value = "configuration") private Object configuration; - /** Creates an instance of DefenderForServersGcpOfferingMdeAutoProvisioning class. */ + /** + * 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() { @@ -37,7 +41,7 @@ public Boolean 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. */ @@ -48,7 +52,7 @@ public DefenderForServersGcpOfferingMdeAutoProvisioning withEnabled(Boolean enab /** * Get the configuration property: configuration for Microsoft Defender for Endpoint autoprovisioning. - * + * * @return the configuration value. */ public Object configuration() { @@ -57,7 +61,7 @@ public Object configuration() { /** * Set the configuration property: configuration for Microsoft Defender for Endpoint autoprovisioning. - * + * * @param configuration the configuration value to set. * @return the DefenderForServersGcpOfferingMdeAutoProvisioning object itself. */ @@ -68,7 +72,7 @@ public DefenderForServersGcpOfferingMdeAutoProvisioning withConfiguration(Object /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 22ba934ffb525..805e38440176c 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** configuration for the servers offering subPlan. */ +/** + * configuration for the servers offering subPlan. + */ @Fluent public final class DefenderForServersGcpOfferingSubPlan { /* @@ -16,13 +18,15 @@ public final class DefenderForServersGcpOfferingSubPlan { @JsonProperty(value = "type") private SubPlan type; - /** Creates an instance of DefenderForServersGcpOfferingSubPlan class. */ + /** + * Creates an instance of DefenderForServersGcpOfferingSubPlan class. + */ public DefenderForServersGcpOfferingSubPlan() { } /** * Get the type property: The available sub plans. - * + * * @return the type value. */ public SubPlan type() { @@ -31,7 +35,7 @@ public SubPlan type() { /** * Set the type property: The available sub plans. - * + * * @param type the type value to set. * @return the DefenderForServersGcpOfferingSubPlan object itself. */ @@ -42,7 +46,7 @@ public DefenderForServersGcpOfferingSubPlan withType(SubPlan type) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index f6b41f749fd8c..add710540f995 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The Vulnerability Assessment autoprovisioning configuration. */ +/** + * The Vulnerability Assessment autoprovisioning configuration. + */ @Fluent public final class DefenderForServersGcpOfferingVaAutoProvisioning { /* @@ -22,13 +24,15 @@ public final class DefenderForServersGcpOfferingVaAutoProvisioning { @JsonProperty(value = "configuration") private DefenderForServersGcpOfferingVaAutoProvisioningConfiguration configuration; - /** Creates an instance of DefenderForServersGcpOfferingVaAutoProvisioning class. */ + /** + * 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() { @@ -37,7 +41,7 @@ public Boolean enabled() { /** * Set the enabled property: Is Vulnerability Assessment auto provisioning enabled. - * + * * @param enabled the enabled value to set. * @return the DefenderForServersGcpOfferingVaAutoProvisioning object itself. */ @@ -48,7 +52,7 @@ public DefenderForServersGcpOfferingVaAutoProvisioning withEnabled(Boolean enabl /** * Get the configuration property: configuration for Vulnerability Assessment autoprovisioning. - * + * * @return the configuration value. */ public DefenderForServersGcpOfferingVaAutoProvisioningConfiguration configuration() { @@ -57,19 +61,19 @@ public DefenderForServersGcpOfferingVaAutoProvisioningConfiguration configuratio /** * 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) { + 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() { 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 index 4c51b2de77486..afceeffabd351 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** configuration for Vulnerability Assessment autoprovisioning. */ +/** + * configuration for Vulnerability Assessment autoprovisioning. + */ @Fluent public final class DefenderForServersGcpOfferingVaAutoProvisioningConfiguration { /* @@ -16,13 +18,15 @@ public final class DefenderForServersGcpOfferingVaAutoProvisioningConfiguration @JsonProperty(value = "type") private Type type; - /** Creates an instance of DefenderForServersGcpOfferingVaAutoProvisioningConfiguration class. */ + /** + * 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() { @@ -31,7 +35,7 @@ public Type 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. */ @@ -42,7 +46,7 @@ public DefenderForServersGcpOfferingVaAutoProvisioningConfiguration withType(Typ /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index d530ace03cb64..067d8b5669a22 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The Microsoft Defender for Server VM scanning configuration. */ +/** + * The Microsoft Defender for Server VM scanning configuration. + */ @Fluent public final class DefenderForServersGcpOfferingVmScanners { /* @@ -22,13 +24,15 @@ public final class DefenderForServersGcpOfferingVmScanners { @JsonProperty(value = "configuration") private DefenderForServersGcpOfferingVmScannersConfiguration configuration; - /** Creates an instance of DefenderForServersGcpOfferingVmScanners class. */ + /** + * Creates an instance of DefenderForServersGcpOfferingVmScanners class. + */ public DefenderForServersGcpOfferingVmScanners() { } /** * Get the enabled property: Is Microsoft Defender for Server VM scanning enabled. - * + * * @return the enabled value. */ public Boolean enabled() { @@ -37,7 +41,7 @@ public Boolean enabled() { /** * Set the enabled property: Is Microsoft Defender for Server VM scanning enabled. - * + * * @param enabled the enabled value to set. * @return the DefenderForServersGcpOfferingVmScanners object itself. */ @@ -48,7 +52,7 @@ public DefenderForServersGcpOfferingVmScanners withEnabled(Boolean enabled) { /** * Get the configuration property: configuration for Microsoft Defender for Server VM scanning. - * + * * @return the configuration value. */ public DefenderForServersGcpOfferingVmScannersConfiguration configuration() { @@ -57,19 +61,19 @@ public DefenderForServersGcpOfferingVmScannersConfiguration configuration() { /** * Set the configuration property: configuration for Microsoft Defender for Server VM scanning. - * + * * @param configuration the configuration value to set. * @return the DefenderForServersGcpOfferingVmScanners object itself. */ - public DefenderForServersGcpOfferingVmScanners withConfiguration( - DefenderForServersGcpOfferingVmScannersConfiguration configuration) { + public DefenderForServersGcpOfferingVmScanners + withConfiguration(DefenderForServersGcpOfferingVmScannersConfiguration configuration) { this.configuration = configuration; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVmScannersConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVmScannersConfiguration.java index aedf865b1f868..0dd6d187d6988 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVmScannersConfiguration.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVmScannersConfiguration.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** configuration for Microsoft Defender for Server VM scanning. */ +/** + * configuration for Microsoft Defender for Server VM scanning. + */ @Fluent public final class DefenderForServersGcpOfferingVmScannersConfiguration { /* @@ -25,13 +27,15 @@ public final class DefenderForServersGcpOfferingVmScannersConfiguration { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map exclusionTags; - /** Creates an instance of DefenderForServersGcpOfferingVmScannersConfiguration class. */ + /** + * Creates an instance of DefenderForServersGcpOfferingVmScannersConfiguration class. + */ public DefenderForServersGcpOfferingVmScannersConfiguration() { } /** * Get the scanningMode property: The scanning mode for the VM scan. - * + * * @return the scanningMode value. */ public ScanningMode scanningMode() { @@ -40,7 +44,7 @@ public ScanningMode scanningMode() { /** * Set the scanningMode property: The scanning mode for the VM scan. - * + * * @param scanningMode the scanningMode value to set. * @return the DefenderForServersGcpOfferingVmScannersConfiguration object itself. */ @@ -51,7 +55,7 @@ public DefenderForServersGcpOfferingVmScannersConfiguration withScanningMode(Sca /** * Get the exclusionTags property: VM tags that indicate that VM should not be scanned. - * + * * @return the exclusionTags value. */ public Map exclusionTags() { @@ -60,7 +64,7 @@ public Map exclusionTags() { /** * Set the exclusionTags property: VM tags that indicate that VM should not be scanned. - * + * * @param exclusionTags the exclusionTags value to set. * @return the DefenderForServersGcpOfferingVmScannersConfiguration object itself. */ @@ -71,7 +75,7 @@ public DefenderForServersGcpOfferingVmScannersConfiguration withExclusionTags(Ma /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 new file mode 100644 index 0000000000000..24ec7a8744bc1 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorageSetting.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +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 isEnabled property: Indicates whether Defender for Storage is enabled on this storage account. + * + * @return the isEnabled value. + */ + Boolean isEnabled(); + + /** + * Gets the overrideSubscriptionLevelSettings property: Indicates whether the settings defined for this storage + * account should override the settings defined for the subscription. + * + * @return the overrideSubscriptionLevelSettings value. + */ + Boolean overrideSubscriptionLevelSettings(); + + /** + * Gets the scanResultsEventGridTopicResourceId property: Optional. Resource id of an Event Grid Topic to send scan + * results to. + * + * @return the scanResultsEventGridTopicResourceId value. + */ + String scanResultsEventGridTopicResourceId(); + + /** + * Gets the operationStatus property: Upon failure or partial success. Additional data describing Malware Scanning + * enable/disable operation. + * + * @return the operationStatus value. + */ + OperationStatus operationStatus(); + + /** + * Gets the isEnabledMalwareScanningIsEnabled property: Indicates whether On Upload malware scanning should be + * enabled. + * + * @return the isEnabledMalwareScanningIsEnabled value. + */ + Boolean isEnabledMalwareScanningIsEnabled(); + + /** + * Gets the capGBPerMonth property: Defines the max GB to be scanned per Month. Set to -1 if no capping is needed. + * + * @return the capGBPerMonth value. + */ + Integer capGBPerMonth(); + + /** + * Gets the isEnabledSensitiveDataDiscoveryIsEnabled property: Indicates whether Sensitive Data Discovery should be + * enabled. + * + * @return the isEnabledSensitiveDataDiscoveryIsEnabled value. + */ + Boolean isEnabledSensitiveDataDiscoveryIsEnabled(); + + /** + * Gets the operationStatusSensitiveDataDiscoveryOperationStatus property: Upon failure or partial success. + * Additional data describing Sensitive Data Discovery enable/disable operation. + * + * @return the operationStatusSensitiveDataDiscoveryOperationStatus value. + */ + OperationStatus operationStatusSensitiveDataDiscoveryOperationStatus(); + + /** + * 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 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.WithIsEnabled, DefinitionStages.WithOverrideSubscriptionLevelSettings, + DefinitionStages.WithScanResultsEventGridTopicResourceId, + DefinitionStages.WithIsEnabledMalwareScanningIsEnabled, DefinitionStages.WithCapGBPerMonth, + DefinitionStages.WithIsEnabledSensitiveDataDiscoveryIsEnabled { + /** + * 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 isEnabled. + */ + interface WithIsEnabled { + /** + * Specifies the isEnabled property: Indicates whether Defender for Storage is enabled on this storage + * account.. + * + * @param isEnabled Indicates whether Defender for Storage is enabled on this storage account. + * @return the next definition stage. + */ + WithCreate withIsEnabled(Boolean isEnabled); + } + + /** + * The stage of the DefenderForStorageSetting definition allowing to specify overrideSubscriptionLevelSettings. + */ + interface WithOverrideSubscriptionLevelSettings { + /** + * Specifies the overrideSubscriptionLevelSettings property: Indicates whether the settings defined for this + * storage account should override the settings defined for the subscription.. + * + * @param overrideSubscriptionLevelSettings Indicates whether the settings defined for this storage account + * should override the settings defined for the subscription. + * @return the next definition stage. + */ + WithCreate withOverrideSubscriptionLevelSettings(Boolean overrideSubscriptionLevelSettings); + } + + /** + * The stage of the DefenderForStorageSetting definition allowing to specify + * scanResultsEventGridTopicResourceId. + */ + interface WithScanResultsEventGridTopicResourceId { + /** + * Specifies the scanResultsEventGridTopicResourceId property: Optional. Resource id of an Event Grid Topic + * to send scan results to.. + * + * @param scanResultsEventGridTopicResourceId Optional. Resource id of an Event Grid Topic to send scan + * results to. + * @return the next definition stage. + */ + WithCreate withScanResultsEventGridTopicResourceId(String scanResultsEventGridTopicResourceId); + } + + /** + * The stage of the DefenderForStorageSetting definition allowing to specify isEnabledMalwareScanningIsEnabled. + */ + interface WithIsEnabledMalwareScanningIsEnabled { + /** + * Specifies the isEnabledMalwareScanningIsEnabled property: Indicates whether On Upload malware scanning + * should be enabled.. + * + * @param isEnabledMalwareScanningIsEnabled Indicates whether On Upload malware scanning should be enabled. + * @return the next definition stage. + */ + WithCreate withIsEnabledMalwareScanningIsEnabled(Boolean isEnabledMalwareScanningIsEnabled); + } + + /** + * The stage of the DefenderForStorageSetting definition allowing to specify capGBPerMonth. + */ + interface WithCapGBPerMonth { + /** + * Specifies the capGBPerMonth property: Defines the max GB to be scanned per Month. Set to -1 if no capping + * is needed.. + * + * @param capGBPerMonth Defines the max GB to be scanned per Month. Set to -1 if no capping is needed. + * @return the next definition stage. + */ + WithCreate withCapGBPerMonth(Integer capGBPerMonth); + } + + /** + * The stage of the DefenderForStorageSetting definition allowing to specify + * isEnabledSensitiveDataDiscoveryIsEnabled. + */ + interface WithIsEnabledSensitiveDataDiscoveryIsEnabled { + /** + * Specifies the isEnabledSensitiveDataDiscoveryIsEnabled property: Indicates whether Sensitive Data + * Discovery should be enabled.. + * + * @param isEnabledSensitiveDataDiscoveryIsEnabled Indicates whether Sensitive Data Discovery should be + * enabled. + * @return the next definition stage. + */ + WithCreate withIsEnabledSensitiveDataDiscoveryIsEnabled(Boolean isEnabledSensitiveDataDiscoveryIsEnabled); + } + } + + /** + * 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); +} 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 new file mode 100644 index 0000000000000..4762c3ebfa315 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorages.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +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 identifier of the resource. + * @param settingName 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 identifier of the resource. + * @param settingName 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); + + /** + * 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 index 184d7b23a1f56..85be1995b28fd 100644 --- 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 @@ -11,7 +11,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; -/** A custom alert rule that checks if a value (depends on the custom alert type) is denied. */ +/** + * A custom alert rule that checks if a value (depends on the custom alert type) is denied. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") @JsonTypeName("DenylistCustomAlertRule") @Fluent @@ -22,13 +24,15 @@ public final class DenylistCustomAlertRule extends ListCustomAlertRule { @JsonProperty(value = "denylistValues", required = true) private List denylistValues; - /** Creates an instance of DenylistCustomAlertRule class. */ + /** + * Creates an instance of DenylistCustomAlertRule class. + */ public DenylistCustomAlertRule() { } /** * 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() { @@ -37,7 +41,7 @@ public List 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. */ @@ -46,7 +50,9 @@ public DenylistCustomAlertRule withDenylistValues(List denylistValues) { return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public DenylistCustomAlertRule withIsEnabled(boolean isEnabled) { super.withIsEnabled(isEnabled); @@ -55,17 +61,15 @@ public DenylistCustomAlertRule withIsEnabled(boolean isEnabled) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (denylistValues() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property denylistValues in model DenylistCustomAlertRule")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property denylistValues in model DenylistCustomAlertRule")); } } 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 new file mode 100644 index 0000000000000..4b148f082fd3c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfiguration.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the properties property: DevOps Configuration properties. + * + * @return the properties value. + */ + DevOpsConfigurationProperties properties(); + + /** + * 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/DevOpsConfigurationListResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurationListResponse.java new file mode 100644 index 0000000000000..ac060a5d6efb3 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurationListResponse.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * List of RP resources which supports pagination. + */ +@Fluent +public final class DevOpsConfigurationListResponse { + /* + * Gets or sets list of resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets or sets next link to scroll over the results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Creates an instance of DevOpsConfigurationListResponse class. + */ + public DevOpsConfigurationListResponse() { + } + + /** + * Get the value property: Gets or sets list of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets or sets list of resources. + * + * @param value the value value to set. + * @return the DevOpsConfigurationListResponse object itself. + */ + public DevOpsConfigurationListResponse withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets or sets next link to scroll over the results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets or sets next link to scroll over the results. + * + * @param nextLink the nextLink value to set. + * @return the DevOpsConfigurationListResponse object itself. + */ + public DevOpsConfigurationListResponse withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} 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 new file mode 100644 index 0000000000000..137e8311394d5 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurationProperties.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * DevOps Configuration properties. + */ +@Fluent +public final class DevOpsConfigurationProperties { + /* + * Gets or sets resource status message. + */ + @JsonProperty(value = "provisioningStatusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningStatusMessage; + + /* + * Gets or sets time when resource was last checked. + */ + @JsonProperty(value = "provisioningStatusUpdateTimeUtc", access = JsonProperty.Access.WRITE_ONLY) + 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. + */ + @JsonProperty(value = "provisioningState") + private DevOpsProvisioningState provisioningState; + + /* + * Authorization payload. + */ + @JsonProperty(value = "authorization") + private Authorization authorization; + + /* + * AutoDiscovery states. + */ + @JsonProperty(value = "autoDiscovery") + private AutoDiscovery autoDiscovery; + + /* + * List of top-level inventory to select when AutoDiscovery is disabled. + * This field is ignored when AutoDiscovery is enabled. + */ + @JsonProperty(value = "topLevelInventoryList") + private List topLevelInventoryList; + + /** + * Creates an instance of DevOpsConfigurationProperties class. + */ + public DevOpsConfigurationProperties() { + } + + /** + * Get the provisioningStatusMessage property: Gets or sets resource status message. + * + * @return the provisioningStatusMessage value. + */ + public String provisioningStatusMessage() { + return this.provisioningStatusMessage; + } + + /** + * Get the provisioningStatusUpdateTimeUtc property: Gets or sets 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; + } + + /** + * Set 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. + * + * @param provisioningState the provisioningState value to set. + * @return the DevOpsConfigurationProperties object itself. + */ + public DevOpsConfigurationProperties withProvisioningState(DevOpsProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (authorization() != null) { + authorization().validate(); + } + } +} 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 new file mode 100644 index 0000000000000..b1e34bdf97810 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurations.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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 { + /** + * 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); + + /** + * 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); +} 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 new file mode 100644 index 0000000000000..da45533089d98 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsOperationResults.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 operation result 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 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 operation result 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 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 new file mode 100644 index 0000000000000..cf6fecd3e6096 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsProvisioningState.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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 { + /** + * Static value Succeeded for DevOpsProvisioningState. + */ + public static final DevOpsProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for DevOpsProvisioningState. + */ + public static final DevOpsProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Canceled for DevOpsProvisioningState. + */ + public static final DevOpsProvisioningState CANCELED = fromString("Canceled"); + + /** + * Static value Pending for DevOpsProvisioningState. + */ + public static final DevOpsProvisioningState PENDING = fromString("Pending"); + + /** + * Static value PendingDeletion for DevOpsProvisioningState. + */ + public static final DevOpsProvisioningState PENDING_DELETION = fromString("PendingDeletion"); + + /** + * Static value DeletionSuccess for DevOpsProvisioningState. + */ + public static final DevOpsProvisioningState DELETION_SUCCESS = fromString("DeletionSuccess"); + + /** + * Static value DeletionFailure for DevOpsProvisioningState. + */ + 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. + */ + @JsonCreator + 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 index 8cf36f7d77a0a..246f68a1ad583 100644 --- 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 @@ -8,228 +8,265 @@ import com.azure.resourcemanager.security.fluent.models.DeviceSecurityGroupInner; import java.util.List; -/** An immutable client-side representation of DeviceSecurityGroup. */ +/** + * 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 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. */ + /** + * The entirety of the DeviceSecurityGroup definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { } - /** The DeviceSecurityGroup definition stages. */ + + /** + * The DeviceSecurityGroup definition stages. + */ interface DefinitionStages { - /** The first stage of the DeviceSecurityGroup definition. */ + /** + * The first stage of the DeviceSecurityGroup definition. + */ interface Blank extends WithScope { } - /** The stage of the DeviceSecurityGroup definition allowing to specify parent resource. */ + + /** + * The stage of the DeviceSecurityGroup definition allowing to specify parent resource. + */ interface WithScope { /** * Specifies resourceId. - * + * * @param resourceId The 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 { + 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. */ + + /** + * 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. */ + + /** + * 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. */ + + /** + * 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. */ + + /** + * 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 { + /** + * 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. */ + + /** + * The DeviceSecurityGroup update stages. + */ interface UpdateStages { - /** The stage of the DeviceSecurityGroup update allowing to specify thresholdRules. */ + /** + * 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. */ + + /** + * 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. */ + + /** + * 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. */ + + /** + * 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. */ diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceSecurityGroupList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceSecurityGroupList.java index 037c1991ff6e3..fcb9cf9fd1b24 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceSecurityGroupList.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceSecurityGroupList.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** List of device security groups. */ +/** + * List of device security groups. + */ @Fluent public final class DeviceSecurityGroupList { /* @@ -24,13 +26,15 @@ public final class DeviceSecurityGroupList { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of DeviceSecurityGroupList class. */ + /** + * Creates an instance of DeviceSecurityGroupList class. + */ public DeviceSecurityGroupList() { } /** * Get the value property: List of device security group objects. - * + * * @return the value value. */ public List value() { @@ -39,7 +43,7 @@ public List value() { /** * Set the value property: List of device security group objects. - * + * * @param value the value value to set. * @return the DeviceSecurityGroupList object itself. */ @@ -50,7 +54,7 @@ public DeviceSecurityGroupList withValue(List value) { /** * Get the nextLink property: The URI to fetch the next page. - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +63,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 83cc69b063b73..79f7aa53697dc 100644 --- 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 @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of DeviceSecurityGroups. */ +/** + * Resource collection API of DeviceSecurityGroups. + */ public interface DeviceSecurityGroups { /** * Use this method get the list of device security groups for the specified IoT Hub resource. - * + * * @param resourceId The 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. @@ -23,7 +25,7 @@ public interface DeviceSecurityGroups { /** * Use this method get the list of device security groups for the specified IoT Hub resource. - * + * * @param resourceId The identifier of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -35,10 +37,10 @@ public interface DeviceSecurityGroups { /** * Use this method to get the device security group for the specified IoT Hub resource. - * + * * @param resourceId The 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. + * 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. @@ -49,10 +51,10 @@ public interface DeviceSecurityGroups { /** * Use this method to get the device security group for the specified IoT Hub resource. - * + * * @param resourceId The 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. + * 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. @@ -62,25 +64,25 @@ public interface DeviceSecurityGroups { /** * User this method to deletes the device security group. - * + * * @param resourceId The 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. + * 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); + Response deleteByResourceGroupWithResponse(String resourceId, String deviceSecurityGroupName, + Context context); /** * User this method to deletes the device security group. - * + * * @param resourceId The 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. + * 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. @@ -89,7 +91,7 @@ Response deleteByResourceGroupWithResponse( /** * 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. @@ -100,7 +102,7 @@ Response deleteByResourceGroupWithResponse( /** * 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. @@ -112,7 +114,7 @@ Response deleteByResourceGroupWithResponse( /** * 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. @@ -122,7 +124,7 @@ Response deleteByResourceGroupWithResponse( /** * 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. @@ -134,7 +136,7 @@ Response deleteByResourceGroupWithResponse( /** * Begins definition for a new DeviceSecurityGroup resource. - * + * * @param name resource name. * @return the first stage of the new DeviceSecurityGroup definition. */ diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DirectMethodInvokesNotInAllowedRange.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DirectMethodInvokesNotInAllowedRange.java index 2a932e08c998c..c58b67522e473 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DirectMethodInvokesNotInAllowedRange.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DirectMethodInvokesNotInAllowedRange.java @@ -9,37 +9,49 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.Duration; -/** Number of direct method invokes is not in allowed range. */ +/** + * Number of direct method invokes is not in allowed range. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") @JsonTypeName("DirectMethodInvokesNotInAllowedRange") @Fluent public final class DirectMethodInvokesNotInAllowedRange extends TimeWindowCustomAlertRule { - /** Creates an instance of DirectMethodInvokesNotInAllowedRange class. */ + /** + * Creates an instance of DirectMethodInvokesNotInAllowedRange class. + */ public DirectMethodInvokesNotInAllowedRange() { } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public DirectMethodInvokesNotInAllowedRange withTimeWindowSize(Duration timeWindowSize) { super.withTimeWindowSize(timeWindowSize); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public DirectMethodInvokesNotInAllowedRange withMinThreshold(int minThreshold) { super.withMinThreshold(minThreshold); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public DirectMethodInvokesNotInAllowedRange withMaxThreshold(int maxThreshold) { super.withMaxThreshold(maxThreshold); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public DirectMethodInvokesNotInAllowedRange withIsEnabled(boolean isEnabled) { super.withIsEnabled(isEnabled); @@ -48,7 +60,7 @@ public DirectMethodInvokesNotInAllowedRange withIsEnabled(boolean isEnabled) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Direction.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Direction.java index 9042afdbef2e8..fa058da533dba 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Direction.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Direction.java @@ -8,17 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The rule's direction. */ +/** + * The rule's direction. + */ public final class Direction extends ExpandableStringEnum { - /** Static value Inbound for Direction. */ + /** + * Static value Inbound for Direction. + */ public static final Direction INBOUND = fromString("Inbound"); - /** Static value Outbound for Direction. */ + /** + * Static value Outbound for Direction. + */ public static final Direction OUTBOUND = fromString("Outbound"); /** * Creates a new instance of Direction value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +33,7 @@ public Direction() { /** * Creates or finds a Direction from its string representation. - * + * * @param name a name to look for. * @return the corresponding Direction. */ @@ -38,7 +44,7 @@ public static Direction fromString(String name) { /** * Gets known Direction values. - * + * * @return known Direction values. */ public static Collection values() { 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 index ffb98c4d786db..88a44bda8f142 100644 --- 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 @@ -6,67 +6,69 @@ import com.azure.resourcemanager.security.fluent.models.DiscoveredSecuritySolutionInner; -/** An immutable client-side representation of DiscoveredSecuritySolution. */ +/** + * 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 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/DiscoveredSecuritySolutionList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DiscoveredSecuritySolutionList.java index b20c1a5413ad9..bd6bf1354a239 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DiscoveredSecuritySolutionList.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DiscoveredSecuritySolutionList.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The DiscoveredSecuritySolutionList model. */ +/** + * The DiscoveredSecuritySolutionList model. + */ @Fluent public final class DiscoveredSecuritySolutionList { /* @@ -24,13 +26,15 @@ public final class DiscoveredSecuritySolutionList { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of DiscoveredSecuritySolutionList class. */ + /** + * Creates an instance of DiscoveredSecuritySolutionList class. + */ public DiscoveredSecuritySolutionList() { } /** * Get the value property: The value property. - * + * * @return the value value. */ public List value() { @@ -39,7 +43,7 @@ public List value() { /** * Set the value property: The value property. - * + * * @param value the value value to set. * @return the DiscoveredSecuritySolutionList object itself. */ @@ -50,7 +54,7 @@ public DiscoveredSecuritySolutionList withValue(List 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}. + * @return a list of discovered Security Solutions for the subscription as paginated response with + * {@link PagedIterable}. */ PagedIterable list(Context 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. + * 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}. + * {@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. + * 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}. + * {@link PagedIterable}. */ PagedIterable listByHomeRegion(String ascLocation, Context context); /** * Gets a specific discovered Security Solution. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -73,16 +75,16 @@ public interface DiscoveredSecuritySolutions { * @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); + Response getWithResponse(String resourceGroupName, String ascLocation, + String discoveredSecuritySolutionName, Context context); /** * Gets a specific discovered Security Solution. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EffectiveNetworkSecurityGroups.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EffectiveNetworkSecurityGroups.java index de51e989459e7..d9f78c61a3497 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EffectiveNetworkSecurityGroups.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EffectiveNetworkSecurityGroups.java @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Describes the Network Security Groups effective on a network interface. */ +/** + * Describes the Network Security Groups effective on a network interface. + */ @Fluent public final class EffectiveNetworkSecurityGroups { /* @@ -23,13 +25,15 @@ public final class EffectiveNetworkSecurityGroups { @JsonProperty(value = "networkSecurityGroups") private List networkSecurityGroups; - /** Creates an instance of EffectiveNetworkSecurityGroups class. */ + /** + * Creates an instance of EffectiveNetworkSecurityGroups class. + */ public EffectiveNetworkSecurityGroups() { } /** * Get the networkInterface property: The Azure resource ID of the network interface. - * + * * @return the networkInterface value. */ public String networkInterface() { @@ -38,7 +42,7 @@ public String networkInterface() { /** * Set the networkInterface property: The Azure resource ID of the network interface. - * + * * @param networkInterface the networkInterface value to set. * @return the EffectiveNetworkSecurityGroups object itself. */ @@ -49,7 +53,7 @@ public EffectiveNetworkSecurityGroups withNetworkInterface(String networkInterfa /** * Get the networkSecurityGroups property: The Network Security Groups effective on the network interface. - * + * * @return the networkSecurityGroups value. */ public List networkSecurityGroups() { @@ -58,7 +62,7 @@ public List networkSecurityGroups() { /** * Set the networkSecurityGroups property: The Network Security Groups effective on the network interface. - * + * * @param networkSecurityGroups the networkSecurityGroups value to set. * @return the EffectiveNetworkSecurityGroups object itself. */ @@ -69,7 +73,7 @@ public EffectiveNetworkSecurityGroups withNetworkSecurityGroups(List net /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EndOfSupportStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EndOfSupportStatus.java index ffd0f46c7c4fc..8d83a3237130d 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EndOfSupportStatus.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EndOfSupportStatus.java @@ -8,27 +8,39 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** End of support status. */ +/** + * End of support status. + */ public final class EndOfSupportStatus extends ExpandableStringEnum { - /** Static value None for EndOfSupportStatus. */ + /** + * Static value None for EndOfSupportStatus. + */ public static final EndOfSupportStatus NONE = fromString("None"); - /** Static value noLongerSupported for EndOfSupportStatus. */ + /** + * Static value noLongerSupported for EndOfSupportStatus. + */ public static final EndOfSupportStatus NO_LONGER_SUPPORTED = fromString("noLongerSupported"); - /** Static value versionNoLongerSupported for EndOfSupportStatus. */ + /** + * Static value versionNoLongerSupported for EndOfSupportStatus. + */ public static final EndOfSupportStatus VERSION_NO_LONGER_SUPPORTED = fromString("versionNoLongerSupported"); - /** Static value upcomingNoLongerSupported for EndOfSupportStatus. */ + /** + * Static value upcomingNoLongerSupported for EndOfSupportStatus. + */ public static final EndOfSupportStatus UPCOMING_NO_LONGER_SUPPORTED = fromString("upcomingNoLongerSupported"); - /** Static value upcomingVersionNoLongerSupported for EndOfSupportStatus. */ - public static final EndOfSupportStatus UPCOMING_VERSION_NO_LONGER_SUPPORTED = - fromString("upcomingVersionNoLongerSupported"); + /** + * Static value upcomingVersionNoLongerSupported for EndOfSupportStatus. + */ + public static final EndOfSupportStatus UPCOMING_VERSION_NO_LONGER_SUPPORTED + = fromString("upcomingVersionNoLongerSupported"); /** * Creates a new instance of EndOfSupportStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -37,7 +49,7 @@ public EndOfSupportStatus() { /** * Creates or finds a EndOfSupportStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding EndOfSupportStatus. */ @@ -48,7 +60,7 @@ public static EndOfSupportStatus fromString(String name) { /** * Gets known EndOfSupportStatus values. - * + * * @return known EndOfSupportStatus values. */ public static Collection values() { 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 new file mode 100644 index 0000000000000..491f1e20353f6 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Enforce.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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 { + /** + * Static value False for Enforce. + */ + public static final Enforce FALSE = fromString("False"); + + /** + * Static value True for Enforce. + */ + 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. + */ + @JsonCreator + 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/EnforcementMode.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnforcementMode.java index 6235187ef4705..85e1cdc5ccc4a 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnforcementMode.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnforcementMode.java @@ -8,20 +8,28 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The application control policy enforcement/protection mode of the machine group. */ +/** + * The application control policy enforcement/protection mode of the machine group. + */ public final class EnforcementMode extends ExpandableStringEnum { - /** Static value Audit for EnforcementMode. */ + /** + * Static value Audit for EnforcementMode. + */ public static final EnforcementMode AUDIT = fromString("Audit"); - /** Static value Enforce for EnforcementMode. */ + /** + * Static value Enforce for EnforcementMode. + */ public static final EnforcementMode ENFORCE = fromString("Enforce"); - /** Static value None for EnforcementMode. */ + /** + * Static value None for EnforcementMode. + */ public static final EnforcementMode NONE = fromString("None"); /** * Creates a new instance of EnforcementMode value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,7 +38,7 @@ public EnforcementMode() { /** * Creates or finds a EnforcementMode from its string representation. - * + * * @param name a name to look for. * @return the corresponding EnforcementMode. */ @@ -41,7 +49,7 @@ public static EnforcementMode fromString(String name) { /** * Gets known EnforcementMode values. - * + * * @return known EnforcementMode values. */ public static Collection values() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnforcementSupport.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnforcementSupport.java index 89f498dd851a8..42bd2ade16c91 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnforcementSupport.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnforcementSupport.java @@ -8,20 +8,28 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The machine supportability of Enforce feature. */ +/** + * The machine supportability of Enforce feature. + */ public final class EnforcementSupport extends ExpandableStringEnum { - /** Static value Supported for EnforcementSupport. */ + /** + * Static value Supported for EnforcementSupport. + */ public static final EnforcementSupport SUPPORTED = fromString("Supported"); - /** Static value NotSupported for EnforcementSupport. */ + /** + * Static value NotSupported for EnforcementSupport. + */ public static final EnforcementSupport NOT_SUPPORTED = fromString("NotSupported"); - /** Static value Unknown for EnforcementSupport. */ + /** + * Static value Unknown for EnforcementSupport. + */ public static final EnforcementSupport UNKNOWN = fromString("Unknown"); /** * Creates a new instance of EnforcementSupport value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,7 +38,7 @@ public EnforcementSupport() { /** * Creates or finds a EnforcementSupport from its string representation. - * + * * @param name a name to look for. * @return the corresponding EnforcementSupport. */ @@ -41,7 +49,7 @@ public static EnforcementSupport fromString(String name) { /** * Gets known EnforcementSupport values. - * + * * @return known EnforcementSupport values. */ public static Collection values() { 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 index 105f62c59a09e..02b1a6a87a3ba 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** The security connector environment data. */ +/** + * The security connector environment data. + */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, @@ -21,17 +23,18 @@ @JsonSubTypes.Type(name = "GcpProject", value = GcpProjectEnvironmentData.class), @JsonSubTypes.Type(name = "GithubScope", value = GithubScopeEnvironmentData.class), @JsonSubTypes.Type(name = "AzureDevOpsScope", value = AzureDevOpsScopeEnvironmentData.class), - @JsonSubTypes.Type(name = "GitlabScope", value = GitlabScopeEnvironmentData.class) -}) + @JsonSubTypes.Type(name = "GitlabScope", value = GitlabScopeEnvironmentData.class) }) @Immutable public class EnvironmentData { - /** Creates an instance of EnvironmentData class. */ + /** + * Creates an instance of EnvironmentData class. + */ public EnvironmentData() { } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 4bc4556cbae7e..2b66a9a895d51 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The environment details of the resource. */ +/** + * The environment details of the resource. + */ @Fluent public final class EnvironmentDetails { /* @@ -42,14 +44,16 @@ public final class EnvironmentDetails { @JsonProperty(value = "tenantId") private String tenantId; - /** Creates an instance of EnvironmentDetails class. */ + /** + * Creates an instance of EnvironmentDetails class. + */ public 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). - * + * 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() { @@ -57,9 +61,9 @@ public String nativeResourceId() { } /** - * Set 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). - * + * Set 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). + * * @param nativeResourceId the nativeResourceId value to set. * @return the EnvironmentDetails object itself. */ @@ -71,7 +75,7 @@ public EnvironmentDetails withNativeResourceId(String 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() { @@ -81,7 +85,7 @@ public String environmentHierarchyId() { /** * Set the environmentHierarchyId property: The hierarchy id of the connector (in case of Azure - the subscription * Id, in case of MC - the hierarchyId id). - * + * * @param environmentHierarchyId the environmentHierarchyId value to set. * @return the EnvironmentDetails object itself. */ @@ -93,7 +97,7 @@ public EnvironmentDetails withEnvironmentHierarchyId(String environmentHierarchy /** * 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() { @@ -103,7 +107,7 @@ public String organizationalHierarchyId() { /** * Set 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). - * + * * @param organizationalHierarchyId the organizationalHierarchyId value to set. * @return the EnvironmentDetails object itself. */ @@ -114,7 +118,7 @@ public EnvironmentDetails withOrganizationalHierarchyId(String organizationalHie /** * Get the subscriptionId property: The subscription Id. - * + * * @return the subscriptionId value. */ public String subscriptionId() { @@ -123,7 +127,7 @@ public String subscriptionId() { /** * Set the subscriptionId property: The subscription Id. - * + * * @param subscriptionId the subscriptionId value to set. * @return the EnvironmentDetails object itself. */ @@ -134,7 +138,7 @@ public EnvironmentDetails withSubscriptionId(String subscriptionId) { /** * Get the tenantId property: The tenant Id. - * + * * @return the tenantId value. */ public String tenantId() { @@ -143,7 +147,7 @@ public String tenantId() { /** * Set the tenantId property: The tenant Id. - * + * * @param tenantId the tenantId value to set. * @return the EnvironmentDetails object itself. */ @@ -154,7 +158,7 @@ public EnvironmentDetails withTenantId(String tenantId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index c70a011dfa98d..406dc205abf54 100644 --- 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 @@ -8,26 +8,38 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The type of the environment data. */ +/** + * The type of the environment data. + */ public final class EnvironmentType extends ExpandableStringEnum { - /** Static value AwsAccount for EnvironmentType. */ + /** + * Static value AwsAccount for EnvironmentType. + */ public static final EnvironmentType AWS_ACCOUNT = fromString("AwsAccount"); - /** Static value GcpProject for EnvironmentType. */ + /** + * Static value GcpProject for EnvironmentType. + */ public static final EnvironmentType GCP_PROJECT = fromString("GcpProject"); - /** Static value GithubScope for EnvironmentType. */ + /** + * Static value GithubScope for EnvironmentType. + */ public static final EnvironmentType GITHUB_SCOPE = fromString("GithubScope"); - /** Static value AzureDevOpsScope for EnvironmentType. */ + /** + * Static value AzureDevOpsScope for EnvironmentType. + */ public static final EnvironmentType AZURE_DEV_OPS_SCOPE = fromString("AzureDevOpsScope"); - /** Static value GitlabScope for EnvironmentType. */ + /** + * Static value GitlabScope for EnvironmentType. + */ public static final EnvironmentType GITLAB_SCOPE = fromString("GitlabScope"); /** * Creates a new instance of EnvironmentType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -36,7 +48,7 @@ public EnvironmentType() { /** * Creates or finds a EnvironmentType from its string representation. - * + * * @param name a name to look for. * @return the corresponding EnvironmentType. */ @@ -47,7 +59,7 @@ public static EnvironmentType fromString(String name) { /** * Gets known EnvironmentType values. - * + * * @return known EnvironmentType values. */ public static Collection values() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Etag.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Etag.java index 0e0178c4057fc..bf6efadba6151 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Etag.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Etag.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Entity tag is used for comparing two or more entities from the same requested resource. */ +/** + * Entity tag is used for comparing two or more entities from the same requested resource. + */ @Fluent public class Etag { /* @@ -16,13 +18,15 @@ public class Etag { @JsonProperty(value = "etag") private String etag; - /** Creates an instance of Etag class. */ + /** + * Creates an instance of Etag class. + */ public Etag() { } /** * 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() { @@ -31,7 +35,7 @@ public String 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 Etag object itself. */ @@ -42,7 +46,7 @@ public Etag withEtag(String etag) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 39678faa99075..ac6777138c5ec 100644 --- 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 @@ -8,45 +8,79 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** A valid event source type. */ +/** + * A valid event source type. + */ public final class EventSource extends ExpandableStringEnum { - /** Static value Assessments for EventSource. */ + /** + * Static value Assessments for EventSource. + */ public static final EventSource ASSESSMENTS = fromString("Assessments"); - /** Static value AssessmentsSnapshot for EventSource. */ + /** + * Static value AssessmentsSnapshot for EventSource. + */ public static final EventSource ASSESSMENTS_SNAPSHOT = fromString("AssessmentsSnapshot"); - /** Static value SubAssessments for EventSource. */ + /** + * Static value SubAssessments for EventSource. + */ public static final EventSource SUB_ASSESSMENTS = fromString("SubAssessments"); - /** Static value SubAssessmentsSnapshot for EventSource. */ + /** + * Static value SubAssessmentsSnapshot for EventSource. + */ public static final EventSource SUB_ASSESSMENTS_SNAPSHOT = fromString("SubAssessmentsSnapshot"); - /** Static value Alerts for EventSource. */ + /** + * Static value Alerts for EventSource. + */ public static final EventSource ALERTS = fromString("Alerts"); - /** Static value SecureScores for EventSource. */ + /** + * Static value SecureScores for EventSource. + */ public static final EventSource SECURE_SCORES = fromString("SecureScores"); - /** Static value SecureScoresSnapshot for EventSource. */ + /** + * Static value SecureScoresSnapshot for EventSource. + */ public static final EventSource SECURE_SCORES_SNAPSHOT = fromString("SecureScoresSnapshot"); - /** Static value SecureScoreControls for EventSource. */ + /** + * Static value SecureScoreControls for EventSource. + */ public static final EventSource SECURE_SCORE_CONTROLS = fromString("SecureScoreControls"); - /** Static value SecureScoreControlsSnapshot for EventSource. */ + /** + * Static value SecureScoreControlsSnapshot for EventSource. + */ public static final EventSource SECURE_SCORE_CONTROLS_SNAPSHOT = fromString("SecureScoreControlsSnapshot"); - /** Static value RegulatoryComplianceAssessment for EventSource. */ + /** + * Static value RegulatoryComplianceAssessment for EventSource. + */ public static final EventSource REGULATORY_COMPLIANCE_ASSESSMENT = fromString("RegulatoryComplianceAssessment"); - /** Static value RegulatoryComplianceAssessmentSnapshot for EventSource. */ - public static final EventSource REGULATORY_COMPLIANCE_ASSESSMENT_SNAPSHOT = - fromString("RegulatoryComplianceAssessmentSnapshot"); + /** + * Static value RegulatoryComplianceAssessmentSnapshot for EventSource. + */ + public static final EventSource REGULATORY_COMPLIANCE_ASSESSMENT_SNAPSHOT + = fromString("RegulatoryComplianceAssessmentSnapshot"); + + /** + * Static value AttackPaths for EventSource. + */ + public static final EventSource ATTACK_PATHS = fromString("AttackPaths"); + + /** + * Static value AttackPathsSnapshot for EventSource. + */ + 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 @@ -55,7 +89,7 @@ public EventSource() { /** * Creates or finds a EventSource from its string representation. - * + * * @param name a name to look for. * @return the corresponding EventSource. */ @@ -66,7 +100,7 @@ public static EventSource fromString(String name) { /** * Gets known EventSource values. - * + * * @return known EventSource values. */ public static Collection values() { 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 index 985f61f947582..3d62749f52d4f 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Governance rule execution parameters. */ +/** + * Governance rule execution parameters. + */ @Fluent public final class ExecuteGovernanceRuleParams { /* @@ -16,13 +18,15 @@ public final class ExecuteGovernanceRuleParams { @JsonProperty(value = "override") private Boolean override; - /** Creates an instance of ExecuteGovernanceRuleParams class. */ + /** + * 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() { @@ -31,7 +35,7 @@ public Boolean override() { /** * Set the override property: Describe if governance rule should be override. - * + * * @param override the override value to set. * @return the ExecuteGovernanceRuleParams object itself. */ @@ -42,7 +46,7 @@ public ExecuteGovernanceRuleParams withOverride(Boolean override) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 05be0c5ea44ff..346c4c40f240d 100644 --- 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 @@ -8,14 +8,18 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ExpandControlsEnum. */ +/** + * Defines values for ExpandControlsEnum. + */ public final class ExpandControlsEnum extends ExpandableStringEnum { - /** Static value definition for ExpandControlsEnum. */ + /** + * Static value definition for ExpandControlsEnum. + */ public static final ExpandControlsEnum DEFINITION = fromString("definition"); /** * Creates a new instance of ExpandControlsEnum value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -24,7 +28,7 @@ public ExpandControlsEnum() { /** * Creates or finds a ExpandControlsEnum from its string representation. - * + * * @param name a name to look for. * @return the corresponding ExpandControlsEnum. */ @@ -35,7 +39,7 @@ public static ExpandControlsEnum fromString(String name) { /** * Gets known ExpandControlsEnum values. - * + * * @return known ExpandControlsEnum values. */ public static Collection values() { 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 index 2a5584e0fb553..e47ff3a294e62 100644 --- 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 @@ -8,17 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ExpandEnum. */ +/** + * Defines values for ExpandEnum. + */ public final class ExpandEnum extends ExpandableStringEnum { - /** Static value links for ExpandEnum. */ + /** + * Static value links for ExpandEnum. + */ public static final ExpandEnum LINKS = fromString("links"); - /** Static value metadata for ExpandEnum. */ + /** + * Static value metadata for ExpandEnum. + */ public static final ExpandEnum METADATA = fromString("metadata"); /** * Creates a new instance of ExpandEnum value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +33,7 @@ public ExpandEnum() { /** * Creates or finds a ExpandEnum from its string representation. - * + * * @param name a name to look for. * @return the corresponding ExpandEnum. */ @@ -38,7 +44,7 @@ public static ExpandEnum fromString(String name) { /** * Gets known ExpandEnum values. - * + * * @return known ExpandEnum values. */ public static Collection values() { 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 index d24f2e1271f8d..b44944af9beff 100644 --- 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 @@ -8,14 +8,18 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ExportData. */ +/** + * Defines values for ExportData. + */ public final class ExportData extends ExpandableStringEnum { - /** Static value RawEvents for ExportData. */ + /** + * Static value RawEvents for ExportData. + */ public static final ExportData RAW_EVENTS = fromString("RawEvents"); /** * Creates a new instance of ExportData value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -24,7 +28,7 @@ public ExportData() { /** * Creates or finds a ExportData from its string representation. - * + * * @param name a name to look for. * @return the corresponding ExportData. */ @@ -35,7 +39,7 @@ public static ExportData fromString(String name) { /** * Gets known ExportData values. - * + * * @return known ExportData values. */ public static Collection values() { 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 index 08661bf274768..0e35dfc2e31c5 100644 --- 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 @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** A plan's extension properties. */ +/** + * A plan's extension properties. + */ @Fluent public final class Extension { /* @@ -48,9 +50,11 @@ public final class Extension { * Optional. A status describing the success/failure of the extension's enablement/disablement operation. */ @JsonProperty(value = "operationStatus", access = JsonProperty.Access.WRITE_ONLY) - private OperationStatus operationStatus; + private OperationStatusAutoGenerated operationStatus; - /** Creates an instance of Extension class. */ + /** + * Creates an instance of Extension class. + */ public Extension() { } @@ -58,16 +62,18 @@ public Extension() { * Get the name property: The extension name. Supported values are: * <br><br>**AgentlessDiscoveryForKubernetes** - API-based discovery of information about Kubernetes * cluster architecture, workload objects, and setup. Required for Kubernetes inventory, identity and network - * exposure detection, attack path analysis and risk hunting as part of the cloud security explorer. Available for - * CloudPosture 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. Available for StorageAccounts - * plan.<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. Available for StorageAccounts and CloudPosture - * plans.<br><br>**ContainerRegistriesVulnerabilityAssessments** - Provides vulnerability management for - * images stored in your container registries. Available for CloudPosture and Containers plans. - * + * exposure detection, attack path analysis and risk hunting as part of the cloud security explorer. + * Available for CloudPosture 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. + * Available for StorageAccounts plan.<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. + * Available for StorageAccounts and CloudPosture + * plans.<br><br>**ContainerRegistriesVulnerabilityAssessments** - Provides vulnerability management + * for images stored in your container registries. + * Available for CloudPosture and Containers plans. + * * @return the name value. */ public String name() { @@ -78,16 +84,18 @@ public String name() { * Set the name property: The extension name. Supported values are: * <br><br>**AgentlessDiscoveryForKubernetes** - API-based discovery of information about Kubernetes * cluster architecture, workload objects, and setup. Required for Kubernetes inventory, identity and network - * exposure detection, attack path analysis and risk hunting as part of the cloud security explorer. Available for - * CloudPosture 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. Available for StorageAccounts - * plan.<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. Available for StorageAccounts and CloudPosture - * plans.<br><br>**ContainerRegistriesVulnerabilityAssessments** - Provides vulnerability management for - * images stored in your container registries. Available for CloudPosture and Containers plans. - * + * exposure detection, attack path analysis and risk hunting as part of the cloud security explorer. + * Available for CloudPosture 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. + * Available for StorageAccounts plan.<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. + * Available for StorageAccounts and CloudPosture + * plans.<br><br>**ContainerRegistriesVulnerabilityAssessments** - Provides vulnerability management + * for images stored in your container registries. + * Available for CloudPosture and Containers plans. + * * @param name the name value to set. * @return the Extension object itself. */ @@ -98,7 +106,7 @@ public Extension withName(String name) { /** * Get the isEnabled property: Indicates whether the extension is enabled. - * + * * @return the isEnabled value. */ public IsEnabled isEnabled() { @@ -107,7 +115,7 @@ public IsEnabled isEnabled() { /** * Set the isEnabled property: Indicates whether the extension is enabled. - * + * * @param isEnabled the isEnabled value to set. * @return the Extension object itself. */ @@ -118,7 +126,7 @@ public Extension withIsEnabled(IsEnabled isEnabled) { /** * Get the additionalExtensionProperties property: Property values associated with the extension. - * + * * @return the additionalExtensionProperties value. */ public Map additionalExtensionProperties() { @@ -127,7 +135,7 @@ public Map additionalExtensionProperties() { /** * Set the additionalExtensionProperties property: Property values associated with the extension. - * + * * @param additionalExtensionProperties the additionalExtensionProperties value to set. * @return the Extension object itself. */ @@ -139,16 +147,16 @@ public Extension withAdditionalExtensionProperties(Map additiona /** * 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() { + public OperationStatusAutoGenerated operationStatus() { return this.operationStatus; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -157,9 +165,8 @@ public void validate() { .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Extension")); } if (isEnabled() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property isEnabled in model Extension")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property isEnabled in model Extension")); } if (operationStatus() != null) { operationStatus().validate(); 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 index 59722076e72b4..87dfa11c82686 100644 --- 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 @@ -6,39 +6,41 @@ import com.azure.resourcemanager.security.fluent.models.ExternalSecuritySolutionInner; -/** An immutable client-side representation of ExternalSecuritySolution. */ +/** + * 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 location property: Location where the resource is stored. - * + * * @return the location value. */ String location(); /** * 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 index cbbc0b7acb37c..974e187fc666b 100644 --- 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 @@ -8,20 +8,28 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The kind of the external solution. */ +/** + * The kind of the external solution. + */ public final class ExternalSecuritySolutionKind extends ExpandableStringEnum { - /** Static value CEF for ExternalSecuritySolutionKind. */ + /** + * Static value CEF for ExternalSecuritySolutionKind. + */ public static final ExternalSecuritySolutionKind CEF = fromString("CEF"); - /** Static value ATA for ExternalSecuritySolutionKind. */ + /** + * Static value ATA for ExternalSecuritySolutionKind. + */ public static final ExternalSecuritySolutionKind ATA = fromString("ATA"); - /** Static value AAD for ExternalSecuritySolutionKind. */ + /** + * Static value AAD for ExternalSecuritySolutionKind. + */ public static final ExternalSecuritySolutionKind AAD = fromString("AAD"); /** * Creates a new instance of ExternalSecuritySolutionKind value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,7 +38,7 @@ public ExternalSecuritySolutionKind() { /** * Creates or finds a ExternalSecuritySolutionKind from its string representation. - * + * * @param name a name to look for. * @return the corresponding ExternalSecuritySolutionKind. */ @@ -41,7 +49,7 @@ public static ExternalSecuritySolutionKind fromString(String name) { /** * Gets known ExternalSecuritySolutionKind values. - * + * * @return known ExternalSecuritySolutionKind values. */ public static Collection values() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionList.java index 8afc46f34ad08..0a2ddc31fdc7f 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionList.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionList.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The ExternalSecuritySolutionList model. */ +/** + * The ExternalSecuritySolutionList model. + */ @Fluent public final class ExternalSecuritySolutionList { /* @@ -24,13 +26,15 @@ public final class ExternalSecuritySolutionList { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of ExternalSecuritySolutionList class. */ + /** + * Creates an instance of ExternalSecuritySolutionList class. + */ public ExternalSecuritySolutionList() { } /** * Get the value property: The value property. - * + * * @return the value value. */ public List value() { @@ -39,7 +43,7 @@ public List value() { /** * Set the value property: The value property. - * + * * @param value the value value to set. * @return the ExternalSecuritySolutionList object itself. */ @@ -50,7 +54,7 @@ public ExternalSecuritySolutionList withValue(List additionalProperties; + @JsonIgnore + private Map additionalProperties; - /** Creates an instance of ExternalSecuritySolutionProperties class. */ + /** + * Creates an instance of ExternalSecuritySolutionProperties class. + */ public ExternalSecuritySolutionProperties() { } /** * Get the deviceVendor property: The deviceVendor property. - * + * * @return the deviceVendor value. */ public String deviceVendor() { @@ -53,7 +58,7 @@ public String deviceVendor() { /** * Set the deviceVendor property: The deviceVendor property. - * + * * @param deviceVendor the deviceVendor value to set. * @return the ExternalSecuritySolutionProperties object itself. */ @@ -64,7 +69,7 @@ public ExternalSecuritySolutionProperties withDeviceVendor(String deviceVendor) /** * Get the deviceType property: The deviceType property. - * + * * @return the deviceType value. */ public String deviceType() { @@ -73,7 +78,7 @@ public String deviceType() { /** * Set the deviceType property: The deviceType property. - * + * * @param deviceType the deviceType value to set. * @return the ExternalSecuritySolutionProperties object itself. */ @@ -84,7 +89,7 @@ public ExternalSecuritySolutionProperties withDeviceType(String deviceType) { /** * Get the workspace property: Represents an OMS workspace to which the solution is connected. - * + * * @return the workspace value. */ public ConnectedWorkspace workspace() { @@ -93,7 +98,7 @@ public ConnectedWorkspace 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. */ @@ -104,7 +109,7 @@ public ExternalSecuritySolutionProperties withWorkspace(ConnectedWorkspace works /** * Get the additionalProperties property: The solution properties (correspond to the solution kind). - * + * * @return the additionalProperties value. */ @JsonAnyGetter @@ -114,7 +119,7 @@ public Map 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. */ @@ -133,7 +138,7 @@ void withAdditionalProperties(String key, Object value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 60dc430b9b7fb..5eb50a8611f43 100644 --- 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 @@ -8,64 +8,66 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of ExternalSecuritySolutions. */ +/** + * Resource collection API of ExternalSecuritySolutions. + */ public interface ExternalSecuritySolutions { /** * 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}. + * @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}. + * @return a list of external security solutions for the subscription as paginated response with + * {@link PagedIterable}. */ PagedIterable list(Context 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. + * 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}. + * @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. + * 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}. + * @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 specific external Security Solution. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. @@ -73,16 +75,16 @@ public interface ExternalSecuritySolutions { * @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); + Response getWithResponse(String resourceGroupName, String ascLocation, + String externalSecuritySolutionsName, Context context); /** * Gets a specific external Security Solution. - * + * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. + * insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. + * 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. diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/FailedLocalLoginsNotInAllowedRange.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/FailedLocalLoginsNotInAllowedRange.java index 47e4200079025..9e9243734c011 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/FailedLocalLoginsNotInAllowedRange.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/FailedLocalLoginsNotInAllowedRange.java @@ -9,37 +9,49 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.Duration; -/** Number of failed local logins is not in allowed range. */ +/** + * Number of failed local logins is not in allowed range. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") @JsonTypeName("FailedLocalLoginsNotInAllowedRange") @Fluent public final class FailedLocalLoginsNotInAllowedRange extends TimeWindowCustomAlertRule { - /** Creates an instance of FailedLocalLoginsNotInAllowedRange class. */ + /** + * Creates an instance of FailedLocalLoginsNotInAllowedRange class. + */ public FailedLocalLoginsNotInAllowedRange() { } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public FailedLocalLoginsNotInAllowedRange withTimeWindowSize(Duration timeWindowSize) { super.withTimeWindowSize(timeWindowSize); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public FailedLocalLoginsNotInAllowedRange withMinThreshold(int minThreshold) { super.withMinThreshold(minThreshold); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public FailedLocalLoginsNotInAllowedRange withMaxThreshold(int maxThreshold) { super.withMaxThreshold(maxThreshold); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public FailedLocalLoginsNotInAllowedRange withIsEnabled(boolean isEnabled) { super.withIsEnabled(isEnabled); @@ -48,7 +60,7 @@ public FailedLocalLoginsNotInAllowedRange withIsEnabled(boolean isEnabled) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/FileType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/FileType.java index f6830ab5e8042..3873d1fd88c48 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/FileType.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/FileType.java @@ -8,29 +8,43 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The type of the file (for Linux files - Executable is used). */ +/** + * The type of the file (for Linux files - Executable is used). + */ public final class FileType extends ExpandableStringEnum { - /** Static value Exe for FileType. */ + /** + * Static value Exe for FileType. + */ public static final FileType EXE = fromString("Exe"); - /** Static value Dll for FileType. */ + /** + * Static value Dll for FileType. + */ public static final FileType DLL = fromString("Dll"); - /** Static value Msi for FileType. */ + /** + * Static value Msi for FileType. + */ public static final FileType MSI = fromString("Msi"); - /** Static value Script for FileType. */ + /** + * Static value Script for FileType. + */ public static final FileType SCRIPT = fromString("Script"); - /** Static value Executable for FileType. */ + /** + * Static value Executable for FileType. + */ public static final FileType EXECUTABLE = fromString("Executable"); - /** Static value Unknown for FileType. */ + /** + * Static value Unknown for FileType. + */ public static final FileType UNKNOWN = fromString("Unknown"); /** * Creates a new instance of FileType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -39,7 +53,7 @@ public FileType() { /** * Creates or finds a FileType from its string representation. - * + * * @param name a name to look for. * @return the corresponding FileType. */ @@ -50,7 +64,7 @@ public static FileType fromString(String name) { /** * Gets known FileType values. - * + * * @return known FileType values. */ public static Collection values() { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/FileUploadsNotInAllowedRange.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/FileUploadsNotInAllowedRange.java index 69f8cf762e203..df16679e6723d 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/FileUploadsNotInAllowedRange.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/FileUploadsNotInAllowedRange.java @@ -9,37 +9,49 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import java.time.Duration; -/** Number of file uploads is not in allowed range. */ +/** + * Number of file uploads is not in allowed range. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") @JsonTypeName("FileUploadsNotInAllowedRange") @Fluent public final class FileUploadsNotInAllowedRange extends TimeWindowCustomAlertRule { - /** Creates an instance of FileUploadsNotInAllowedRange class. */ + /** + * Creates an instance of FileUploadsNotInAllowedRange class. + */ public FileUploadsNotInAllowedRange() { } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public FileUploadsNotInAllowedRange withTimeWindowSize(Duration timeWindowSize) { super.withTimeWindowSize(timeWindowSize); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public FileUploadsNotInAllowedRange withMinThreshold(int minThreshold) { super.withMinThreshold(minThreshold); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public FileUploadsNotInAllowedRange withMaxThreshold(int maxThreshold) { super.withMaxThreshold(maxThreshold); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public FileUploadsNotInAllowedRange withIsEnabled(boolean isEnabled) { super.withIsEnabled(isEnabled); @@ -48,7 +60,7 @@ public FileUploadsNotInAllowedRange withIsEnabled(boolean isEnabled) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpCredentialsDetailsProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpCredentialsDetailsProperties.java index ee933d133b168..d49551c2b70e3 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpCredentialsDetailsProperties.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpCredentialsDetailsProperties.java @@ -11,8 +11,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; /** - * GCP cloud account connector based service to service credentials, the credentials are composed of the organization ID - * and a JSON API key (write only). + * GCP cloud account connector based service to service credentials, the credentials are composed of the organization + * ID and a JSON API key (write only). */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authenticationType") @JsonTypeName("gcpCredentials") @@ -84,13 +84,15 @@ public final class GcpCredentialsDetailsProperties extends AuthenticationDetails @JsonProperty(value = "clientX509CertUrl", required = true) private String clientX509CertUrl; - /** Creates an instance of GcpCredentialsDetailsProperties class. */ + /** + * Creates an instance of GcpCredentialsDetailsProperties class. + */ public GcpCredentialsDetailsProperties() { } /** * Get the organizationId property: The organization ID of the GCP cloud account. - * + * * @return the organizationId value. */ public String organizationId() { @@ -99,7 +101,7 @@ public String organizationId() { /** * Set the organizationId property: The organization ID of the GCP cloud account. - * + * * @param organizationId the organizationId value to set. * @return the GcpCredentialsDetailsProperties object itself. */ @@ -110,7 +112,7 @@ public GcpCredentialsDetailsProperties withOrganizationId(String organizationId) /** * Get the type property: Type field of the API key (write only). - * + * * @return the type value. */ public String type() { @@ -119,7 +121,7 @@ public String type() { /** * Set the type property: Type field of the API key (write only). - * + * * @param type the type value to set. * @return the GcpCredentialsDetailsProperties object itself. */ @@ -130,7 +132,7 @@ public GcpCredentialsDetailsProperties withType(String type) { /** * Get the projectId property: Project ID field of the API key (write only). - * + * * @return the projectId value. */ public String projectId() { @@ -139,7 +141,7 @@ public String projectId() { /** * Set the projectId property: Project ID field of the API key (write only). - * + * * @param projectId the projectId value to set. * @return the GcpCredentialsDetailsProperties object itself. */ @@ -150,7 +152,7 @@ public GcpCredentialsDetailsProperties withProjectId(String projectId) { /** * Get the privateKeyId property: Private key ID field of the API key (write only). - * + * * @return the privateKeyId value. */ public String privateKeyId() { @@ -159,7 +161,7 @@ public String privateKeyId() { /** * Set the privateKeyId property: Private key ID field of the API key (write only). - * + * * @param privateKeyId the privateKeyId value to set. * @return the GcpCredentialsDetailsProperties object itself. */ @@ -170,7 +172,7 @@ public GcpCredentialsDetailsProperties withPrivateKeyId(String privateKeyId) { /** * Get the privateKey property: Private key field of the API key (write only). - * + * * @return the privateKey value. */ public String privateKey() { @@ -179,7 +181,7 @@ public String privateKey() { /** * Set the privateKey property: Private key field of the API key (write only). - * + * * @param privateKey the privateKey value to set. * @return the GcpCredentialsDetailsProperties object itself. */ @@ -190,7 +192,7 @@ public GcpCredentialsDetailsProperties withPrivateKey(String privateKey) { /** * Get the clientEmail property: Client email field of the API key (write only). - * + * * @return the clientEmail value. */ public String clientEmail() { @@ -199,7 +201,7 @@ public String clientEmail() { /** * Set the clientEmail property: Client email field of the API key (write only). - * + * * @param clientEmail the clientEmail value to set. * @return the GcpCredentialsDetailsProperties object itself. */ @@ -210,7 +212,7 @@ public GcpCredentialsDetailsProperties withClientEmail(String clientEmail) { /** * Get the clientId property: Client ID field of the API key (write only). - * + * * @return the clientId value. */ public String clientId() { @@ -219,7 +221,7 @@ public String clientId() { /** * Set the clientId property: Client ID field of the API key (write only). - * + * * @param clientId the clientId value to set. * @return the GcpCredentialsDetailsProperties object itself. */ @@ -230,7 +232,7 @@ public GcpCredentialsDetailsProperties withClientId(String clientId) { /** * Get the authUri property: Auth URI field of the API key (write only). - * + * * @return the authUri value. */ public String authUri() { @@ -239,7 +241,7 @@ public String authUri() { /** * Set the authUri property: Auth URI field of the API key (write only). - * + * * @param authUri the authUri value to set. * @return the GcpCredentialsDetailsProperties object itself. */ @@ -250,7 +252,7 @@ public GcpCredentialsDetailsProperties withAuthUri(String authUri) { /** * Get the tokenUri property: Token URI field of the API key (write only). - * + * * @return the tokenUri value. */ public String tokenUri() { @@ -259,7 +261,7 @@ public String tokenUri() { /** * Set the tokenUri property: Token URI field of the API key (write only). - * + * * @param tokenUri the tokenUri value to set. * @return the GcpCredentialsDetailsProperties object itself. */ @@ -270,7 +272,7 @@ public GcpCredentialsDetailsProperties withTokenUri(String tokenUri) { /** * Get the authProviderX509CertUrl property: Auth provider x509 certificate URL field of the API key (write only). - * + * * @return the authProviderX509CertUrl value. */ public String authProviderX509CertUrl() { @@ -279,7 +281,7 @@ public String authProviderX509CertUrl() { /** * Set the authProviderX509CertUrl property: Auth provider x509 certificate URL field of the API key (write only). - * + * * @param authProviderX509CertUrl the authProviderX509CertUrl value to set. * @return the GcpCredentialsDetailsProperties object itself. */ @@ -290,7 +292,7 @@ public GcpCredentialsDetailsProperties withAuthProviderX509CertUrl(String authPr /** * Get the clientX509CertUrl property: Client x509 certificate URL field of the API key (write only). - * + * * @return the clientX509CertUrl value. */ public String clientX509CertUrl() { @@ -299,7 +301,7 @@ public String clientX509CertUrl() { /** * Set the clientX509CertUrl property: Client x509 certificate URL field of the API key (write only). - * + * * @param clientX509CertUrl the clientX509CertUrl value to set. * @return the GcpCredentialsDetailsProperties object itself. */ @@ -310,77 +312,55 @@ public GcpCredentialsDetailsProperties withClientX509CertUrl(String clientX509Ce /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (organizationId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property organizationId in model GcpCredentialsDetailsProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property organizationId in model GcpCredentialsDetailsProperties")); } if (type() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property type in model GcpCredentialsDetailsProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property type in model GcpCredentialsDetailsProperties")); } if (projectId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property projectId in model GcpCredentialsDetailsProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property projectId in model GcpCredentialsDetailsProperties")); } if (privateKeyId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property privateKeyId in model GcpCredentialsDetailsProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property privateKeyId in model GcpCredentialsDetailsProperties")); } if (privateKey() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property privateKey in model GcpCredentialsDetailsProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property privateKey in model GcpCredentialsDetailsProperties")); } if (clientEmail() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property clientEmail in model GcpCredentialsDetailsProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property clientEmail in model GcpCredentialsDetailsProperties")); } if (clientId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property clientId in model GcpCredentialsDetailsProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property clientId in model GcpCredentialsDetailsProperties")); } if (authUri() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property authUri in model GcpCredentialsDetailsProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property authUri in model GcpCredentialsDetailsProperties")); } if (tokenUri() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property tokenUri in model GcpCredentialsDetailsProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property tokenUri in model GcpCredentialsDetailsProperties")); } if (authProviderX509CertUrl() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property authProviderX509CertUrl in model GcpCredentialsDetailsProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property authProviderX509CertUrl in model GcpCredentialsDetailsProperties")); } if (clientX509CertUrl() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property clientX509CertUrl in model GcpCredentialsDetailsProperties")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property clientX509CertUrl in model GcpCredentialsDetailsProperties")); } } 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 index 4dabcf13f8202..43504796b61ce 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** The gcpOrganization data. */ +/** + * The gcpOrganization data. + */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, @@ -18,17 +20,18 @@ @JsonTypeName("GcpOrganizationalData") @JsonSubTypes({ @JsonSubTypes.Type(name = "Organization", value = GcpOrganizationalDataOrganization.class), - @JsonSubTypes.Type(name = "Member", value = GcpOrganizationalDataMember.class) -}) + @JsonSubTypes.Type(name = "Member", value = GcpOrganizationalDataMember.class) }) @Immutable public class GcpOrganizationalData { - /** Creates an instance of GcpOrganizationalData class. */ + /** + * Creates an instance of GcpOrganizationalData class. + */ public GcpOrganizationalData() { } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 7fda4d5a6317f..188ad3f1d0764 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** The gcpOrganization data for the member account. */ +/** + * The gcpOrganization data for the member account. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "organizationMembershipType") @JsonTypeName("Member") @Fluent @@ -26,14 +28,16 @@ public final class GcpOrganizationalDataMember extends GcpOrganizationalData { @JsonProperty(value = "managementProjectNumber") private String managementProjectNumber; - /** Creates an instance of GcpOrganizationalDataMember class. */ + /** + * Creates an instance of GcpOrganizationalDataMember class. + */ public GcpOrganizationalDataMember() { } /** * 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() { @@ -43,7 +47,7 @@ public String 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. */ @@ -54,7 +58,7 @@ public GcpOrganizationalDataMember withParentHierarchyId(String parentHierarchyI /** * Get the managementProjectNumber property: The GCP management project number from organizational onboarding. - * + * * @return the managementProjectNumber value. */ public String managementProjectNumber() { @@ -63,7 +67,7 @@ public String 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. */ @@ -74,7 +78,7 @@ public GcpOrganizationalDataMember withManagementProjectNumber(String management /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index fc324cde83264..d573f0c0e1274 100644 --- 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 @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.List; -/** The gcpOrganization data for the parent account. */ +/** + * The gcpOrganization data for the parent account. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "organizationMembershipType") @JsonTypeName("Organization") @Fluent @@ -40,14 +42,16 @@ public final class GcpOrganizationalDataOrganization extends GcpOrganizationalDa @JsonProperty(value = "organizationName", access = JsonProperty.Access.WRITE_ONLY) private String organizationName; - /** Creates an instance of GcpOrganizationalDataOrganization class. */ + /** + * Creates an instance of GcpOrganizationalDataOrganization class. + */ public GcpOrganizationalDataOrganization() { } /** * 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() { @@ -57,7 +61,7 @@ public List 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. */ @@ -69,7 +73,7 @@ public GcpOrganizationalDataOrganization withExcludedProjectNumbers(List /** * Get the serviceAccountEmailAddress property: The service account email address which represents the organization * level permissions container. - * + * * @return the serviceAccountEmailAddress value. */ public String serviceAccountEmailAddress() { @@ -79,7 +83,7 @@ public String 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. */ @@ -91,7 +95,7 @@ public GcpOrganizationalDataOrganization withServiceAccountEmailAddress(String s /** * 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() { @@ -101,7 +105,7 @@ public String 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. */ @@ -112,7 +116,7 @@ public GcpOrganizationalDataOrganization withWorkloadIdentityProviderId(String w /** * Get the organizationName property: GCP organization name. - * + * * @return the organizationName value. */ public String organizationName() { @@ -121,7 +125,7 @@ public String organizationName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 index ac6bbd2acf3f0..45d89bb89da79 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The details about the project represented by the security connector. */ +/** + * The details about the project represented by the security connector. + */ @Fluent public final class GcpProjectDetails { /* @@ -34,13 +36,15 @@ public final class GcpProjectDetails { @JsonProperty(value = "projectName", access = JsonProperty.Access.WRITE_ONLY) private String projectName; - /** Creates an instance of GcpProjectDetails class. */ + /** + * Creates an instance of GcpProjectDetails class. + */ public GcpProjectDetails() { } /** * Get the projectNumber property: The unique GCP Project number. - * + * * @return the projectNumber value. */ public String projectNumber() { @@ -49,7 +53,7 @@ public String projectNumber() { /** * Set the projectNumber property: The unique GCP Project number. - * + * * @param projectNumber the projectNumber value to set. * @return the GcpProjectDetails object itself. */ @@ -60,7 +64,7 @@ public GcpProjectDetails withProjectNumber(String projectNumber) { /** * Get the projectId property: The GCP Project id. - * + * * @return the projectId value. */ public String projectId() { @@ -69,7 +73,7 @@ public String projectId() { /** * Set the projectId property: The GCP Project id. - * + * * @param projectId the projectId value to set. * @return the GcpProjectDetails object itself. */ @@ -80,7 +84,7 @@ public GcpProjectDetails withProjectId(String projectId) { /** * Get the workloadIdentityPoolId property: The GCP workload identity federation pool id. - * + * * @return the workloadIdentityPoolId value. */ public String workloadIdentityPoolId() { @@ -89,7 +93,7 @@ public String workloadIdentityPoolId() { /** * Get the projectName property: GCP project name. - * + * * @return the projectName value. */ public String projectName() { @@ -98,7 +102,7 @@ public String projectName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 index 68697c94c1f44..84cacbffcf5aa 100644 --- 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 @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** The GCP project connector environment data. */ +/** + * The GCP project connector environment data. + */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "environmentType") @JsonTypeName("GcpProject") @Fluent @@ -26,13 +28,21 @@ public final class GcpProjectEnvironmentData extends EnvironmentData { @JsonProperty(value = "projectDetails") private GcpProjectDetails projectDetails; - /** Creates an instance of GcpProjectEnvironmentData class. */ + /* + * Scan interval in hours (value should be between 1-hour to 24-hours) + */ + @JsonProperty(value = "scanInterval") + private Long scanInterval; + + /** + * Creates an instance of GcpProjectEnvironmentData class. + */ public GcpProjectEnvironmentData() { } /** * Get the organizationalData property: The Gcp project's organizational data. - * + * * @return the organizationalData value. */ public GcpOrganizationalData organizationalData() { @@ -41,7 +51,7 @@ public GcpOrganizationalData organizationalData() { /** * Set the organizationalData property: The Gcp project's organizational data. - * + * * @param organizationalData the organizationalData value to set. * @return the GcpProjectEnvironmentData object itself. */ @@ -52,7 +62,7 @@ public GcpProjectEnvironmentData withOrganizationalData(GcpOrganizationalData or /** * Get the projectDetails property: The Gcp project's details. - * + * * @return the projectDetails value. */ public GcpProjectDetails projectDetails() { @@ -61,7 +71,7 @@ public GcpProjectDetails projectDetails() { /** * Set the projectDetails property: The Gcp project's details. - * + * * @param projectDetails the projectDetails value to set. * @return the GcpProjectEnvironmentData object itself. */ @@ -70,9 +80,29 @@ public GcpProjectEnvironmentData withProjectDetails(GcpProjectDetails projectDet 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 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 new file mode 100644 index 0000000000000..f60c947fad029 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsListResponse.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 new file mode 100644 index 0000000000000..7db855c1ede45 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponse.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +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 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 new file mode 100644 index 0000000000000..a15a267937fca --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponseProperties.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.UUID; + +/** + * The sensitivity settings properties. + */ +@Fluent +public final class GetSensitivitySettingsResponseProperties { + /* + * List of selected sensitive info types' IDs. + */ + @JsonProperty(value = "sensitiveInfoTypesIds") + 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 + */ + @JsonProperty(value = "sensitivityThresholdLabelOrder") + private Float sensitivityThresholdLabelOrder; + + /* + * The id of the sensitivity threshold label. Any label at or above this rank will be considered sensitive. + */ + @JsonProperty(value = "sensitivityThresholdLabelId") + private UUID sensitivityThresholdLabelId; + + /* + * Microsoft information protection built-in and custom information types, labels, and integration status. + */ + @JsonProperty(value = "mipInformation") + private GetSensitivitySettingsResponsePropertiesMipInformation mipInformation; + + /** + * Creates an instance of GetSensitivitySettingsResponseProperties class. + */ + public GetSensitivitySettingsResponseProperties() { + } + + /** + * Get the sensitiveInfoTypesIds property: List of selected sensitive info types' IDs. + * + * @return the sensitiveInfoTypesIds value. + */ + public List sensitiveInfoTypesIds() { + return this.sensitiveInfoTypesIds; + } + + /** + * Set the sensitiveInfoTypesIds property: List of selected sensitive info types' IDs. + * + * @param sensitiveInfoTypesIds the sensitiveInfoTypesIds value to set. + * @return the GetSensitivitySettingsResponseProperties object itself. + */ + public GetSensitivitySettingsResponseProperties withSensitiveInfoTypesIds(List sensitiveInfoTypesIds) { + this.sensitiveInfoTypesIds = sensitiveInfoTypesIds; + return this; + } + + /** + * 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; + } + + /** + * Set 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. + * + * @param sensitivityThresholdLabelOrder the sensitivityThresholdLabelOrder value to set. + * @return the GetSensitivitySettingsResponseProperties object itself. + */ + public GetSensitivitySettingsResponseProperties + withSensitivityThresholdLabelOrder(Float sensitivityThresholdLabelOrder) { + this.sensitivityThresholdLabelOrder = sensitivityThresholdLabelOrder; + return this; + } + + /** + * 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 UUID sensitivityThresholdLabelId() { + return this.sensitivityThresholdLabelId; + } + + /** + * Set the sensitivityThresholdLabelId property: The id of the sensitivity threshold label. Any label at or above + * this rank will be considered sensitive. + * + * @param sensitivityThresholdLabelId the sensitivityThresholdLabelId value to set. + * @return the GetSensitivitySettingsResponseProperties object itself. + */ + public GetSensitivitySettingsResponseProperties withSensitivityThresholdLabelId(UUID sensitivityThresholdLabelId) { + this.sensitivityThresholdLabelId = sensitivityThresholdLabelId; + return this; + } + + /** + * 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; + } + + /** + * Set the mipInformation property: Microsoft information protection built-in and custom information types, labels, + * and integration status. + * + * @param mipInformation the mipInformation value to set. + * @return the GetSensitivitySettingsResponseProperties object itself. + */ + public GetSensitivitySettingsResponseProperties + withMipInformation(GetSensitivitySettingsResponsePropertiesMipInformation mipInformation) { + this.mipInformation = mipInformation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (mipInformation() != null) { + mipInformation().validate(); + } + } +} 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 new file mode 100644 index 0000000000000..fa0a02f11ba06 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponsePropertiesMipInformation.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Microsoft information protection built-in and custom information types, labels, and integration status. + */ +@Fluent +public final class GetSensitivitySettingsResponsePropertiesMipInformation { + /* + * Microsoft information protection integration status + */ + @JsonProperty(value = "mipIntegrationStatus") + private MipIntegrationStatus mipIntegrationStatus; + + /* + * List of Microsoft information protection sensitivity labels + */ + @JsonProperty(value = "labels") + private List